// POST api/Organizations public OrganizationDto Post([FromBody] OrganizationDto organization) { var newOrganization = organization.ConvertFromDto(); OrganizationService.Add(newOrganization); return(newOrganization.ConvertToDto()); }
public ActionResult Create(OrganizationViewModel organization) { //OrganizationService os = new OrganizationService(); try { if (ModelState.IsValid) { organization o = new organization(); //o.id = organization.id; o.name = organization.name; o.type = organization.type; o.PresidentID = organization.PresidentID; o.Location = organization.Location; os.Add(o); os.Commit(); Session["organization"] = o; return(RedirectToAction("Index")); } return(View()); } catch { return(View()); } }