public static ReflectionEntityCache GetOrCreateEntity(Type type) { if (_entityCache.TryGetValue(type, out ReflectionEntityCache value)) { return(value); } value = new ReflectionEntityCache(type); _entityCache.Add(type, value); return(value); }
public ReflectionPropertyCache GetProperty(string name) => Properties.FirstOrDefault(property => { string propertyName = property.Name; if (property.IsForeignObj) { ReflectionEntityCache fk = GetOrCreateEntity(property.Type); propertyName = $"{propertyName}{fk.PrimaryKey.Name}"; } return(name == propertyName); });