Example #1
0
 public SchemaBuilder(IDbContext dbContext, IPluralize pluralize)
 {
     ProcedureBuilder = new ProcedureBuilder(dbContext, pluralize);
     TableBuilder     = new TableBuilder(dbContext, pluralize);
     FullTextBuilder  = new FullTextBuilder(dbContext, pluralize);
     IndexBuilder     = new IndexBuilder(dbContext, pluralize);
 }
Example #2
0
 public SchemaBuilderBase(
     IDbContext dbContext,
     IPluralize pluralize)
 {
     _pluralize   = pluralize;
     _tablePrefix = dbContext.Configuration.TablePrefix;
     Statements   = new List <string>();
 }
Example #3
0
 public TableBuilder(
     IDbContext dbContext,
     IPluralize pluralize) : base(dbContext, pluralize)
 {
 }
 public MomentsAgoService(IPluralize pluralize, IMomentClock?clock = null)
 {
     Pluralize = pluralize;
     Clock     = clock ??= SystemClock.Instance;
 }
 public MomentsAgoService(IPluralize pluralize) => _pluralize = pluralize;
Example #6
0
 public FullTextBuilder(
     IDbContext dbContext,
     IPluralize pluralize) : base(dbContext, pluralize)
 {
 }
Example #7
0
 public IndexBuilder(
     IDbContext dbContext,
     IPluralize pluralize) : base(dbContext, pluralize)
 {
 }
Example #8
0
 public ProcedureBuilder(
     IDbContext dbContext,
     IPluralize pluralize) : base(dbContext, pluralize)
 {
 }
Example #9
0
 public XmlDataProvider(IOptionsAccessor <XmlDataConfig> xmlDataConfig, IPluralize pluralizer, IXmlDataProviderLogger logger)
 {
     _xmlDataConfig = xmlDataConfig;
     _pluralizer    = pluralizer;
     _logger        = logger;
 }
Example #10
0
 public RecipeIndexModel(RecipeFinder.Data.ApplicationDbContext context, UserManager <IdentityUser> userManager)
 {
     _context     = context;
     _userManager = userManager;
     _pluralizer  = new Pluralizer();
 }
Example #11
0
        protected MongoRepository(IClientSessionHandle session, IMongoDatabase database, IMongoModelBuilder <TEntity> builder, IPluralize pluralize)
        {
            if (database == null)
            {
                throw new ArgumentNullException(nameof(database));
            }

            if (pluralize == null)
            {
                throw new ArgumentNullException(nameof(pluralize));
            }

            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            _session = session ?? throw new ArgumentNullException(nameof(session));

            builder.CreateModel();

            var collectionName = pluralize.Pluralize(typeof(TEntity).Name);

            lock (database)
            {
                if (!database.ListCollectionNames(new ListCollectionNamesOptions
                {
                    Filter = new BsonDocument("name", collectionName)
                })
                    .Any())
                {
                    database.CreateCollection(collectionName);
                }
            }

            _collection = database.GetCollection <TEntity>(collectionName);

            builder.CreateIndex(_collection.Indexes);

            _queryable = new MongoDbQueryableWrapper <TEntity>(_collection);
        }
 public TimeService(IPluralize pluralize) => _pluralize = pluralize;