Ther are many repository out there. From many of them meets our requirement or not. So I have created a Complete Repository For any CRUD application.
This project using MVC Core 2.1 along with visual studio Download it for here
After creating Project Add DBContext class If you don't know how to add DbContext:How to Cteate Application DbContext
Now flow the steps carefully
- Add Application DbContext
- Add IRepository.cs
- Add Repository.cs
- Add IUnitOfWork.cs
- Add UnitOfWork.cs
'''
services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer( Configuration.GetConnectionString("DefaultConnection"))); services.AddScoped(typeof(IUnitOfWork), typeof(UnitOfWork)); '''