--- title: "Using Simple ORM Objects" slug: "using-simple-orm-objects" description: "Learn how to use ORM objects in the Decisions SDK to fetch, store, update, and count entities using common database operations." updated: 2026-04-27T20:46:53Z published: 2026-04-28T14:13:01Z canonical: "documentation.decisions.com/using-simple-orm-objects" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Using Simple ORM Objects ## Overview The Decisions SDK allows developers to work with the ORM, a feature for storing and retrieving entities in the main Decisions database. This example uses a MyCustomer class that is available to download below. For more information on creating ORM, the ORM Base Classes, and Objects, review [ORM Basics](https://documentation.decisions.com/version-10/docs/orm-basics).[MyCustomer.cs](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/MyCustomer.cs) The ORM class and DynamicORM class represent access to ORM storage. The difference is that the ORM class adds multiple typesafe methods. Below is an example of each class. #### ORM ```csharp ORM orm = new ORM(); MyCustomer mc= orm.Fetch("11223"); ``` #### DynamicORM ```csharp DynamicORM orm = new DynamicORM(); IORMEntity e = orm.Fetch(typeof (MyCustomer), "11223"); MyCustomer mc = (MyCustomer) e; ``` --- ## Example The examples below use the ORM class. ### **Fetching an object by ID** ```csharp ORM orm = new ORM(); MyCustomer mc = orm.Fetch("11223"); ``` --- ### **Fetching an object with where conditions** ```csharp ORM orm = new ORM(); MyCustomer[] mc = orm.Fetch(new WhereCondition[] {new FieldWhereCondition("first name", QueryMatchType.StartsWith, "J"), }); ``` --- ### **Storing an object** ```csharp ORM orm = new ORM(); orm.Store(new MyCustomer() {FirstName = "Joe"}); ``` ### **Storing multiple objects** A list can be stored using the Store() method. ```csharp ORM orm = new ORM(); orm.Store(new MyCustomer[] { new MyCustomer() {FirstName = "Joe"}, new MyCustomer() {FirstName = "John"} }); ``` A list can also be stored using the BatchInsert() method. ```csharp ORM orm = new ORM(); orm.BatchInsert(new MyCustomer[] { new MyCustomer() {FirstName = "Joe"} new MyCustomer() {FirstName = "John"} }); ``` --- ### **Saving only specific fields on an object** ```csharp ORM orm = new ORM(); orm.Store(new MyCustomer() {FirstName = "Joe"}, false, false, "first_name", "last_name"); ``` Other parameters can be used, including store relationships, process before and after save methods, and fields to save. --- ### ****Seeing if an entity exists**** ```csharp ORM orm = new ORM(); if (orm.Exists("12234")) { // do something } ``` --- ### ****Getting a count of entities**** ```csharp ORM orm = new ORM(); long count = orm.GetCount(); ```