public static void AddCoins(UInt32 accountId, Int32 amount) { using (var db = new OTNetContext()){ var account = _queryAccount(db, accountId); account.Coins += Convert.ToUInt32(amount); db.SaveChanges(); } }
public static void RegisterTransaction(UInt32 accountId, Int32 coins, string description) { using (var db = new OTNetContext()){ var newStoreHistory = new StoreHistory { AccountId = accountId, CoinAmount = coins, Description = description, Time = DateTime.Now }; db.StoreHistory.Add(newStoreHistory); db.SaveChanges(); } }