using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace RepositoryPattern { public partial class Form1 : Form { IProductRepository _productRepository; public Form1(IProductRepository productRepository) { InitializeComponent(); _productRepository = productRepository; } private void Form1_Load(object sender, EventArgs e) { dataGridView.DataSource = _productRepository.GetProducts(); lblTotalRecords.Text = $"Total records: {dataGridView.RowCount}"; } } }