private bool CheckOwnership(int id, ClaimsPrincipal principal) { var oldConsultant = _repository.GetAll().FirstOrDefault(c => c.ID == id); if (oldConsultant == null) { return(true); } // check if client is allowed to update consultant // only the record creator can update return(oldConsultant.Owner.Equals(principal.Identity.Name)); }
public IQueryable <Consultant> Get() { return(_repository.GetAll().AsQueryable()); }