jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM
Other
859 stars 145 forks source link

database function #405

Closed oishiimendesu closed 4 years ago

oishiimendesu commented 5 years ago

Hello, Can I use auto-interface for executing sql functions, like this:

public interface IBeerRepository { [Sql("fn_CountCustom")] void CountCustom(Beer beer); }

or something like that.

jonwagner commented 5 years ago

I don't remember if that was ever implemented.

You can try:

[Sql("fn_CountCustom", CommandType.SqlFunction)]
oishiimendesu commented 5 years ago

I don't remember if that was ever implemented.

You can try:

[Sql("fn_CountCustom", CommandType.SqlFunction)]

thanks

Jaxelr commented 4 years ago

Is it SQL Server the DB? This would work:

public interface IBeerRepository
{
   [Sql("SELECT dbo.fn_CountCustom()")]
   void CountCustom();
}
oishiimendesu commented 4 years ago

I don't remember if that was ever implemented.

You can try:

[Sql("fn_CountCustom", CommandType.SqlFunction)]

this doesn't work, because CommandType.SqlFunction not exists.

Jaxelr commented 4 years ago

Closing, if you have any other issues with this snippet reopen issue.

Thanks.