Esempio n. 1
0
        /// <summary>
        /// Update Floor to db
        /// </summary>
        /// <param name="floor"></param>
        /// <returns></returns>
        public bool Update(Floor floor)
        {
            using (var context = new FloorContext())
            {
                context.Floors.Attach(floor);

                var entry = context.Entry(floor);
                entry.State = EntityState.Modified;
                context.SaveChanges();


                return(true);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Update Floor to db
        /// </summary>
        /// <param name="floor"></param>
        /// <returns></returns>
        public bool Update(Floor floor)
        {
            using (var context = new FloorContext())
            {
                context.Floors.Attach(floor);

                var entry = context.Entry(floor);
                entry.State = EntityState.Modified;
                context.SaveChanges();

                //log call
                _loggingService.Info("Elevator.Infrastructure.Data.Repositories: FloorRepository.Update");

                return(true);
            }
        }