コード例 #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());
        }