diff --git a/Bulky.DataAccess/Repository/IRepository/IOrderDetailRepository.cs b/Bulky.DataAccess/Repository/IRepository/IOrderDetailRepository.cs new file mode 100644 index 0000000..f3697ac --- /dev/null +++ b/Bulky.DataAccess/Repository/IRepository/IOrderDetailRepository.cs @@ -0,0 +1,9 @@ +using BookBazaar.Models; + +namespace BookBazaar.DataAccess.Repository.IRepository +{ + public interface IOrderDetailRepository : IRepository + { + void Update(OrderDetail obj); + } +} diff --git a/Bulky.DataAccess/Repository/IRepository/IOrderHeaderRepository.cs b/Bulky.DataAccess/Repository/IRepository/IOrderHeaderRepository.cs new file mode 100644 index 0000000..5ecc1cd --- /dev/null +++ b/Bulky.DataAccess/Repository/IRepository/IOrderHeaderRepository.cs @@ -0,0 +1,9 @@ +using BookBazaar.Models; + +namespace BookBazaar.DataAccess.Repository.IRepository +{ + public interface IOrderHeaderRepository : IRepository + { + void Update(OrderHeader obj); + } +} diff --git a/Bulky.DataAccess/Repository/IRepository/IUnitOfWork.cs b/Bulky.DataAccess/Repository/IRepository/IUnitOfWork.cs index 5aaf0c4..0fcbe40 100644 --- a/Bulky.DataAccess/Repository/IRepository/IUnitOfWork.cs +++ b/Bulky.DataAccess/Repository/IRepository/IUnitOfWork.cs @@ -7,6 +7,8 @@ public interface IUnitOfWork ICompanyRepository Company { get; } IProductRepository Product { get; } IShoppingCartRepository ShoppingCart { get; } + IOrderHeaderRepository OrderHeader { get; } + IOrderDetailRepository OrderDetail { get; } void Save(); } } diff --git a/Bulky.DataAccess/Repository/OrderDetailRepository.cs b/Bulky.DataAccess/Repository/OrderDetailRepository.cs new file mode 100644 index 0000000..4ce7e40 --- /dev/null +++ b/Bulky.DataAccess/Repository/OrderDetailRepository.cs @@ -0,0 +1,21 @@ +using BookBazaar.DataAccess.Data; +using BookBazaar.DataAccess.Repository.IRepository; +using BookBazaar.Models; + +namespace BookBazaar.DataAccess.Repository +{ + public class OrderDetailRepository : Repository, IOrderDetailRepository + { + private readonly ApplicationDbContext _db; + + public OrderDetailRepository(ApplicationDbContext db) : base(db) + { + _db = db; + } + + public void Update(OrderDetail obj) + { + _db.Update(obj); + } + } +} diff --git a/Bulky.DataAccess/Repository/OrderHeaderRepository.cs b/Bulky.DataAccess/Repository/OrderHeaderRepository.cs new file mode 100644 index 0000000..1190d94 --- /dev/null +++ b/Bulky.DataAccess/Repository/OrderHeaderRepository.cs @@ -0,0 +1,21 @@ +using BookBazaar.DataAccess.Data; +using BookBazaar.DataAccess.Repository.IRepository; +using BookBazaar.Models; + +namespace BookBazaar.DataAccess.Repository +{ + public class OrderHeaderRepository : Repository, IOrderHeaderRepository + { + private readonly ApplicationDbContext _db; + + public OrderHeaderRepository(ApplicationDbContext db) : base(db) + { + _db = db; + } + + public void Update(OrderHeader obj) + { + _db.Update(obj); + } + } +} diff --git a/Bulky.DataAccess/Repository/UnitOfWork.cs b/Bulky.DataAccess/Repository/UnitOfWork.cs index 24ac8a1..3458a14 100644 --- a/Bulky.DataAccess/Repository/UnitOfWork.cs +++ b/Bulky.DataAccess/Repository/UnitOfWork.cs @@ -11,6 +11,8 @@ public class UnitOfWork : IUnitOfWork public ICompanyRepository Company { get; private set; } public IProductRepository Product { get; private set; } public IShoppingCartRepository ShoppingCart { get; private set; } + public IOrderHeaderRepository OrderHeader { get; private set; } + public IOrderDetailRepository OrderDetail { get; private set; } public UnitOfWork(ApplicationDbContext db) { _db = db; @@ -19,6 +21,8 @@ public UnitOfWork(ApplicationDbContext db) Product = new ProductRepository(_db); Company = new CompanyRepository(_db); ShoppingCart = new ShoppingCartRepository(_db); + OrderHeader = new OrderHeaderRepository(_db); + OrderDetail = new OrderDetailRepository(_db); } public void Save()