public async Task <ActionResult> AddCountry(Country country, string FaithName, string PolityName) { Faith faith = await _faithManager.GetFaithByName(FaithName); if (faith == null) { faith = await _faithManager.AddFaith(new Faith { Name = FaithName }); } Polity polity = await _polityManager.GetPolityByName(PolityName); if (polity == null) { polity = await _polityManager.AddPolity(new Polity { Name = PolityName }); } country.faith = faith; country.Polity = polity; Country cntr = await _manager.AddCountry(country); return(RedirectToAction("ShowCountry", "Country", new { Id = cntr.Id })); }
public async Task <ActionResult> AddFaith(Faith faith) { Faith ft = await _manager.AddFaith(faith); return(RedirectToAction("ShowFaith", "Faith", new { Id = ft.Id })); }