I am developing a Web API, with an n-tier approach, using Entity Framework and using code first approach.My questions is does my DAL, and Business Logic layer are following DI/UoW/DDD pattern if not where should I change my code to make it more standard.What should my service layer look like to bridge between the web api and the business layer. I plan to define role management in this layer, only x user can perform this task.Is the validation defined in core, good there or should it be its own class for each item?This is a sample of the code, and may be missing stuff, but I am trying to emphasize, on how close i am to the DDD. Role implementation is missing. At this stage the Web API layout, and Service Layout isn't created but build on the fly, just wondering if there are tweak that I should do to this.StructureLibrary Name      ReferenceAPI               Service , Model, CommonService           Core, Model, CommonCore              DAL, Model, CommonDAL               Model, CommonModelCommonModelpublic abstract class Base{    public int ID { get; set; }    public Boolean isValid { get; set; }    public DateTime createdOn { get; set; }    public int createdID { get; set; }    public Person createdPerson { get; set; }    public DateTime updatedOn { get; set; }    public int updatedID { get; set; }    public Person updatedPerson { get; set; }}public class Person : Base{    public DateTime DOB { get; set; }    public virtual ICollection<Name> PreferredName { get; set; }    public virtual ICollection<Prefix> PrefixID { get; set; }    public virtual ICollection<Gender> GenderID { get; set; }    public virtual ICollection<Ethnicity> EthnicityID { get; set; }}DALpublic interface IPersonRepsoitory{    IEnumerable<Person> GetPersons();    Person GetPersonByID(int id);    IEnumerable<Person> GetPersonByFirst(string first);    IEnumerable<Person> GetPersonByLast(string last);    IEnumerable<Person> GetPersonBirthday(DateTime d);    IEnumerable<Person> GetPersonWithGroup(IEnumerable<Roles> r);    void InsertPerson(Person p);    void DeletePerson(int id);    void UpdatePerson(Person p);    void Save();}public class PersonRepository : IPersonRepsoitory, IDisposable{    private Context context;    private bool disposed = false;    public PersonRepository(Context _context)    {        this.context = _context;    }    public IEnumerable<Person> GetPersons()    {        return context.Person.ToList();    }    public Person GetPersonByID(int id)    {        return context.Person.Where(x => x.ID == id).FirstOrDefault();    }    public IEnumerable<Person> GetPersonByFirst(string first)    {        return context.Person.Where(x => x.PreferredName.First().firstName == first);    }    public IEnumerable<Person> GetPersonByLast(string last)    {        return context.Person.Where(x => x.PreferredName.First().lastName == last);    }    public IEnumerable<Person> GetPersonBirthday(DateTime d)    {        return context.Person.Where(x => x.DOB == d);    }    public IEnumerable<Person> GetPersonWithGroup(IEnumerable<Roles> r)    {        // need to complete association        return null;    }    public void InsertPerson(Person p)    {        context.Person.Add(p);    }    public void DeletePerson(int id)    {        Person p = context.Person.Find(id);        context.Person.Remove(p);    }    public void UpdatePerson(Person p)    {        context.Entry(p).State = EntityState.Modified;    }    public void Save()    {        context.SaveChanges();    }    protected virtual void Dispose(bool disposing)    {        if (!this.disposed)        {            if (disposing)            {                context.Dispose();            }        }        this.disposed = true;    }    public void Dispose()    {        Dispose(true);        GC.SuppressFinalize(this);    }}Corepublic interface IPersonCore{    IEnumerable<Person> PersonList();    Person UserWithID(int id);    IEnumerable<Person> UserWithRole(IEnumerable<Roles> r);    int AddPerson(Person p);    int RemovePerson(int id);    int UpdatePerson(Person p);}public class PersonCore : IPersonCore{    private IPersonRepsoitory dbPerson;    private Person currUser;    public PersonCore(Person _currUser)    {        this.dbPerson = new PersonRepository(new Context());        this.currUser = _currUser;    }    public IEnumerable<Person> PersonList()    {        return dbPerson.GetPersons();    }    public Person UserWithID(int id)    {        return dbPerson.GetPersonByID(id);    }    public IEnumerable<Person> UserWithRole(IEnumerable<Roles> r)    {        return dbPerson.GetPersonWithGroup(r);    }    public int AddPerson(Person p)    {        if (isValid(p))        {            p.createdOn = DateTime.Now;            p.updatedOn = DateTime.Now;            p.createdPerson = currUser;            p.updatedPerson = currUser;            dbPerson.InsertPerson(p);            return 1;        }        return 0;    }    public int RemovePerson(int id)    {        Person found = dbPerson.GetPersonByID(id);        if (found != null)        {            dbPerson.DeletePerson(found.ID);            return 1;        }        return 0;    }    public int UpdatePerson(Person p)    {        if (isValid(p))        {            Person found = dbPerson.GetPersonByID(p.ID);            if (found != null)            {                found = p;                found.updatedOn = DateTime.Now;                found.updatedPerson = currUser;                dbPerson.InsertPerson(found);                return 1;            }        }        return 0;    }    private static bool isValid(Person p)    {        if (p == null)        {            return false;        }        // More validation done here        return true;    }}Servicepublic interface IPersonService{    void GetListPerson();}public class personService : IPersonService{    private IPersonCore personCore;    public class personService()    {        this.personCore = new PersonCore();    }    public IEnumerable<Person> GetListPerson()    {        return personCore.PersonList();    }}Web APIpublic class PersonController : ApiController        {            private IPersonService personService;            public PersonController()            {                this.personService = new personService();            }            public ListPerson[] Get()            {                return personService.GetListPerson();            }        }
Does this structure follow DDD/UoW pattern?
c#;object oriented;asp.net
My questions is does my DAL, and Business Logic layer are following DI/UoW/DDD pattern if not where should I change my code to make it more standard.Regarding DI, I see no evidence of any DI in your code. At every layer, you have constructors like:public personService(){    this.personCore = new PersonCore();}To be using DI, it would look like:public personService(IPersonCore personCore){    this.personCore = personCore;}ie, you are injecting the dependency, not having each class create it for itself.The code is incomplete, but currently there's no evidence of any unit of work in the code.DDD is not a software pattern. Whetehr you are modelling your domain and using that to drive this design cannot be determined from the code.