예제 #1
0
        public Emergency Add(Emergency entity)
        {
            if (entity.Id > 0) return entity;

            context.Emergency.AddObject(entity);

            try
            {
                context.SaveChanges();
            }
            catch (OptimisticConcurrencyException e)
            {
                //An optimistic concurrency violation has occurred in the data source.
                throw new ConcurrencyException(e.Message);
            }

            return entity;
        }
예제 #2
0
 public void Delete(Emergency entity)
 {
     context.DeleteObject(entity);
 }
예제 #3
0
 public Emergency Update(Emergency entity)
 {
     return entity;
 }