public void CreateDictTest()
        {
            var beforeStart = dotMemory.Check();
            var dict        = HelperTest.CreateDict();

            GC.Collect();
            dotMemory.Check(memory =>
            {
                var snapshotDifference = memory.GetDifference(beforeStart);
                Console.WriteLine(snapshotDifference.GetNewObjects().SizeInBytes.Bytes());
            });
        }
Beispiel #2
0
        public static async Task LoadCoreAsync(Dictionary <int, ProductInfo> dict)
        {
            var connectionString = HelperTest.GetConnectionString();

            await using var sqlConnection = new SQLiteConnection(connectionString);
            await sqlConnection.OpenAsync();

            await using var reader = await sqlConnection.ExecuteReaderAsync(
                            "SELECT ProductId, Color FROM Product");

            var rowParser = reader.GetRowParser <ProductInfo>();

            while (await reader.ReadAsync())
            {
                var productInfo = rowParser.Invoke(reader);
                dict[productInfo.ProductId] = productInfo;
            }
        }