Project restructured

This commit is contained in:
2021-01-10 12:34:59 +01:00
parent 4c069298f2
commit dd530c02a9
7 changed files with 37 additions and 10 deletions

View File

@ -0,0 +1,37 @@
using Dapper;
using RepositoryPattern;
using StockDal.Interface;
using StockDomain;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
namespace StockDal
{
public class ProductRepository : IProductRepository
{
public bool Delete(string productId)
{
throw new NotImplementedException();
}
public IEnumerable<Product> GetProducts()
{
using System.Data.IDbConnection db = new SqlConnection(AppConnection.ConnectionString);
if (db.State == ConnectionState.Closed)
db.Open();
return db.Query<Product>("select ProductId, ProductName, UnitPrice, UnitsInStock ,RIGHT('00000' + cast(ProductId as varchar) , 5) As Barcode from Products", commandType: CommandType.Text);
}
public bool Insert(Product product)
{
throw new NotImplementedException();
}
public bool Update(Product product)
{
throw new NotImplementedException();
}
}
}