Esempio n. 1
0
        public void Location_Add(Location item)
        {
            using (WorkScheduleContext context = new WorkScheduleContext())
            {
                Location added = null;

                added = context.Locations.Add(item);

                context.SaveChanges();

            }
        }
Esempio n. 2
0
        public void Location_Update(Location item)
        {
            using (WorkScheduleContext context = new WorkScheduleContext())
            {
                context.Entry<Location>(context.Locations.Attach(item)).State = System.Data.Entity.EntityState.Modified;

                context.SaveChanges();
            }
        }