[x] abstract EntityBase is a base class for models classes, it contains only public int Id { get; set; } property
[x] MealManager Model should inherit from EntityBase
[x] Generic IRepository where TEntity is EntityBase.
[x] Generic DataRepository class that implements the IRepository interface.
[x] IUnitOfWork inherit from IDisposable, it is an interface for UnitOfWork class.
[x] The UnitOfWork inherits from IUnitOfWork. Class serves one purpose: to make sure that when you use multiple repositories, they share a single database context. That way, when a unit of work is complete you can call the SaveChangesAsync method on that instance of the context and be assured that all related changes will be coordinated.
[x] Change parameter from MealManagerRepository to IUnitOfWork uow in MealManagersController.
Steps done:
[x] abstract EntityBase is a base class for models classes, it contains only public int Id { get; set; } property
[x] MealManager Model should inherit from EntityBase
[x] Generic IRepository where TEntity is EntityBase.
[x] Generic DataRepository class that implements the IRepository interface.
[x] IUnitOfWork inherit from IDisposable, it is an interface for UnitOfWork class.
[x] The UnitOfWork inherits from IUnitOfWork. Class serves one purpose: to make sure that when you use multiple repositories, they share a single database context. That way, when a unit of work is complete you can call the SaveChangesAsync method on that instance of the context and be assured that all related changes will be coordinated.
[x] Change parameter from MealManagerRepository to
IUnitOfWork uow
in MealManagersController.[x] Add Scope Service to the Program Container.