示例#1
0
        public Alert Add(Alert alert)
        {
            Alert ret = context.Add <Alert>(alert).Entity;

            context.SaveChanges();

            return(ret);
        }
示例#2
0
        public User Add(User user)
        {
            User ret = context.Add <User>(user).Entity;

            context.SaveChanges();

            return(ret);
        }
示例#3
0
        public Users Save(Users user)
        {
            var state = user.UserId == 0 ? EntityState.Added : EntityState.Modified;

            _context.Entry(user).State = state;
            _context.Add(user);
            _context.SaveChanges();
            return(user);
        }
        public Infra.Entidades.Environment Save(Infra.Entidades.Environment item)
        {
            var state = item.EnvironmentId == 0 ? EntityState.Added : EntityState.Modified;

            _context.Entry(item).State = state;
            _context.Add(item);
            _context.SaveChanges();
            return(item);
        }
示例#5
0
        public Logs Save(Logs item)
        {
            var state = item.ErrorOccurrenceId == 0 ? EntityState.Added : EntityState.Modified;

            _context.Entry(item).State = state;
            _context.Add(item);
            _context.SaveChanges();
            return(item);
        }
        public Level Save(Level item)
        {
            var state = item.LevelId == 0 ? EntityState.Added : EntityState.Modified;

            _context.Entry(item).State = state;
            _context.Add(item);
            _context.SaveChanges();
            return(item);
        }
        public Error Save(Error item)
        {
            var state = item.ErrorId == 0 ? EntityState.Added : EntityState.Modified;

            _context.Entry(item).State = state;
            _context.Add(item);
            _context.SaveChanges();
            return(item);
        }