Exemplo n.º 1
0
        protected override async Task OnModelPropertyChangedAsync(QuestionType model, string propertyName)
        {
            if (model == null)
            {
                return;
            }

            switch (propertyName)
            {
            case nameof(QuestionType.Category):
                await _questionTypeService.UpdatePropertyAsync(model.Id, x => x.Category, model.Category);

                break;

            case nameof(QuestionType.Explanation):
                await _questionTypeService.UpdatePropertyAsync(model.Id, x => x.Explanation, model.Explanation);

                break;

            case nameof(QuestionType.Name):
                await _questionTypeService.UpdatePropertyAsync(model.Id, x => x.Name, model.Name);

                break;
            }

            _eventAggregator.GetEvent <QuestionTypeChangedEvent>().Publish(model);
        }