public IEnumerable <ProjetcUser> FindBy(ProjetcUser filter) { if (filter == null) { filter = new ProjetcUser { UserId = 0 }; filter = new ProjetcUser { ProjectId = 0 }; } try { var result = rep.FindBy(f => f.UserId == (filter.UserId == 0 ? f.UserId : filter.UserId) ).ToList(); return(result); } catch (Exception ex) { return(null); } }