//readonly SendNotificationCommandHGandler sendNotificationCommand;

        public DocumentController(
            CreateDocumentCommandHandler createCommandHandler,
            SearchDocumentsQuery searchDocumentsQuery,
            SearchCountQuery searchCountQuery,
            DownloadFileQuery downloadFileQuery,
            GetOneDocumentQuery getOneQuery,
            GetAllDocumentTypesQuery getDTsQuery,
            GetAllEntitiesQuery getEsQuery,
            GetAllDocumentTypesByUserQuery getDTByUserQuery,
            DocumentsWithoutFilePagedQuery withoutFileQuery,
            UpdateFileToDocumentCommandHandler updateFileCommandHandler,
            DeleteDocumentCommandHandler deleteDocumentCommand,
            SendDocumentNotificationCommandHandler sendDocmentNotificationCommandHandler
            //SendNotificationCommandHGandler sendNotificationCommand) {
            )
        {
            _createCommandHandler         = createCommandHandler;
            this.searchDocumentsQuery     = searchDocumentsQuery;
            this.searchCountQuery         = searchCountQuery;
            this.downloadFileQuery        = downloadFileQuery;
            this.getOneQuery              = getOneQuery;
            this.getDTsQuery              = getDTsQuery;
            this.getEsQuery               = getEsQuery;
            this.withoutFileQuery         = withoutFileQuery;
            this.updateFileCommandHandler = updateFileCommandHandler;
            this.deleteDocumentCommand    = deleteDocumentCommand;
            this.sendDocumentNotificationCommandHandler = sendDocmentNotificationCommandHandler;
            this.getDTByUserQuery = getDTByUserQuery;
            //this.sendNotificationCommand = sendNotificationCommand;
        }
Example #2
0
        public void GetAllQuestionnaires()
        {
            var questionnaireCreator = new User()
            {
                Name = "User 1"
            };

            context.Users.Add(questionnaireCreator);
            context.SaveChanges();

            var questionnaire1 = new Questionnaire
            {
                Name          = "Test 1",
                CreatedByUser = questionnaireCreator,
                CreatedDate   = DateTime.Now.AddDays(-2)
            };

            var questionnaire2 = new Questionnaire
            {
                Name          = "Test 2",
                CreatedByUser = questionnaireCreator,
                CreatedDate   = DateTime.Now.AddDays(-5)
            };

            context.Questionnaires.Add(questionnaire1);
            context.Questionnaires.Add(questionnaire2);
            context.SaveChanges();

            var getAllEntitiesQuery = new GetAllEntitiesQuery(context);
            var questionnaires      = getAllEntitiesQuery.Execute <Questionnaire>();

            Assert.Equal(2, questionnaires.Count());
        }
Example #3
0
 public EntityController(CreateEntityCommandHandler createCommand,
                         GetAllEntitiesQuery getAllQuery,
                         GetEntityQuery getOneQuery,
                         UpdateEntityCommandHandler updateCommand,
                         DeleteEntityCommandHandler deleteCommand)
 {
     this.createCommand = createCommand;
     this.getAllQuery   = getAllQuery;
     this.getOneQuery   = getOneQuery;
     this.updateCommand = updateCommand;
     this.deleteCommand = deleteCommand;
 }
Example #4
0
 public async Task <ActionResult <IEnumerable <Customer> > > AllCustomers()
 {
     try
     {
         var query = new GetAllEntitiesQuery <Customer>();
         return((await mediator.Send(query)).ToList());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
 public AnnotationController(
     CreateAnnotationCommandHandler createCommand,
     DeleteAnnotationCommandHandler deleteCommand,
     GetDocumentAnnotationsQuery documentAnnotationsQuery,
     GetAllDocumentTypesQuery getDTsQuery,
     GetAllEntitiesQuery getEsQuery,
     GetAllAnnotationTypesQuery getAATsQuery,
     SearchDocumentsToAnnotateCountQuery searchCountQuery,
     SearchDocumentsToAnnotateQuery searchQuery
     )
 {
     this.createCommand            = createCommand;
     this.deleteCommand            = deleteCommand;
     this.documentAnnotationsQuery = documentAnnotationsQuery;
     this.getDTsQuery      = getDTsQuery;
     this.getEsQuery       = getEsQuery;
     this.getAATsQuery     = getAATsQuery;
     this.searchCountQuery = searchCountQuery;
     this.searchQuery      = searchQuery;
 }
Example #6
0
 public SearchController(
     GetAllDocumentTypesQuery getAllDTQuery,
     GetAllEntitiesQuery getAllETQuery,
     SearchCountQuery searchCountQuery,
     SearchDocumentsQuery searchDocumentsQuery,
     DownloadFileQuery downloadFileQuery,
     GetAllAnnotationTypesQuery getAllATQuery,
     GetDocumentAnnotationsQuery getDocAnnotationsQuery,
     GetOneDocumentQuery getOneDocumentQuery
     )
 {
     this.getAllDTQuery          = getAllDTQuery;
     this.getAllEQuery           = getAllETQuery;
     this.searchCountQuery       = searchCountQuery;
     this.searchDocumentsQuery   = searchDocumentsQuery;
     this.downloadFileQuery      = downloadFileQuery;
     this.getAllATQuery          = getAllATQuery;
     this.getDocAnnotationsQuery = getDocAnnotationsQuery;
     this.getOneDocumentQuery    = getOneDocumentQuery;
 }
 public Task <IEnumerable <T> > Handle(GetAllEntitiesQuery <T> request, CancellationToken cancellationToken)
 {
     return(repository.GetAll());
 }