IntelliTect / IntelliTect/Coalesce
Support EFCore HierarchyId datatype
- Dominant language
- C#
- Stars
- 82
- Forks
- 24
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 5
Description
Current behavior:
1. Create a new Coalesce project from the template
2. Add the `Microsoft.EntityFrameworkCore.SqlServer.HierarchyId` package to the project
3. Add a property to a model that uses the type `HierarchyId`
4. Code generation fails with:
```
** Failure: Coalesce.TestProject.Data.Models.MyModel,MyModelHierarchyId: The target object for the property has no discernible display text. Add a [ListTextAttribute] to one of its properties.
```
Currently this behavior can be worked around by decorating the new property with the `[InternalUse]` property, but then the property will be ignored by Coalesce and not show up in generated DTOs or Typescript types.
```[tasklist]
### Tasks
- [ ] Add the `Microsoft.EntityFrameworkCore.SqlServer.HierarchyId` package to Coalesce
- [ ] Add the above package to the generated solution
- [ ] Add a check in the context validation to recognize usage of the `HierarchyId` type
- [ ] Add a special case in DTO generators and mappers to convert `HierarchyId` to a string type and back
- [ ] Add `HierarchyId` properties to test fixtures and expand tests to assert that APIs, DTOs and Typescript types generate properly for the new types
```
Contributor guide
Assessment
This issue has not been assessed yet.