> ## Documentation Index
> Fetch the complete documentation index at: https://www.nestjs-query.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Serialization

Using `class-transformer` is a popular libarary used in `nestjs`, unfortunately `class-transformer` does not place nicely with `sequelize` models.

For most use cases `nestjs-query` will take care of the serialization for you through [assemblers](https://www.nestjs-query.dev/concepts/advanced/assemblers.md). If you find yourself in a situation where you want to use `class-transformer` with a model you should use the following patterns.

To convert your DTO into a model you can use the `build` method on the model.

```ts theme={null}
TodoItemEntity.build(todoItemDTO)
```

When converting your entity into a DTO you can use the following.

```ts theme={null}
const dto = plainToClass(TodoItemDTO, todoItemEntity.get({ plain: true }))
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.