Grad.CsLib.Data
2.0.12
dotnet add package Grad.CsLib.Data --version 2.0.12
NuGet\Install-Package Grad.CsLib.Data -Version 2.0.12
<PackageReference Include="Grad.CsLib.Data" Version="2.0.12" />
<PackageVersion Include="Grad.CsLib.Data" Version="2.0.12" />
<PackageReference Include="Grad.CsLib.Data" />
paket add Grad.CsLib.Data --version 2.0.12
#r "nuget: Grad.CsLib.Data, 2.0.12"
#:package Grad.CsLib.Data@2.0.12
#addin nuget:?package=Grad.CsLib.Data&version=2.0.12
#tool nuget:?package=Grad.CsLib.Data&version=2.0.12
CsLib.Data
This package has utilities for EF Core and Dapper.
I prefer EF Core's scaffold tool, but it is painful to write queries with, so for that we use Dapper.
This project is intended entirely for SQL Server.
Requirements
- .NET Core 10
- dotnet-ef:
dotnet tool install --global dotnet-ef
Dependencies
Here are the main dependencies:
Schema Migrations
Schemas are intended to be written in SQL files and then scaffolded with EF Core into C# models and DbContext classes.
The convention is:
- Have a project in the solution which name ends in
Data, e.g.ExampleData. - Have a folder inside it called
schema, containing SQL files that sort correctly to run in order.- For example,
0001_Initial.sql,0002_AddTable.sql, etc. - Include them in the assembly:
<ItemGroup> <EmbeddedResource Include="schema/**/*.sql" /> </ItemGroup>
- For example,
- In the
Dataproject'sProgram.cs, create aDatabaseMigratorand call itsUpgrade()method. - Run the
Dataproject against the database. - Run the EF Core scaffold tool against the database.
The CsLib.Tool project has some automation for this flow, it will take care of running the migrations and scaffolding the models against a temporary Docker database.
Other Utilities
See the Grad.CsLib.Data.md file for the full list.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Dapper (>= 2.1.66)
- dbup-core (>= 6.0.15)
- dbup-sqlserver (>= 6.0.16)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Grad.CsLib.Data:
| Package | Downloads |
|---|---|
|
Grad.Codebook
Data model for Grad Codebook. It acts as an interface to U of I code data, such as programs and departments. |
|
|
Grad.Codebook.Testing
Testing utilities for Grad Codebook. Allows projects to set up a test Codebook database with tables instead of views. |
GitHub repositories
This package is not used by any popular GitHub repositories.