jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

database function

oishiimendesu opened this issue · comments

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.

I don't remember if that was ever implemented.

You can try:

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

I don't remember if that was ever implemented.

You can try:

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

thanks

Is it SQL Server the DB? This would work:

public interface IBeerRepository
{
   [Sql("SELECT dbo.fn_CountCustom()")]
   void CountCustom();
}

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.

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

Thanks.