This is how I imagine my project's layering:BLLShould be independent and contain only pure business logic and propertiesSample Domain Model:public class Role{    private UnitOfWork uow { get; set; }    public Role()    {        uow = new UnitOfWork();    }    public int RoleId { get; set; }    public string Name { get; set; }    public string ID { get; set; }    public string Description { get; set; }    public int AddRole()    {        //Mapping from Business 'Role' type to Data Model 'Role' type        AutoMapper.Mapper.CreateMap<SoC.BLL.Role, SoC.DAL.Role>();        var model = AutoMapper.Mapper.Map<SoC.DAL.Role>(this);        return uow.Roles.Add(model);    }}DALContain generic repository and Unit of work and data model meaning model that will reflect the database.Sample Data Model:public class Role{    [Key]    public int RoleId { get; set; }    [Required]    [StringLength(50, ErrorMessage = Name Cannot Be More Than 50 Characters)]    public string Name { get; set; }    [Required]    [StringLength(6, ErrorMessage = ID Cannot Be More Than 6 Characters)]    public string ID { get; set; }    [Required]    [StringLength(250, ErrorMessage = Description Cannot Be More Than 250 Characters)]    public string Description { get; set; }}WebThis will be ASP.NET MVC app that will use BLL. (Should or should not be aware of DAL?)Sample Controller Action:public ActionResult Index(){    var role = new Role { RoleId = 1, ID = ADMIN, Name = Administrator, Description = Hello World  };    int check = role.AddRole();    return View();}So, from app I am communicating with the Domain Model which has a AddRole() method that will first map using automapper to the equivalent Data Model and then call Add() of repo method to persist the record.This way my BLL is becoming a little dependent on AutoMapper and DAL but my DAL seems independent. I am trying to create just a simple layering for a simple yet well maintained project. Please suggest on its problems and improvements.
ASP.NET MVC Project Layering
c#;asp.net mvc
To start off, I have no idea what a SoC.DAL.Role is. Your namespaces are short abbreviations. This is quite hard to follow for people not really into your project.Your role can add itself to a repository. This is not behaviour that I would expect. I would have a simple repository class (RoleManager?) that is capable of adding roles.Role role = new Role(...);new RoleManager().AddRole(role);As such, you have 4 layers. One data access layer, one model layer, one domain layer and one GUI layer.