public ActionResult Create() { var model = new OrganizationModel(); model.Clinics.Add(new ClinicModel()); return View(model); }
public async Task<HttpResponseMessage> Update(Guid organizationId, OrganizationModel model) { var command = _mapper.Map<UpdateOrganization>(model); command.Id = organizationId; await _bus.ExecuteAsyncCommand(command); return new HttpResponseMessage(HttpStatusCode.NoContent); }
public async Task<HttpResponseMessage> Create(OrganizationModel model) { var command = _mapper.Map<CreateNewOrganization>(model); var organizationId = await _bus.ExecuteAsyncCommand(command); var response = Request.CreateResponse(HttpStatusCode.Created, model); var uri = _urlHelper.Action("Details", new {controller = "Organization", id = organizationId}); response.Headers.Location = new Uri(Request.RequestUri, uri); return response; }