At work we use almost always the same pattern EF, DAL and BLL. I wish to try something new.This is the project structure:And here a code sample with only Users entity:public interface IRepository : IUsersRepository{    void Save();}public partial class Repository : IRepository{    private DatabaseEntities _context;    private DatabaseEntities Context    {        get        {            if (_context == null)            {                _context = new DatabaseEntities();            }            return _context;        }    }    public void Save()    {        Context.SaveChanges();    }}public interface IUsersRepository{    IList<User> GetUsers();    User GetUserById(int id);    void AddUser(User entity);    void UpdateUser(User entity);    void DeleteUser(User entity);}public partial class Repository : IUsersRepository{    public IList<User> GetUsers()    {        return Context.Users            .OrderBy(x => x.Name)            .ToList();    }    public User GetUserById(int id)    {        return Context.Users            .Where(x => x.UserID == id)            .FirstOrDefault();    }    public void AddUser(User entity)    {        Context.Users.Add(entity);    }    public void UpdateUser(User entity)    {        Context.Users.Attach(entity);        Context.Entry(entity).State = EntityState.Modified;    }    public void DeleteUser(User entity)    {        Context.Users.Remove(entity);    }}public interface IBusinessLogic : IUserBusinessLogic { }public partial class BusinessLogic : IBusinessLogic{    private IRepository repository = null;    private IRepository Repository    {        get        {            if (repository == null)                repository = new Repository();            return repository;        }    }}public interface IUserBusinessLogic{    IList<User> GetUsers();    User GetUserById(int id);    void AddUser(User entity);    void UpdateUser(User entity);    void DeleteUser(User entity);}public partial class BusinessLogic : IUserBusinessLogic{    public IList<User> GetUsers()    {        return Repository.GetUsers();    }    public User GetUserById(int id)    {        return Repository.GetUserById(id);    }    public void AddUser(User entity)    {        Repository.AddUser(entity);        Repository.Save();    }    public void UpdateUser(User entity)    {        Repository.UpdateUser(entity);        Repository.Save();    }    public void DeleteUser(User entity)    {        Repository.DeleteUser(entity);        Repository.Save();    }}As you can see the code is really linear and simply. all classes are partial classes of Repository or BusinessLogic that inherit by IRepository and IBusinessLogic, these interfaces inherit all other entities interfaces then with one instance of Repository or BusinessLogic object can call methods of all entities. Main BusinessLogic initializes an Repository object and usually in web application project there is an instance of BusinessLogic.Most of the projects are simple CRUD operations so I'm wondering if there is some way to generalize these methods considering that the operations are always the same. Change only the entity and the property where query.
Users repository
c#;repository;n tier