Exemple #1
0
        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 }));
        }
Exemple #2
0
        public async Task <ActionResult> AddPolity(Polity polity)
        {
            Polity pt = await _manager.AddPolity(polity);

            return(RedirectToAction("ShowPolity", "Polity", new { Id = pt.Id }));
        }