Interface
Create a new IDatingRepository with methods for Add, Delete, SaveAll, GetUsers and GetUser.
public interface IDatingRepository
{
void Add<T>(T entity) where T: class;
void Delete<T>(T entity) where T: class;
Task<bool> SaveAll();
Task<IEnumerable<User>> GetUsers();
Task<User> GetUser(int id);
}
Implementation
Create a new DatingRepository and implement IDatingRepository.
Register
In Startup.cs Configure register the repository for DI.
services.AddScoped<IDatingRepository, DatingRepository>();