コード例 #1
0
 public CollectionOperators(DeleteOperator <T> deleteOperator,
                            ReplaceOperator <T> replaceOperator,
                            InsertOperator <T> insertOperator,
                            QueryOperator <T> queryOperator,
                            UpdateOperator <T> updateOperator)
 {
     Delete  = deleteOperator;
     Replace = replaceOperator;
     Insert  = insertOperator;
     Query   = queryOperator;
     Update  = updateOperator;
 }
コード例 #2
0
        private static CollectionOperators <TDocumentRoot> CreateCollectionOperators <TInterface, TConcrete, TDocumentRoot>(
            IMongoCollection <TDocumentRoot> mongoCollection, IServiceProvider provider)
            where TDocumentRoot : class, IDocumentRoot
            where TConcrete : CallistoCollection <TDocumentRoot>, TInterface
        {
            var deleteOperator =
                new DeleteOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoDeleteOperationFactory>());
            var replaceOperator =
                new ReplaceOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoReplaceOperationFactory>());
            var queryOperator =
                new QueryOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoQueryOperationFactory>());
            var updateOperator =
                new UpdateOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoUpdateOperationFactory>());
            var insertOperator =
                new InsertOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoInsertOperationFactory>());

            var operators = new CollectionOperators <TDocumentRoot>(deleteOperator, replaceOperator,
                                                                    insertOperator, queryOperator,
                                                                    updateOperator);

            return(operators);
        }