Unit Testing EF Data With Core 2.0

I’ve discussed using the in-memory database object for Entity Framework in the blog post titled: Dot Net Core In Memory Unit Testing Using xUnit. That was for .Net Core 1.1.  Now I’m going to show a larger example of the in-memory database object for .Net Core 2.0.  There is only one minor difference in the … Read moreUnit Testing EF Data With Core 2.0

DotNet Core vs. NHibernate vs. Dapper Smackdown!

The Contenders Dapper Dapper is a hybrid ORM.  This is a great ORM for those who have a lot of ADO legacy code to convert.  Dapper uses SQL queries and parameters can be used just like ADO, but the parameters to a query can be simplified into POCOs.  Select queries in Dapper can also be … Read moreDotNet Core vs. NHibernate vs. Dapper Smackdown!

DBContextOptionsBuilder does not contain a definition for ‘UseSqlServer’

Attempting to use the correct NuGet packages for your code in .Net Core can be challenging.  In this instance there is no project.json error and yet this one property is missing: This will happen when your EF database project contains at least these two NuGet packages:     “dependencies”: {         “Microsoft.EntityFrameworkCore”: “1.1.1”,         “NETStandard.Library”: “1.6.1” … Read moreDBContextOptionsBuilder does not contain a definition for ‘UseSqlServer’

Dot Net Core Using the IOC Container

I’ve talked about Inversion Of Control in previous posts, but I’m going to go over it again.  If you’re new to IOC containers, breaking dependencies and unit testing, then this is the blog post you’ll want to read.  So let’s get started… Basic Concept of Unit Testing Developing and maintaining software is one of the … Read moreDot Net Core Using the IOC Container

Dot Net Core In Memory Unit Testing Using xUnit

When I started using .Net Core and xUnit I found it difficult to find information on how to mock or fake the Entity Framework database code.  So I’m going to show a minimized code sample using xUnit, Entity Framework, In Memory Database with .Net Core.  I’m only going to setup two projects: DataSource and UnitTests. … Read moreDot Net Core In Memory Unit Testing Using xUnit