Esempio n. 1
0
 public static IObservable <Consent> FetchConsent(
     IDataCommand <TraderaUser, Seller> users,
     IAuthorizationCalls soap,
     Seller s) =>
 from u in users.Find(s)
 from t in soap.FetchToken(u.Id, u.Consent.Id.ToString())
 let exp = u.RecordConsent(t, s)
           from _ in users.Commit()
           select exp;
Esempio n. 2
0
 public static IObservable <TraderaAlias> AddTraderaUser(
     IDataCommand <Account, Guid> users,
     IAuthorizationCalls soap,
     AppIdentity app,
     Guid account,
     string alias) =>
 from id in soap.Identify(alias)
 from oldstate in users.Find(account)
 let newstate = oldstate.Associate(new TraderaUser
 {
     Id      = id,
     Alias   = alias,
     Consent = Init(Guid.NewGuid())
 })
                from _ in users.Commit()
                select new TraderaAlias(
     new Seller(account, id),
     alias,
     newstate.Consent(id).Id,
     ConsentStatus.NotGiven)
 ;