public List <Relationship> FindPageRelationships(int pageID) { List <RelEntity> entities = Rels.Where(p => p.pageId == pageID).ToList(); foreach (var relEntity in entities) { if (string.IsNullOrEmpty(relEntity.username)) { var user = GetUserById(relEntity.UserId); if (user != null) { relEntity.username = user.Username; } } } return(FromEntity.ToRelList(entities)); }
public IEnumerable <Relationship> FindRelsCreatedBy(string username) { List <RelEntity> entities = Rels.Where(p => p.username == username).ToList(); return(FromEntity.ToRelList(entities)); }
public IEnumerable <Relationship> GetRelByUserId(Guid userid) { List <RelEntity> entities = Rels.Where(p => p.UserId == userid).ToList(); return(FromEntity.ToRelList(entities)); }
//public IEnumerable<Relationship> GetRelByPageAndUsername(int pageid, string username) //{ // List<RelEntity> entities = Rels.Where(p => p.pageId == pageid && p.username == username).ToList(); // return FromEntity.ToRelList(entities); //} //public IEnumerable<Relationship> GetRelByUsername(string username) //{ // List<RelEntity> entities = Rels.Where(p => p.username == username).ToList(); // return FromEntity.ToRelList(entities); //} public IEnumerable <Relationship> GetRelByPageAndUserId(int pageid, Guid userid) { List <RelEntity> entities = Rels.Where(p => p.pageId == pageid && p.UserId == userid).ToList(); return(FromEntity.ToRelList(entities)); }
public List <Relationship> FindPageRelationships(int pageID) { List <RelEntity> entities = Rels.Where(p => p.pageId == pageID).ToList(); return(FromEntity.ToRelList(entities)); }