Exemple #1
0
        public int DeleteRole(RoleDto model)
        {
            RoleMst tbluser = Mapper.Map <RoleDto, RoleMst>(model);

            _roleRepository.DeleteRole(tbluser, _dbContext);
            return(_dbContext.SaveChanges());
        }
Exemple #2
0
        public int UpdateRole(RoleDto model)
        {
            RoleMst tbluser          = Mapper.Map <RoleDto, RoleMst>(model);
            var     existingRoleData = _roleRepository.GetAllRole(_dbContext)
                                       .Where(x => x.RoleId == model.RoleId)
                                       .FirstOrDefault();

            _roleRepository.UpdateRole(existingRoleData, tbluser, _dbContext);

            return(_dbContext.SaveChanges());
        }
Exemple #3
0
 public void DeleteRole(RoleMst role, DbContext dbContext)
 {
     dbContext.Entry(role).State = EntityState.Deleted;
 }
Exemple #4
0
 public void UpdateRole(RoleMst deviceExisting, RoleMst role, DbContext dbContext)
 {
     dbContext.Entry(deviceExisting).CurrentValues.SetValues(role);
 }
Exemple #5
0
 public void CreateRole(RoleMst role, DbContext dbContext)
 {
     dbContext.Set <RoleMst>().Add(role);
 }