} //=> Collection<City>(); protected override void CreateModel(IVfpModelBuilder modelBuilder) { base.CreateModel(modelBuilder); modelBuilder.Entity <City>(b => { b.CollectionName = "MyCities"; }); }
protected virtual void BuildModelFromDbContextCollectionProperty(IVfpModelBuilder modelBuilder, PropertyInfo collectionProperty) { var entityType = collectionProperty.PropertyType.GenericTypeArguments[0]; var collectionAttribute = collectionProperty.GetCustomAttributes().OfType <VfpCollectionAttribute>().FirstOrDefault(); modelBuilder.Entity(entityType, b => { b.CollectionName = collectionAttribute?.CollectionName ?? collectionProperty.Name; }); }