Skip to content

Instantly share code, notes, and snippets.

@eschneider999
Last active November 22, 2016 22:46
Show Gist options
  • Save eschneider999/1b5b15cd733a35be0259d4eece9598b7 to your computer and use it in GitHub Desktop.
Save eschneider999/1b5b15cd733a35be0259d4eece9598b7 to your computer and use it in GitHub Desktop.
Symbiotic ORM ExecuteScalar
public void TestScalar()
{
IDatabaseTypesFactory factory = new DatabaseTypesFactorySqlServer();
factory.ConnectionString = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=D:\\Dev\\FrozenElephant\\SymbioticORM\\SqlDatabase\\SymbioticTestLocal.mdf;Integrated Security=True;Connect Timeout=30";
IObjectLoader loader = factory.CreateObjectLoader();
decimal val = loader.ExecuteScalar<decimal>(factory.CreateSqlQuery("Select count(*) from people","TestScalar"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment