-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
Forcing return type when initiating a select query #483
Comments
This wont work for queries with custom selections, check #183 |
Thanks for coming back to me Ahmad – it certainly looks like what I need. However, building a .Net Core application, I’m currently using DI and your QueryFactory to generate new queries for me and I’m not sure how to get your factory to return me an instance of the GenericQuery instead of the standard SQLKata query…..any thoughts welcome! 😊
Dominic
From: Ahmad Moussawi ***@***.***>
Sent: 22 May 2021 15:27
To: sqlkata/querybuilder ***@***.***>
Cc: Dominic Porter ***@***.***>; Author ***@***.***>
Subject: Re: [sqlkata/querybuilder] Forcing return type when initiating a select query (#483)
CAUTION: This email originated from outside of the organization. Do not click the links or open attachments unless you recognize the sender and know the content is safe.
This wont work for queries with custom selections, check #183<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsqlkata%2Fquerybuilder%2Fpull%2F183&data=04%7C01%7Cdominic.porter%40bhnetwork.com%7Cd10bb04790ab4b6525f308d91d2d9c9f%7C09f55992c50c45628657b1bd6acc36c5%7C0%7C0%7C637572904014009593%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YXjr6ODpyu8vfTR1Edn6DQc%2BgreXTaqNfJKL15CAWGo%3D&reserved=0>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsqlkata%2Fquerybuilder%2Fissues%2F483%23issuecomment-846415695&data=04%7C01%7Cdominic.porter%40bhnetwork.com%7Cd10bb04790ab4b6525f308d91d2d9c9f%7C09f55992c50c45628657b1bd6acc36c5%7C0%7C0%7C637572904014009593%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=sBONPS5Sv%2B3dy3YwoIP%2FgKPdZHGiCNLhs99i6t0gqGk%3D&reserved=0>, or unsubscribe<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATU7B5HEQPVNKYS3BYMDJUDTO65J3ANCNFSM45HLXYZA&data=04%7C01%7Cdominic.porter%40bhnetwork.com%7Cd10bb04790ab4b6525f308d91d2d9c9f%7C09f55992c50c45628657b1bd6acc36c5%7C0%7C0%7C637572904014019548%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pIvSd8sr7fmfGKtDKD0XF4S5K1AcwQWFyEGtoPqI%2BiA%3D&reserved=0>.
This e-mail message inclusive any attachments are only for the use of the intended recipient and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient, any disclosure, distribution or other use of this e-mail message or attachments is prohibited. If you have received this e-mail message in error, please delete it including any attachments and notify the sender immediately.
Registered Name: Hawk Incentives Limited
Place of Incorporation: England & Wales
Registered Office: Westside, London Road, HEMEL HEMPSTEAD, HP3 9TD
Registered No: 4155659
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, rather than using the generic overload on the Get method to return a strongly typed result, would it be possible to set the return type when initialising the query....so something like
var products = db.Query<Product>("Products")
This would allow me to embed initialising the query into a Repository class method with the database table name and typed result set automatically, something like...
class Product { public Query<Product> GetProducts() { return db.Query<Product>("Products"); } }
Once the query is executed, it then returns the typed set automatically.....
The text was updated successfully, but these errors were encountered: