Created
December 6, 2016 10:13
-
-
Save adaam2/b343f9a839a1cd103b506105c40c40d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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