Skip to content

Commit 6771753

Browse files
committed
Testing new patterns
1 parent cb6f5f6 commit 6771753

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

Data/Context/InventoryDbContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class InventoryDbContext : DbContext
1414
public InventoryDbContext(DbContextOptions<InventoryDbContext> options)
1515
: base(options) { }
1616

17+
public InventoryDbContext() : base() { }
18+
1719
protected override void OnModelCreating(ModelBuilder modelBuilder)
1820
{
1921
base.OnModelCreating(modelBuilder);

Data/UnitOfWork/UnitOfWork.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ namespace TechInventory.Data.UnitOfWork;
77

88
public class UnitOfWork : IUnitOfWork, IDisposable
99
{
10-
private readonly InventoryDbContext _context;
11-
12-
public UnitOfWork(InventoryDbContext context)
13-
{
14-
_context = context;
15-
}
10+
private readonly InventoryDbContext _context = new InventoryDbContext();
1611

1712
private IRepository<Device> deviceRepository;
1813
private IRepository<DeviceModel> deviceModelRepository;

0 commit comments

Comments
 (0)