Simple database Northwnd for Code First.
Package Manager
Install-Package Northwnd
.NET CLI
dotnet add package Northwnd
Regions are defined in database:
%userprofile%/.nuget/northwnd/{version}/content/@Resources/Northwnd/northwnd.db
RegionID | RegionDescription |
---|---|
1 | Eastern |
2 | Western |
3 | Northern |
4 | Southern |
Output all regions using Code First:
using (var context = NorthwndContext.UseSqliteResource())
{
var regions = context.Regions.ToArray();
foreach (var region in regions)
Console.WriteLine($"{region.RegionID}\t{region.RegionDescription}");
}
Console output:
1 Eastern 2 Western 3 Northern 4 Southern