public IActionResult Remove(AllowedSiteDTO dto)
        {
            try
            {
                _allowedSite.Remove(dto.IdAllowedSite);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            return(RedirectToAction("Info", "Origins", new { id = dto.IdOrigin }));
        }
Beispiel #2
0
        public void Add(AllowedSiteDTO dto)
        {
            var site = new AllowedSite
            {
                IdAllowedSite = Guid.NewGuid(),
                IdOrigin      = dto.IdOrigin,
                Site          = dto.Site
            };

            _db.AllowedSites.Add(site);

            _db.SaveChanges();
        }