Beispiel #1
0
        private static void AddDataDefault(DataContext context)
        {
            var defaultWallet = new Domain.Entities.Wallet("Default");

            context.Wallets.Add(defaultWallet);

            var assetBitcoin = new Domain.Entities.Asset("BTC", "Bitcoin", "Crypto Currency");

            context.Assets.Add(assetBitcoin);
            context.SaveChanges();
        }
Beispiel #2
0
        private static void AddMock(DataContext context)
        {
            var asset1 = new Domain.Entities.Asset("SIRI", "Sirius XM Holdings Inc");
            var asset2 = new Domain.Entities.Asset("ERIC", "Ericsson ADR");
            var asset3 = new Domain.Entities.Asset("VOD", "Vodafone Group Public Limited Company");

            context.Assets.Add(asset1);
            context.Assets.Add(asset2);
            context.Assets.Add(asset3);

            var defaultWallet = new Domain.Entities.Wallet("Default");

            defaultWallet.WalletAssets.Add(new Domain.Entities.WalletAsset(defaultWallet.Id, asset1.Id, 300, 10.40M));
            defaultWallet.WalletAssets.Add(new Domain.Entities.WalletAsset(defaultWallet.Id, asset2.Id, 600, 4.50M));
            context.Wallets.Add(defaultWallet);

            context.AssetsForecast.Add(new Domain.Entities.AssetForecast(asset1.Id, 5.84M));
            context.AssetsForecast.Add(new Domain.Entities.AssetForecast(asset2.Id, 10.87M));
            context.AssetsForecast.Add(new Domain.Entities.AssetForecast(asset3.Id, 14.63M));

            context.SaveChanges();
        }