Ejemplo n.º 1
0
        public async Task <Result> UpdateHomeWork(UpdateHomeWorkInput input)
        {
            var homeWork = await _homeWokrRepository.GetAsync(input.HomeWorkId);

            if (homeWork != null)
            {
                homeWork.Description = GetUpdatedOrStandartInfoString(homeWork.Description, input.Description);
                if (!homeWork.HomeWorkData.IsNullOrEmpty())
                {
                    homeWork.HomeWorkData = input.HomeWorkData;
                }
                await _homeWokrRepository.UpdateAsync(homeWork);

                return(Result.Success());
            }
            return(ErrorByIdFormat(input.HomeWorkId, "Домашнего задания с Id - {0} не существует"));
        }
 public EditInfoHomeWorkViewModel()
 {
     Input = new UpdateHomeWorkInput();
 }