Hi All,
I am having a generic interface as:
public IRepository< T >
{
void Add(T entity);
}
and a class as:
public class Repository< T >:IRepository< T >
{
void Add(T entity)
{ //Some Implementation
}
}
Now I want to make an extension method of the above interface. I made the following class:
public static class RepositoryExtension
{
public static void Add(this IRepository< T > dataAccessRepository, T entity, string additionalValue)
{
//Some Implementation
}
}
But I get error in the extension Add method. It doesn't recognize the Type 'T' I have passed to IRepository. I cannot event pass this Type to my Extenstion Methods class i.e RepositoryExtension< T >. Please guide the appropriate way.