public async void SaveGame(object sender, RoutedEventArgs e) { game.Time = DateTime.Now; StorageFile f = await def.GetFileAsync("sgd.dat"); IRandomAccessStream iras = await f?.OpenAsync(FileAccessMode.ReadWrite); iras.Size = 0; //using (Stream s = Task.Run(() => iras.AsStreamForWrite()).Result) Serializer.Serialize(s, game); using (Stream s = Task.Run(() => iras.AsStreamForWrite()).Result) serializer.Serialize(s, game); SaveCard.Begin(); }
public IActionResult AddToCard([FromBody] SaveCard data) { var card = new Card { UserId = data.UserId, ProductId = data.ProductId, Amount = data.Amount }; SpeedoDb.Cards.Value(p => p.UserId, card.UserId) .Value(p => p.ProductId, card.ProductId) .Value(p => p.Amount, card.Amount) .Insert(); return(Ok()); }
public JudoPayApi(Func <Type, ILog> logger, IClient client) { Payments = new Payments(logger(typeof(Payments)), client, true); Refunds = new Refunds(logger(typeof(Refunds)), client); PreAuths = new PreAuths(logger(typeof(PreAuths)), client, true); Transactions = new Transactions(logger(typeof(Transactions)), client); Collections = new Collections(logger(typeof(Collections)), client); ThreeDs = new ThreeDs(logger(typeof(ThreeDs)), client); RegisterCards = new RegisterCards(logger(typeof(RegisterCards)), client, true); SaveCards = new SaveCard(logger(typeof(SaveCard)), client); Voids = new Voids(logger(typeof(Voids)), client); WebPayments = new WebPayments { Payments = new Clients.WebPayments.Payments(logger(typeof(Clients.WebPayments.Payments)), client), PreAuths = new Clients.WebPayments.PreAuths(logger(typeof(Clients.WebPayments.PreAuths)), client), Transactions = new Clients.WebPayments.Transactions(logger(typeof(Clients.WebPayments.Transactions)), client) }; Consumers = new Consumers(logger(typeof(Consumers)), client); Connection = client.Connection; }