예제 #1
0
        }                                  //=> Collection<City>();

        protected override void CreateModel(IVfpModelBuilder modelBuilder)
        {
            base.CreateModel(modelBuilder);

            modelBuilder.Entity <City>(b =>
            {
                b.CollectionName = "MyCities";
            });
        }
예제 #2
0
        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;
            });
        }