public int Create(CreateUserInputModel inputModel) { var user = new User(inputModel.FullName, inputModel.Email, inputModel.BirthDate, inputModel.Password, inputModel.Role); _dbContext.Users.Add(user); _dbContext.SaveChanges(); return(user.Id); }
public int Create(CreateProjectCommentInputModel inputModel) { var projectComment = new ProjectComment(inputModel.Content, inputModel.IdProject, inputModel.IdUser); _dbContext.ProjectComments.Add(projectComment); _dbContext.SaveChanges(); return(projectComment.Id); }
public int Create(NewProjectInputModel inputModel) { var project = new Project(inputModel.Title, inputModel.Description, inputModel.IdClient, inputModel.IdFreelancer, inputModel.TotalCost, inputModel.FinishedAt); _dbContext.Projects.Add(project); _dbContext.SaveChanges(); return(project.Id); }