# EntityService Namespace

{% hint style="warning" %}
In order to use this namespace you will need the `cborm` module installed in your application: `install cborm`
{% endhint %}

Gives you the ability to easily inject base ORM services or binded virtual entity services for you:

| DSL                      | Description                                                                                                     |
| ------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `entityService`          | Inject a `BaseORMService` object for usage as a generic service layer                                           |
| `entityService:{entity}` | Inject a `VirtualEntityService` object for usage as a service layer based off the name of the entity passed in. |

```javascript
// Generic ORM service layer
property name="genericService" inject="entityService";
// Virtual service layer based on the User entity
property name="userService" inject="entityService:User";
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wirebox.ortusbooks.com/usage/injection-dsl/entityservice-namespace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
