예제 #1
0
        public UserRoleCompany Update(UserRoleCompany userRoleCompanyChange)
        {
            var userRoleCompany = _context.UserRoleCompany.Attach(userRoleCompanyChange);

            userRoleCompany.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            _context.SaveChanges();
            return(userRoleCompanyChange);
        }
예제 #2
0
        public UserRoleCompany Delete(int id)
        {
            UserRoleCompany userRoleCompany = _context.UserRoleCompany.Find(id);

            if (userRoleCompany != null)
            {
                _context.UserRoleCompany.Remove(userRoleCompany);
                _context.SaveChanges();
            }
            return(userRoleCompany);
        }
예제 #3
0
 public UserRoleCompany Insert(UserRoleCompany userRoleCompany)
 {
     _context.UserRoleCompany.Add(userRoleCompany);
     _context.SaveChanges();
     return(userRoleCompany);
 }