I have seen generic repository pattern here. I am trying to add generic select clause that i want to send as argument from calling function. I modified
public T GetSingle(Expression<Func<filter, bool>> filter) to
public T GetSingle(Expression<Func<filter, bool>> filter,Expression<Func<T, T>> Selct)
Now I want to call this method. How should i send my select expression
return rep.GetSingle(p => p.Slug == slug,???)
Currently your method can’t change the result type. I suspect that’s not what you want. I would expect you’d want your method to be generic, e.g.
You’d then call that with something like this: