Beispiel #1
0
        public static void SoftDelete(int id)
        {
            SinaicspDataModelContainer _context = new Sinaicsp_API.SinaicspDataModelContainer();
            Accommodation _item = _context.Accommodations.FirstOrDefault(a => a.Id == id);

            _item.IsDeleted = true;
            _context.SaveChanges();
        }
Beispiel #2
0
        public static bool Update(int id, string name)
        {
            SinaicspDataModelContainer _context = new Sinaicsp_API.SinaicspDataModelContainer();
            Accommodation itemById = _context.Accommodations.FirstOrDefault(a => a.Id == id);
            Accommodation _item    = itemById;

            _item.Name = name;
            _context.SaveChanges();
            return(true);
        }