public async Task <IResult> Handle(UpdateTranslateCommand request, CancellationToken cancellationToken)
            {
                var isThereTranslateRecord = await _translateRepository.GetAsync(u => u.Id == request.Id);

                isThereTranslateRecord.Id     = request.Id;
                isThereTranslateRecord.LangId = request.LangId;
                isThereTranslateRecord.Value  = request.Value;
                isThereTranslateRecord.Code   = request.Code;


                _translateRepository.Update(isThereTranslateRecord);
                await _translateRepository.SaveChangesAsync();

                return(new SuccessResult(Messages.Updated));
            }
Beispiel #2
0
            public async Task <IDataResult <Translate> > Handle(GetTranslateQuery request, CancellationToken cancellationToken)
            {
                var translate = await _translateRepository.GetAsync(p => p.Id == request.Id);

                return(new SuccessDataResult <Translate>(translate));
            }