public void Delete(Guid Id) { var id = _context.UserRoles.First(x => x.UserId == Id).RoleId; var role = _context.Roles.First(x => x.Id == id); if (role.Name == "Client") { _context.Remove(GetById(Id)); _context.SaveChanges(); } }
public void Delete(Guid Id) { if (_info.Role == "Client") { var userid = _requestcontext.Requests.First(x => x.Id == Id).UserId; if (userid.ToString() == _info.Id) { _requestcontext.Remove(GetRequestById(Id)); _requestcontext.SaveChanges(); } } else { _requestcontext.Remove(GetRequestById(Id)); _requestcontext.SaveChanges(); } }
public void Delete(Guid Id) { _profilecontext.Remove(GetProfileById(Id)); _profilecontext.SaveChanges(); }