-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSqlServerBaseRepository.cs
29 lines (26 loc) · 1019 Bytes
/
SqlServerBaseRepository.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using BenjaminAbt.EntityFrameworkDemo.Database.Entities;
using BenjaminAbt.EntityFrameworkDemo.Database.Repositories;
using Microsoft.EntityFrameworkCore;
namespace BenjaminAbt.EntityFrameworkDemo.Database.SqlServer.Repositories;
/// <summary>
/// Base repository for SQL Server database.
/// </summary>
/// <typeparam name="T">Entity type</typeparam>
public abstract class SqlServerBaseRepository<T>
: BaseRepository<T> where T : BaseEntity
{
/// <summary>
/// Database context of SQL Server.
/// </summary>
protected new ISqlServerDbContext DbContext { get; }
/// <summary>
/// Constructor for SQL Server base repository.
/// </summary>
/// <param name="dbContext">The database context for the repository.</param>
/// <param name="entitySet">The DbSet containing the entities being accessed.</param>
protected SqlServerBaseRepository(ISqlServerDbContext dbContext, DbSet<T> entitySet)
: base(dbContext, entitySet)
{
DbContext = dbContext;
}
}