no dogma blog
no dogma blog
Blog Posts
Podcast
Web API Lambda Course
Polly Course
Photos
Contact
Support this Site
About
RSS
Light
Dark
Automatic
Posts
Locating and checking an executing DLL on a running web server or other application
Edit - even though the steps described below related to an example with IIS, you can use this technique for any running process, it’s just a matter of identifying the process id.
Sep 17, 2016
#
Assembly location
,
Debugging
,
Process explorer
Value cannot be null. Parameter name: constructor
Using Entity Framework I occasionally get the following error when reading from the database - `exceptionMessage=Value cannot be null. Parameter name: constructor` My Person class looked like this - 1 public class Person 2 { 3 public Person(string firstname, string lastname) 4 { 5 Firstname = firstname; 6 Lastname = lastname; 7 } 8 9 public Guid PersonId { get; set; } 10 public string Firstname { get; set; } 11 public string Lastname { get; set; } 12 public DateTime SomeDate { get; set; } 13 } There is no way for Entity Framework to know how to instantiate this object because there is no empty constructor.
Sep 17, 2016
#
Entity Framework
Entity Framework Core and calling a stored procedure
Download full source code here. I thought this would be easy, there is a method called ExecuteSqlCommand which takes the stored proc name and an array of parameters. I wanted to pass in two parameters and get one back, no problem, I’ve done this with ADO.
Jul 23, 2016
#
Entity Framework
Getting Web API Exception Details from a HttpResponseMessage
The Problem It’s hard to get the details of an exception from a Web Api response when calling Web Api from a C# program. (Skip to the solution if you don’t care about the background), it even handles inner exceptions!
Jul 12, 2016
#
AspNet
,
Exception
,
JSON
,
Response
,
WebApi
Cached nuget packages causing you problems?
Short version If you are having problems with nuget packages and think it might be related to local caching delete packages from these directories - %LocalAppData%\NuGet\Cache and %userprofile%\.nuget\packages\ Long version I was making nuget package, lets call it Foo, for my own use, not one that I was going to distribute publicly, but I was putting in on MyGet.
May 9, 2016
#
cached
,
MyGet
,
nuget
Web API 2 and ninject, how to make them work together
Full source code to download. I’ve been using ninject for a few years, but every time I use it with Web Api I hit some problem and they usually stem from not including the right nuget packages, not changing the DependencyResolver or (once) forgetting how to make a binding!
Apr 22, 2016
#
AspNet
,
Dependency Injection
,
ninject
,
WebApi
Entity Framework, checking the connection string of your context
Sometimes when using Entity Framework I want to verify that I’m connected to the database I think I’m connected to. Here’s how to check in Entity Framework 5, Entity Framework 6 and Entity Framework Core 1 (EF 7)
Apr 11, 2016
#
Connection Strings
,
Entity Framework
Customizing a specific string inside a class using AutoFixture
Full source code. I’ve been using AutoFixture for a while with my unit tests. It creates objects with prefilled data, saving me the hassle of manually constructing them. Basic usage If you want a string from AutoFixture do something like -
Apr 7, 2016
#
AutoFixture
,
SpecimenBuilder
,
TDD
,
Testing
Why you should use IDictionary, IList, etc
Summary When returning objects from a method try to use IList, IDictionary, etc instead of List and Dictionary. This is especially important when the method is inside a class library which you distribute.
Feb 17, 2016
#
Casting
,
Dictionary
,
Interfaces
Filtering a Dictionary by value with a List as the value
Filtering out entries in a dictionary is not too difficult when the key and value are simple. For example if you had - IDictionary oneToFourDictionary = new Dictionary {{ "one", 1 }, { "two", 2 }, { "three", 3 }, { "four", 4 } };
Feb 11, 2016
#
Dictionary
,
Filter
«
»
Cite
×