public async Task <Project> CreateAsync(string name, string description, DateTime startAt) { using (CompanyDbContext context = CompanyDbContext.Create()) { var entity = new Dal.Entitites.Project { Description = description, Name = name, StartAt = startAt }; context.Project.Add(entity); await context.SaveChangesAsync(); return(ToDomain(entity)); } }
public Project ToDomain(Dal.Entitites.Project entity) { return(new Project(entity.Id, entity.Name, entity.Description, entity.StartAt)); }