Exemple #1
0
 public virtual MongoDbContextModel GetModel(RocketMongoDbContext dbContext)
 {
     return(ModelCache.GetOrAdd(
                dbContext.GetType(),
                _ => CreateModel(dbContext)
                ));
 }
Exemple #2
0
        protected virtual MongoDbContextModel CreateModel(RocketMongoDbContext dbContext)
        {
            var modelBuilder = CreateModelBuilder();

            BuildModelFromDbContextType(modelBuilder, dbContext.GetType());
            BuildModelFromDbContextInstance(modelBuilder, dbContext);
            return(modelBuilder.Build());
        }
Exemple #3
0
 protected virtual void BuildModelFromDbContextInstance(IMongoModelBuilder modelBuilder, RocketMongoDbContext dbContext)
 {
     dbContext.CreateModel(modelBuilder);
 }