Friday, 13 February 2015
Dependency injection
A couple of useful blogs I just read about dependency injection, something I rarely use but probably should some more.
dotnetanalysis.blogspot.co.uk/2011/11/dependency-inversion-or-inversion-of.html
www.jamesshore.com/Blog/Dependency-Injection-Demystified.html
Friday, 6 February 2015
Using C# dynamic type and NewtonSoft.Json to deserialize JSON
Today I had a requirement to poke a JSON api and capture the response as part of a payment gateway, all from my C# code-behind in a .Net webforms project. Dynamic seemed a good way to go:
var results = JsonConvert.DeserializeObject(jsonResponseFromApi); var oneThingIWant = results.thingYouWant; var anotherThingIWant = results.something.somethingDeeper;
Subscribe to:
Posts (Atom)