I want to execute SQL statement with paraemeters in ServiceStack ormlite
String.Format("SELECT OBJECT_ID(@name)", name);
I want the best way.
I want to execute SQL statement with paraemeters in ServiceStack ormlite
String.Format("SELECT OBJECT_ID(@name)", name);
I want the best way.
If you need the POCO result you can use:
Reference: https://github.com/ServiceStack/ServiceStack.OrmLite#typed-sqlexpressions-with-custom-sql-apis
You can use
SqlScalar<T>
whereT
isint
. Then simply pass an anonymous object with your parameter.to select a
List<T>
of POCO type rather than anint
you can use:You can read more here in the official documentation examples.
Hope this helps.