public virtual MongoDbContextModel GetModel(PlusMongoDbContext dbContext) { return(ModelCache.GetOrAdd( dbContext.GetType(), _ => CreateModel(dbContext) )); }
protected virtual MongoDbContextModel CreateModel(PlusMongoDbContext dbContext) { var modelBuilder = CreateModelBuilder(); BuildModelFromDbContextType(modelBuilder, dbContext.GetType()); BuildModelFromDbContextInstance(modelBuilder, dbContext); return(modelBuilder.Build()); }