Skip to content

Instantly share code, notes, and snippets.

@adaam2
Created December 6, 2016 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adaam2/b343f9a839a1cd103b506105c40c40d5 to your computer and use it in GitHub Desktop.
Save adaam2/b343f9a839a1cd103b506105c40c40d5 to your computer and use it in GitHub Desktop.
public interface IRepository<T> where T : class
{
T Find(int id);
List<T> All();
void Delete(int id);
void Update(T obj);
}
public class ProductRepository : IRepository<Product>
{
public List<Product> All()
{
throw new NotImplementedException();
}
public void Delete(int id)
{
throw new NotImplementedException();
}
public Product Find(int id)
{
throw new NotImplementedException();
}
public void Update(Product obj)
{
throw new NotImplementedException();
}
}
public class OrderRepository : IRepository<Order>
{
public List<Order> All()
{
string sql = "SELECT * FROM Order";
// blah blah
}
public void Delete(int id)
{
throw new NotImplementedException();
}
public Order Find(int id)
{
throw new NotImplementedException();
}
public void Update(Order obj)
{
throw new NotImplementedException();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment