Reputation: 1941
I have SQL query (stored procedure) and generated method in dataContext.
In my stored procedure, I select 4 rows, but in ReturnValue
I have "0".
(4 row(s) returned)
@RETURN_VALUE = 0
Can I return rows? :(
In repository:
public IEnumerable<Index_RandomTale> GetRandomTalesForIndex()
{
return _dataContext.Index_GetRandomTales().ReturnValue as IEnumerable<Index_RandomTale>;
}
In my controller:
IEnumerable<Index_RandomTale> tales = _dataManager.commonRepository.GetRandomTalesForIndex();
Upvotes: 0
Views: 510
Reputation: 11987
i could be wrong here, but you don't actually want the return value, you just want the function call, so it should be this:
public IEnumerable<Index_RandomTale> GetRandomTalesForIndex()
{
return _dataContext.Index_GetRandomTales() as IEnumerable<Index_RandomTale>;
}
Upvotes: 2