Project restructured
This commit is contained in:
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RepositoryPattern
|
||||
{
|
||||
public class AppConnection
|
||||
{
|
||||
public static string ConnectionString => ConfigurationManager.ConnectionStrings["cn"].ConnectionString;
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Dapper;
|
||||
using StockDal.Interface;
|
||||
using StockDomain;
|
||||
|
||||
namespace RepositoryPattern
|
||||
{
|
||||
public class ProductRepository : IProductRepository
|
||||
{
|
||||
public bool Delete(string productId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Product> GetProducts()
|
||||
{
|
||||
using 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using Autofac;
|
||||
using StockDal;
|
||||
using StockDal.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
@ -14,6 +14,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StockDal.Interface\StockDal.Interface.csproj" />
|
||||
<ProjectReference Include="..\StockDal\StockDal.csproj" />
|
||||
<ProjectReference Include="..\StockDomain\StockDomain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user