コード例 #1
0
ファイル: MigrationTests.cs プロジェクト: mow/ravendb
        private void FillProductSales()
        {
            productSalesResults = new Dictionary <string, ProductSales.Result>();

            using (var file = File.OpenRead("../../Migration/Data/productSales.csv"))
                using (var reader = new StreamReader(file))
                {
                    var line = reader.ReadLine();
                    while (line != null)
                    {
                        var parts = line.Split(',');
                        productSalesResults[parts[0]] = new ProductSales.Result
                        {
                            Product = parts[0],
                            Count   = (int)(double.Parse(parts[1], CultureInfo.InvariantCulture)),
                            Total   = double.Parse(parts[2], CultureInfo.InvariantCulture)
                        };

                        line = reader.ReadLine();
                    }
                }
        }
コード例 #2
0
ファイル: MigrationTests.cs プロジェクト: jrusbatch/ravendb
		private void FillProductSales()
		{
			productSalesResults = new Dictionary<string, ProductSales.Result>();

			using (var file = File.OpenRead("../../Migration/Data/productSales.csv"))
			using (var reader = new StreamReader(file))
			{
				var line = reader.ReadLine();
				while (line != null)
				{
					var parts = line.Split(',');
					productSalesResults[parts[0]] = new ProductSales.Result
					{
						Product = parts[0],
						Count = (int)(double.Parse(parts[1], CultureInfo.InvariantCulture)),
						Total = double.Parse(parts[2], CultureInfo.InvariantCulture)
					};

					line = reader.ReadLine();
				}
			}
		}