23 lines
522 B
C#
23 lines
522 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace DG.EntityFramework
|
|
{
|
|
public class DbContextProvider<TDbContext> : IDbContextProvider<TDbContext>
|
|
where TDbContext : DbContext
|
|
{
|
|
private readonly TDbContext _dbContext;
|
|
|
|
public DbContextProvider(TDbContext dbContext)
|
|
{
|
|
_dbContext = dbContext;
|
|
}
|
|
|
|
public TDbContext GetDbContext()
|
|
{
|
|
return _dbContext;
|
|
}
|
|
}
|
|
} |