this is i’ve tried so far, just learning from some blogs, i come to know how its important using generic repository, i am wondering how you people do with linq to sql, is there any good tutorial on it..
interface IBlogRepoService<T> where T:class
{
void Add(T entity);
void Delete(T entity);
T GetById(long Id);
T Get(Func<T, Boolean> where);
IEnumerable<T> GetAll();
IEnumerable<T> GetMany(Func<T, bool> where);
}
but i am gettting confused, how to implement it, different model, so is there any tutorial for generic pattern, which you people love to share.
- i want to know how should be the project hierarchy for asp.net mvc3, (linq to sql with generic repository pattern).
There is many examples of the repository pattern for Linq2SQL. See below for a full sample
http://www.codefrenzy.net/2011/10/06/a-generic-implementation-of-the-repository-pattern-for-linq-to-sql/