public GetLicenses DeleteLicensedUser(GetLicenses obj) { var returnModel = new GetLicenses(); var getLicensedUserList = _userAuthenticationsRepo.GetAll().ToList(); var userList = _usersRepo.GetAll().ToList(); var getUserId = (from p in getLicensedUserList join s in userList on p?.UserId equals s?.Id where p.Id == obj.LicensedId && s.Id == p.UserId select s).SingleOrDefault(); var Users = _usersRepo.Get(getUserId.Id); var UserAuthentications = _userAuthenticationsRepo.Get(obj.LicensedId); if (UserAuthentications != null) { _userAuthenticationsRepo.Delete(UserAuthentications); // returnModel.Message = "Delete Successful."; } if (Users != null) { _usersRepo.Delete(Users); // returnModel.Message = "Delete Successful."; } return(returnModel); }
// POST: Roles/Delete/5 public async Task Delete(User user) { _userRepo.Delete(user); await _userRepo.Save(); //_context.Roles.Remove(role); //await _context.SaveChangesAsync(); }
public IHttpActionResult Delete(int id) { if (repo.Get(id) != null) { repo.Delete(id); return(StatusCode(HttpStatusCode.NoContent)); } else { return(StatusCode(HttpStatusCode.NotFound)); } }
public IActionResult Delete([FromRoute] int id) { _users.Delete(id); return(Ok()); }