0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Task使用のメソッドを使いたい

0
Posted at

処理が同じなのに型がTaskでどうやって使ったらいいかわからない…

private async Task<ReportSettingModel> GetReportSettingAsync()
       {
           Control control;

           if (OptionInfo.XXX== true)
           {
               control = AAA
           }
           else
           {
               control = BBB
           }
           if (control == null)
           {
               await ShowMessage("000009", "エラーありま~~す");
               CloseWindow();
           }
           return new ReportSettingModel(control);
       }

  • Controlモデルの中のCCCだけを取り出したい!!!!!!!

呼び出し側で⇓⇓⇓のように記述

ReportSettingModel reportSetting = await GetReportSettingAsync();
SearchCondition.ReportTitle = reportSetting.CCC;

VSでは親切に使い方書いてくれてた、、、

ReportSettingModel XXX = await GetReportSettingAsync();
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?