public int DeleteRole(RoleDto model) { RoleMst tbluser = Mapper.Map <RoleDto, RoleMst>(model); _roleRepository.DeleteRole(tbluser, _dbContext); return(_dbContext.SaveChanges()); }
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()); }
public void DeleteRole(RoleMst role, DbContext dbContext) { dbContext.Entry(role).State = EntityState.Deleted; }
public void UpdateRole(RoleMst deviceExisting, RoleMst role, DbContext dbContext) { dbContext.Entry(deviceExisting).CurrentValues.SetValues(role); }
public void CreateRole(RoleMst role, DbContext dbContext) { dbContext.Set <RoleMst>().Add(role); }