public async Task Update(Guid id, UpsertUserTypeModel model) { var userType = await repository.GetById(id); userType.Update(model.Name, model.Description); repository.Update(userType); await repository.SaveChanges(); }
public async Task <UserTypeModel> Add(UpsertUserTypeModel model) { var userType = new UserType(model.Name, model.Description); await repository.Add(userType); await repository.SaveChanges(); return(mapper.Map <UserTypeModel>(userType)); }
public async Task <IActionResult> Update([FromRoute] Guid id, [FromBody] UpsertUserTypeModel model) { await userTypeService.Update(id, model); return(NoContent()); }
public async Task <IActionResult> Add([FromBody] UpsertUserTypeModel model) { var result = await userTypeService.Add(model); return(Created(result.Id.ToString(), null)); }