using Dapper; using MySqlConnector; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace wpf_connection3 { public class DBDataProvider : IDataProvider { static string connectionString = "Server=kolei.ru; User ID=aleuhin; Password=101005; Database=aleuhin"; public IEnumerable getProduct() { using (MySqlConnection db = new MySqlConnection(connectionString)) { return db.Query( "SELECT p.ID, p.Title, p.ProductTypeID, p.ArticleNumber, p.Image, pt.Title AS ProductTypeTitle " + "FROM Product p, ProductType pt " + "WHERE p.ProductTypeID=pt.ID") .ToList(); } } } }