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
Entity Framework
Requesting Data from two Data Stores in Parallel - Cache and Database
There are times when firing off the same query in parallel to two or more data stores is a good choice, keeping the first response, and canceling the other requests. Here I show how a achieve that even if the Task<> types are different.
Dec 10, 2021
#
dotNet
,
Container
,
Docker Compose
,
Docker
,
Redis
,
WebApi
,
Entity Framework
,
WhenAny
Using Entity Framework for .NET 6 with SQL Server in a Docker Container
Want to see how easy it is to use a SQL Server Docker container with Entity Framework for .NET 6?
Aug 17, 2021
#
Docker
,
Container
,
SQL Server
,
Entity Framework
,
dotNet 6
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
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
Entity Framework with Proper Foreign Key Names
Full source code here. One of the very nice features of Entity Framework is the navigational properties. But it is easy to set them up in a less that optimal way.
Jun 12, 2015
#
Entity Framework
Entity Framework Migrations with an existing database
Introduction If you read my post on Entity Framework migrations, you might be saying, “that’s amazing, but that’s all very well for new projects, but we’ve got eighty tables in place already and that code first migration ship has sailed”.
May 11, 2015
#
Entity Framework
,
Migrations
Entity Framework non null foreign key migration
Full source code is provided. Overview This post gives a quick overview of how to use Entity Framework migrations and a detailed example of how to handle the addition of a new non null foreign keyed column to an existing table with data in it.
Apr 30, 2015
#
Database
,
Entity Framework
,
Migrations
Using JSON to store application preferences and configuration
Download full source code. Storing configuration preferences in the database is not a hard task. It usually involves storing the name of the preference, the value and the type in the database.
Apr 6, 2015
#
Entity Framework
,
JSON
Saving enums as strings with Entity Framework
In September 2018 I wrote a new post explaining how to store enums as ints or strings with Entity Framework Core. It is a nicer solution than the one presented here.
Nov 23, 2014
#
Entity Framework
,
Enum
«
»
Cite
×