I'm expecting that Exists<>()
function will check if data exists in database:
if (!Service.Db.Exists<Poco.ApplicationObject>(applicationObject))
{
Service.Db.Insert(applicationObject);
}
but I'm getting System.NotImplementedException
when running this code.
private static bool HasChildren<T>(this IDbCommand dbCmd, object record, string sqlFilter, params object[] filterParams)
{
string str = OrmLiteConfig.DialectProvider.ToExistStatement(typeof (T), record, sqlFilter, filterParams);
dbCmd.CommandText = str;
return dbCmd.ExecuteScalar() != null;
}
Is it implemented in ServiceStack.OrmLite.SqlServer
?