コード例 #1
0
 public TipForm Save(TipForm tip)
 {
     if (tip.IsPartner())
     {
         return(Task.Factory.StartNew(() => _adminCommandApplicationService.UpsertPartnerAsync(tip.ToBranch()))
                .Unwrap()
                .GetAwaiter()
                .GetResult().ToTipForm());
     }
     return(Task.Factory.StartNew(() => _adminCommandApplicationService.UpsertBranchAsync(tip.ToBranch()))
            .Unwrap()
            .GetAwaiter()
            .GetResult().ToTipForm());
 }
コード例 #2
0
 public void Delete(TipForm tip)
 {
     if (tip.IsPartner())
     {
         Task.Factory.StartNew(() => _adminCommandApplicationService.DeletePartnerAsync(tip.Id))
         .Unwrap()
         .GetAwaiter()
         .GetResult();
     }
     else
     {
         Task.Factory.StartNew(() => _adminCommandApplicationService.DeleteBranchAsync(tip.Id))
         .Unwrap()
         .GetAwaiter()
         .GetResult();
     }
 }