private static bool RulesExistForType(Type type) { lock (_perTypeRules) { // the first RuleSet is already added to list when this check is executed so so if count > 1 then we have already initialized type rules. #if !SILVERLIGHT return(_perTypeRules.Value.Count(value => value.Key.Type == type) > 1); #else return((_perTypeRules.Count(value => value.Key.Type == type)) > 1); #endif } }
private IDictionary <Type, IEntityType> GenerateEntityTypesDictionary() { return (this .context .EntityTypes .GroupBy(entityType => entityType.Type) .Where(entityTypes => entityTypes.Count() == 1) .ToDictionary( entityTypes => entityTypes.Key, entityTypes => entityTypes.Single())); }