Mvp24Hours.Infrastructure.Data.EFCore
3.1.101
See the version list below for details.
dotnet add package Mvp24Hours.Infrastructure.Data.EFCore --version 3.1.101
NuGet\Install-Package Mvp24Hours.Infrastructure.Data.EFCore -Version 3.1.101
<PackageReference Include="Mvp24Hours.Infrastructure.Data.EFCore" Version="3.1.101" />
paket add Mvp24Hours.Infrastructure.Data.EFCore --version 3.1.101
#r "nuget: Mvp24Hours.Infrastructure.Data.EFCore, 3.1.101"
// Install Mvp24Hours.Infrastructure.Data.EFCore as a Cake Addin #addin nuget:?package=Mvp24Hours.Infrastructure.Data.EFCore&version=3.1.101 // Install Mvp24Hours.Infrastructure.Data.EFCore as a Cake Tool #tool nuget:?package=Mvp24Hours.Infrastructure.Data.EFCore&version=3.1.101
Relational Database
A relational database is a digital database based on the relational model of data. Wikipedia
A repository pattern with search and paging criteria was implemented, as well as a work unit. We use Entity Framework to perform persistence. The Entity Framework supports several databases and those that have been tested are: PostgreSql, MySQL and SQLServer.
Prerequisites (Not Required)
Add a configuration file to the project named "appsettings.json". The file must contain a key with connection data, for example, ConnectionStrings/DataContext as below:
{
"ConnectionStrings": {
"DataContext": "connection string"
},
"Mvp24Hours": {
"Persistence": {
"MaxQtyByQueryPage": 30,
"ReadUncommitedQuery": false
}
}
}
You will be able to use direct database connection, which is not recommended. Access the ConnectionStrings website and see how to set up the connection with your bank.
PostgreSql
Installation
/// Package Manager Console >
Install-Package Microsoft.Extensions.DependencyInjection -Version 6.0.0
Install-Package Npgsql.EntityFrameworkCore.PostgreSQL -Version 5.0.10
Install-Package Mvp24Hours.Infrastructure.Data.EFCore
Configuration
/// Startup.cs
services.AddDbContext<DataContext>(
options => options.UseNpgsql(ConfigurationHelper.AppSettings.GetConnectionString("DataContext"),
options => options.SetPostgresVersion(new Version(9, 6)))
);
services.AddMvp24HoursDbService<DataContext>();
Using Docker
// Command
docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=MyPass@word -d onjin/alpine-postgres
// ConnectionString
Host=localhost;Port=5432;Pooling=true;Database=MyTestDb;User Id=postgres;Password=MyPass@word;
MySql
Installation
/// Package Manager Console >
Install-Package Microsoft.Extensions.DependencyInjection -Version 6.0.0
Install-Package MySql.EntityFrameworkCore -Version 5.0.8
Install-Package Mvp24Hours.Infrastructure.Data.EFCore
Configuration
/// Startup.cs
services.AddDbContext<DataContext>(options =>
options.UseMySQL(ConfigurationHelper.AppSettings.GetConnectionString("DataContext")));
services.AddMvp24HoursDbService<DataContext>();
Using Docker
// Command
docker run --name mysql -v /mysql/data/:/var/lib/mysql -d -p 3306:3306 -e MYSQL_ROOT_PWD=MyPass@word -e MYSQL_USER=user -e MYSQL_USER_PWD=MyPass@word leafney/docker-alpine-mysql
// ConnectionString
server=localhost;user=root;password=MyPass@word;database=MyTestDb
SQL Server
Installation
/// Package Manager Console >
Install-Package Microsoft.Extensions.DependencyInjection -Version 6.0.0
Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 5.0.10
Install-Package Mvp24Hours.Infrastructure.Data.EFCore
// to run commands in the database (functions, procedures, projections)
Install-Package Mvp24Hours.Infrastructure.Data.EFCore.SQLServer
Configuration
/// Startup.cs
services.AddDbContext<DataContext>(options =>
options.UseSqlServer(ConfigurationHelper.AppSettings.GetConnectionString("DataContext")));
services.AddMvp24HoursDbService<DataContext>();
Using Docker
// Command
docker run --name sqlserver -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=MyPass@word" -p 1433:1433 -d mcr.microsoft.com/mssql/server
// ConnectionString
Data Source=.,1433;Initial Catalog=MyTestDb;Persist Security Info=True;User ID=sa;Password=MyPass@word;Pooling=False;
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.EntityFrameworkCore (>= 5.0.12)
- Microsoft.EntityFrameworkCore.Relational (>= 5.0.12)
- Mvp24Hours.Core (>= 3.1.101)
- Mvp24Hours.Infrastructure (>= 3.1.101)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.7.151 | 68 | 7/15/2024 |
8.3.261 | 113 | 3/26/2024 |
8.2.102 | 299 | 2/9/2024 |
8.2.101 | 241 | 2/7/2024 |
4.1.191 | 365 | 1/19/2024 |
4.1.181 | 265 | 1/19/2024 |
3.12.262 | 406 | 12/26/2023 |
3.12.261 | 328 | 12/26/2023 |
3.12.221 | 365 | 12/22/2023 |
3.12.151 | 342 | 12/17/2023 |
3.6.221 | 3,846 | 6/22/2022 |
3.4.111 | 1,047 | 4/11/2022 |
3.2.241 | 996 | 2/24/2022 |
3.2.171 | 853 | 2/17/2022 |
3.2.151 | 817 | 2/15/2022 |
3.2.142 | 877 | 2/14/2022 |
3.2.141 | 855 | 2/14/2022 |
3.2.21 | 860 | 2/2/2022 |
3.1.243 | 886 | 1/25/2022 |
3.1.242 | 867 | 1/24/2022 |
3.1.241 | 823 | 1/24/2022 |
3.1.221 | 873 | 1/22/2022 |
3.1.201 | 852 | 1/20/2022 |
3.1.101 | 840 | 1/10/2022 |
2.12.291 | 756 | 12/29/2021 |
2.12.102 | 771 | 12/10/2021 |
2.12.101 | 765 | 12/10/2021 |
2.12.71 | 726 | 12/7/2021 |
2.11.241 | 4,583 | 11/24/2021 |