public async Task <Project> AddProject(ProjectDTO project) { var proj = new Project() { Name = project.Name, Description = project.Description }; await context.AddAsync(proj); await context.SaveChangesAsync(); return(proj); }
public async Task <Profile> EditProfile(ProfileDTO profile, int profileId) { var _profile = await context.Profiles.FirstOrDefaultAsync(o => o.Id == profileId); _profile.Adress = profile.Adress; _profile.BirthDate = profile.BirthDate; _profile.FathersName = profile.FathersName; _profile.Gender = profile.Gender; _profile.Name = profile.Name; _profile.Surname = profile.Surname; _profile.PhoneNumber = profile.PhoneNumber; await context.SaveChangesAsync(); return(_profile); }
public async Task <ToDoTask> AddTask(ToDoTaskDTO task) { var _task = new ToDoTask() { Title = task.Title, Description = task.Description, StartDate = DateTime.Now, isCompleted = false, EstimatedDate = task.EstimatedDate }; await context.AddAsync(_task); await context.SaveChangesAsync(); return(_task); }
public async Task <Marks> AddMark(MarkDTO marks) { var mark = new Marks() { Name = marks.Name, Description = marks.Description, Image = marks.Image }; await context.Markses.AddAsync(mark); await context.SaveChangesAsync(); return(mark); }