-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic Type Model #49
Comments
I'm not the maintainer of this library, just a user of it, but I had a similar challenge tonight and thought I'd reveal how I got it to work in a generic fashion. I have a very standard EF core data context
Nothing too complicated. Then as a public method to my DC I added the following function
NOTE the : class, new() on the end of the method signature? this is needed in order to match the signature of ToList. Once this is added , you can use it quite simply as follows
Put your own concrete type in the type parameter, and the name of the fn to call in the quote marks. I HAVE NOT yet added sending any parameters in, as I don't actually need any for what I'm doing, but it shouldn't take you too much to figure out. |
How can I make this function generic :
return Context.LoadStoredProc("dbo.ListAll")
.AddParam("limit", 300L)
.AddParam("limitOut", out IOutParam limitOut)
.Exec(r => rows = r.ToListAsync());
The text was updated successfully, but these errors were encountered: