Beispiel #1
0
            public async Task <Unit> Handle(Command request, CancellationToken cancellationToken)
            {
                var assignmentToDelete = await _assignmentAccess.AssignmentDetails(request.Id);

                _domainVerifier.Verify <Assignment>(assignmentToDelete);

                await _assignmentAccess.DeleteAssignment(request.Id);

                return(Unit.Value);
            }
Beispiel #2
0
            public async Task <Unit> Handle(Command request, CancellationToken cancellationToken)
            {
                var currentAssignment = await _assignmentAccess.AssignmentDetails(request.Id);

                _domainVerifier.Verify <Assignment>(currentAssignment);

                await _assignmentAccess.EditAssignment(request, currentAssignment);

                return(Unit.Value);
            }
Beispiel #3
0
            public async Task <Unit> Handle(Command request, CancellationToken cancellationToken)
            {
                var assignmentToAddSubmissionTo = await _assignmentAccess.AssignmentDetails(request.AssignmentId);

                _domainVerifier.Verify <Assignment>(assignmentToAddSubmissionTo);

                var submission = new Submission
                {
                    AssignmentId = request.AssignmentId,
                    StudentName  = request.StudentName
                };

                var result = await _submissionsAccess.AddSubmission(submission);

                return(Unit.Value);
            }
Beispiel #4
0
            public async Task <Assignment> Handle(Query request, CancellationToken cancellationToken)
            {
                var assignment = await _assignmentAccess.AssignmentDetails(request.Id);

                return(assignment);
            }