public List <EntityIndex> GetRelatedIndexes(string entityType, int entityId) { var refType = EntityTypes.FirstOrDefault(x => x.Name == entityType); if (refType == null) { return(new List <EntityIndex>()); } List <EntityIndex> result = EntityIndexes.Where(ei => ei.Keywords.Count(kw => kw.ReferenceEntityTypeID == refType.ID && kw.ReferenceEntityKey == entityId) > 0).Distinct().ToList(); return(result); }
public EntityIndex GetEntityIndex(string entityType, int entityID) { return(EntityIndexes.SingleOrDefault(ei => ei.EntityType.Name == entityType && ei.EntityKey == entityID)); }