Skip to content

Support EFCore HierarchyId datatype #491

@adamskt

Description

@adamskt

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.

### 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions