public async Task <RuntimeResult> SetTitleAsync(string title, string newTitle)
            {
                var getDossierResult = await _dossiers.GetDossierByTitleAsync(title);

                if (!getDossierResult.IsSuccess)
                {
                    return(getDossierResult.ToRuntimeResult());
                }

                var dossier = getDossierResult.Entity;

                var modifyResult = await _dossiers.SetDossierTitleAsync(dossier, newTitle);

                if (!modifyResult.IsSuccess)
                {
                    return(modifyResult.ToRuntimeResult());
                }

                return(RuntimeCommandResult.FromSuccess("New dossier title set."));
            }
Esempio n. 2
0
            public async Task SetTitleAsync(string title, string newTitle)
            {
                var getDossierResult = await _dossiers.GetDossierByTitleAsync(title);

                if (!getDossierResult.IsSuccess)
                {
                    await _feedback.SendErrorAsync(this.Context, getDossierResult.ErrorReason);

                    return;
                }

                var dossier = getDossierResult.Entity;

                var modifyResult = await _dossiers.SetDossierTitleAsync(dossier, newTitle);

                if (!modifyResult.IsSuccess)
                {
                    await _feedback.SendErrorAsync(this.Context, modifyResult.ErrorReason);

                    return;
                }

                await _feedback.SendConfirmationAsync(this.Context, "New dossier title set.");
            }