Загрузка данных


using Dapper;
using Microsoft.Data.Sqlite;
Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true;
var connection = new SqliteConnection("DataSource=dbdb");
var brands = connection.Query<Brand>("SELECT * FROM brands");

foreach (Brand brand in brands)
{
    Console.WriteLine($"{brand.Id} {brand.Title} {brand.CompanyAddress}");
}

var clothes = connection.Query<Clothes>("SELECT * FROM clothes");

foreach (Clothes cloth in clothes)
{
    Console.WriteLine($"{cloth.Id}, {cloth.Title}, {cloth.price}, {cloth.BrandId}");
}

connection.Execute("INSERT INTO brands (title, company_address, company_name ) VALUES(@Title, @CompanyName, @CompanyAddress)", new {Title = "New brand", CompanyName = "New company", CompanyAddress = "Moscow"});

foreach (Brand brand in brands)
{
    Console.WriteLine($"{brand.Id} {brand.Title} {brand.CompanyAddress}");
}