public Encrypted <AddictionalData> SyncAddictionalData(Encrypted <AddictionalData> encryptedData) { return(Handle((user) => { WarningHandler.InfoFormat("User AddictionalData sync: [{0}];", user.Name); var data = encryptedData.Decrypt(_secretKey); AddictionalDataManager.Handle(data, user); var preparedData = AddictionalDataManager.Prepare(user); return new Encrypted <AddictionalData>(preparedData, _secretKey); })); }
public AddictionalData SyncAddictionalData(AddictionalData data) { var user = GetCurrentUser(); WarningHandler.Info($"User AddictionalData sync: [{user.Name}];"); AddictionalDataManager.Handle(data, user); var preparedData = AddictionalDataManager.Prepare(user); return(preparedData); }
private void SyncAddictionalData(Action <bool> callback) { try { _serviceClient.BeginSyncAddictionalData(new Encrypted <AddictionalData>(Bus.Prepare(null), _credentials.Value.SecretKey), (o) => { var result = Handle(() => _serviceClient.EndSyncAddictionalData(o)); if (result.Success && result.Value != null && result.Value.Data.Any()) { Bus.Handle(result.Value, null); } callback(result.Success); }, null); } catch { callback(false); } }