-
Hi @jasontaylordev , Thanks for this wondering template, I'm truly one of those who are benefitted by using this template. I'm having question regarding running raw sql in your template. I'm not able to access FromSqlRaw from context I'm trying to run a separate sql statement like below
But .FromSqlRaw is not accessible. context.database is also not accessible. Any idea what is stopping me to access these methods in this template. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
That is because _context here is an You could add those to the interface, but that would not be a clean solution. If you need that kind of specific behaviour (FromRawSql), you should implement that in the infrastructure layer, as otherwise you're making your application layer dependent on a specific database engine. Create an interface for it in the application layer which you then use there. |
Beta Was this translation helpful? Give feedback.
-
I don't know why that happens to you but to me, it works just perfectly fine. Take a look at this screenshot |
Beta Was this translation helpful? Give feedback.
#248 (comment)