예제 #1
0
        public static void CreateIndices(this IApplicationBuilder app)
        {
            using (var scope = app.ApplicationServices.CreateScope())
            {
                using (IMongoUnitOfWork unitOfWork = scope.ServiceProvider.GetService <IMongoUnitOfWork>())
                {
                    var uniqueIndexOptions = new CreateIndexOptions()
                    {
                        Unique = true
                    };

                    IndexKeysDefinition <DefterLog> idDefinition =
                        new IndexKeysDefinitionBuilder <DefterLog>().Descending(p => p.RequestId);

                    var idIndexModel = new CreateIndexModel <DefterLog>(idDefinition, uniqueIndexOptions);

                    IndexKeysDefinition <DefterLog> name = new IndexKeysDefinitionBuilder <DefterLog>()
                                                           .Descending(p => p.Name);

                    var nameIndexModel = new CreateIndexModel <DefterLog>(name);

                    IndexKeysDefinition <DefterLog> operationName = new IndexKeysDefinitionBuilder <DefterLog>()
                                                                    .Descending(p => p.OperationName);

                    var operationNameIndexModel = new CreateIndexModel <DefterLog>(operationName);

                    unitOfWork.RepositoryManager <DefterLog>().CreateIndices(new[] {
                        idIndexModel,
                        nameIndexModel,
                        operationNameIndexModel
                    });
                }
            }
        }
 public BrushingInformationService(
     IMongoUnitOfWork mongoUnitOfWork,
     ILineMessageService lineMessageService
     )
 {
     _mongoUnitOfWork    = mongoUnitOfWork;
     _lineMessageService = lineMessageService;
 }
예제 #3
0
 public PatientService(
     IUnitOfWork unitOfWork,
     IMongoUnitOfWork mongoUnitOfWork,
     IUsersService usersService)
 {
     _unitOfWork      = unitOfWork;
     _mongoUnitOfWork = mongoUnitOfWork;
     _usersService    = usersService;
 }
예제 #4
0
 public DoctorService(
     IUnitOfWork unitOfWork,
     IMongoUnitOfWork mongoUnitOfWork,
     IUsersService usersService
     )
 {
     _unitOfWork      = unitOfWork;
     _mongoUnitOfWork = mongoUnitOfWork;
     _usersService    = usersService;
 }
예제 #5
0
        public MongoRepository(IMongoUnitOfWork unitofWork, string collectname)
        {
            if (unitofWork == null)
            {
                throw new NullReferenceException("UnitOfWork");
            }

            _database       = unitofWork.Context;
            _collectionName = collectname;
        }
예제 #6
0
 public OilPriceService(
     ICacheService cacheService,
     IWebScraper webScraper,
     ILineMessageService lineMessageService,
     IMongoUnitOfWork mongoUnitOfWork)
 {
     _cacheService       = cacheService;
     _webScraper         = webScraper;
     _lineMessageService = lineMessageService;
     _mongoUnitOfWork    = mongoUnitOfWork;
 }
예제 #7
0
 public FundsService
 (
     IWebScraper webScraper,
     ILineMessageService lineMessageService,
     IMongoUnitOfWork mongoUnitOfWork
 )
 {
     _webScraper         = webScraper;
     _lineMessageService = lineMessageService;
     _mongoUnitOfWork    = mongoUnitOfWork;
 }
예제 #8
0
        public MongoRepository(IMongoUnitOfWork unitOfWork)
        {
            if (!BsonClassMap.IsClassMapRegistered(typeof(T)))
            {
                BsonClassMap.RegisterClassMap <T>(map =>
                {
                    map.AutoMap();
                    map.SetIdMember(map.GetMemberMap(m => m.Key));
                });
            }

            _collection = unitOfWork.Database.GetCollection <T>(typeof(T).Name);
        }
 public ProductService(
     IPublishEndpoint publishEndpoint,
     IRequestClient <TestMessageRequest> client,
     ISQLUnitOfWork unitOfWork, IMapper mapper,
     IMongoUnitOfWork mongoUnitOfWork,
     IProductElasticSearchRepository productElasticSearchRepository)
 {
     _publishEndpoint = publishEndpoint;
     _client          = client;
     _sqlUnitOfWork   = unitOfWork;
     _mapper          = mapper;
     _mongoUnitOfWork = mongoUnitOfWork;
     _productElasticSearchRepository = productElasticSearchRepository;
 }
예제 #10
0
 public AppointmentService(
     IUnitOfWork unitOfWork,
     IMongoUnitOfWork mongoUnitOfWork,
     IDoctorService doctorService,
     IPatientService patientService,
     IUsersService usersService
     )
 {
     _unitOfWork      = unitOfWork;
     _mongounitOfWork = mongoUnitOfWork;
     _doctorService   = doctorService;
     _patientService  = patientService;
     _usersService    = usersService;
 }
 public MongoDbExampleController(IMongoUnitOfWork unitOfWork)
 {
     UnitOfWork = unitOfWork;
 }
예제 #12
0
 public AlbumMongoController(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
예제 #13
0
 public DefaultViewComponent(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
예제 #14
0
 public CustomCacheValueProvider(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
예제 #15
0
 public UsersService(
     IMongoUnitOfWork mongoUnitOfWork
     )
 {
     _mongoUnitOfWork = mongoUnitOfWork;
 }
예제 #16
0
 public SleepInformationService(IMongoUnitOfWork mongoUnitOfWork)
 {
     _mongoUnitOfWork = mongoUnitOfWork;
 }
 public ProductLogRepository(IMongoUnitOfWork unitofwork) : base(unitofwork, "ProductLog")
 {
 }
예제 #18
0
 public LogManager(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
예제 #19
0
 public RabbitMqCommunicator(RabbitMqSettings rabbitMqSettings, IModel rabbitMqChannel, IMongoUnitOfWork mongoUnitOfWork)
 {
     _rabbitMqSettings = rabbitMqSettings;
     _rabbitMqChannel  = rabbitMqChannel;
     _players          = mongoUnitOfWork.GetRepository <PlayerInfo>();
 }
 /// <summary>
 /// Create a new instance
 /// </summary>
 /// <param name="unitOfWork">Associated unit of work</param>
 /// <param name="logger">Associated logger</param>
 public DepartmentAggregateRepository(IMongoUnitOfWork unitOfWork, ILogger logger)
     : base(unitOfWork, logger)
 {
 }
예제 #21
0
 public ContentCacheValueProvider(IMongoUnitOfWork unitOfWork, IModelComposer <ContentObjectViewModel> composer)
 {
     _unitOfWork = unitOfWork;
     _composer   = composer;
 }
예제 #22
0
 public MongoRepo(IMongoUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }
예제 #23
0
 public MgExampleRepo(IMongoUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }