public IActionResult Post([FromBody] OrganizationTypeModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var response = organizationTypeService.Add(model); if (!response.Success) { return(BadRequest(response.Message)); } return(Ok(response.ReturnedId)); }
public IActionResult Create(RegisterOrganizationTypeForm registerOrganizationTypeForm) { if (ModelState.IsValid) { var organizationType = _organizationTypeService.Add(registerOrganizationTypeForm.Title); var organizationTypeViewModel = _organizationTypeModelBuilder.BuildNew(organizationType); return(Ok(organizationTypeViewModel)); } else { return(BadRequest()); } }