Add project files.
This commit is contained in:
28
RepositoryPattern/Form1.cs
Normal file
28
RepositoryPattern/Form1.cs
Normal file
@ -0,0 +1,28 @@
|
||||
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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user