User1765474751 posted
Thanks for your Reply.
But i don't want to Mention SP name in my controller. i want some generic functions for calling stored procedures as we use in Generics Repository.
<TEntity> GetAll<>
so it can recognize the table name.
I want jus like this.
public class CountryRepository
{
public Country GetCountry(int CountryId, DateTime fromDate, DateTime toDate)
{
// EF or ADO.NET code here
}
}
Client code would then be e.g.
var c = unitOfWork.CountryRepository.GetCountry(1, DateTime.Now.AddYears(-1), DateTime.Now);
I want just like this.. But it is in Simple Repository . I want the same in Generics Repository.
and
what will be my //EF Code if I provide SP name here related to TEntity.?
as we simply do in generics repository as like this
internal void Add<T>(T entity)
{
dbSet.Add(entity);
}
it can recognize the insertion will be in table of TEntity.
but If i want to call any Dynamic SP related to TEntity, so how will it possible.?