protected internal CreateIndexModelParameter(Type type, CreateIndexOptions options, BsonDocument rendered, MongoModelBuilder builder)
 {
     Type     = type;
     Options  = options;
     Rendered = rendered;
     Builder  = builder;
     SetIndexesOnBuilder(Builder);
 }
 private void SetIndexesOnBuilder(MongoModelBuilder builder)
 {
     if (builder.ModelDefinitions.ContainsKey(Type) &&
         builder.ModelDefinitions[Type] is CreateIndexModelParameter parameter &&
         parameter.Type == Type)
     {
         builder.ModelDefinitions[Type] = this;
     }
 }
Exemplo n.º 3
0
 protected MongoDataContext(string connectionString, string dbName, FindOptions findOptions)
 {
     ConnectionString = connectionString;
     DbName           = dbName;
     FindOptions      = findOptions;
     _sessionOptions  = new ClientSessionOptions
     {
         DefaultTransactionOptions = new TransactionOptions(
             ReadConcern.Snapshot,
             ReadPreference.Primary,
             WriteConcern.WMajority)
     };
     ModelBuilder = new MongoModelBuilder();
     BuildModel(ModelBuilder);
 }
Exemplo n.º 4
0
 protected StartModelParameter(Type type, MongoModelBuilder modelBuilder)
 {
     Type                 = type;
     ModelBuilder         = modelBuilder;
     IndexModelParameters = new List <CreateIndexModelParameter>();
 }