Пример #1
0
 public virtual MongoDbContextModel GetModel(PlusMongoDbContext dbContext)
 {
     return(ModelCache.GetOrAdd(
                dbContext.GetType(),
                _ => CreateModel(dbContext)
                ));
 }
Пример #2
0
        protected virtual MongoDbContextModel CreateModel(PlusMongoDbContext dbContext)
        {
            var modelBuilder = CreateModelBuilder();

            BuildModelFromDbContextType(modelBuilder, dbContext.GetType());
            BuildModelFromDbContextInstance(modelBuilder, dbContext);
            return(modelBuilder.Build());
        }
Пример #3
0
 protected virtual void BuildModelFromDbContextInstance(IMongoModelBuilder modelBuilder, PlusMongoDbContext dbContext)
 {
     dbContext.CreateModel(modelBuilder);
 }