예제 #1
0
        public async Task Consume(ConsumeContext <IStudentDeleted> context)
        {
            await _studentOpticalFormRepository
            .DeleteByStudentIdAsync(context.Message.StudentId);

            var examIds = await _studentOpticalFormRepository.GetExamIdsAsync(
                f => f.StudentId, context.Message.StudentId);

            foreach (var examId in examIds)
            {
                await _evaluateExamConsumer?.ConsumeAsync(examId);
            }
        }
        public async Task Consume(ConsumeContext <IClassroomDeleted> context)
        {
            await _studentOpticalFormRepository
            .DeleteByClassroomIdAsync(context.Message.ClassroomId);

            var examIds = await _studentOpticalFormRepository.GetExamIdsAsync(
                f => f.ClassroomId, context.Message.ClassroomId);

            if (_evaluateExamConsumer != null)
            {
                foreach (var examId in examIds)
                {
                    await _evaluateExamConsumer.ConsumeAsync(examId);
                }
            }
        }