IntelliTect / IntelliTect/Coalesce

Add support for composite keys

Open
#103 4 comments 0 reactions 0 assignees View on GitHub
enhancement proposal
Dominant language
C#
Stars
82
Forks
24
Avg merge
2d 19h
Merged PRs (30d)
5

Description

Because the ClassViewModel for model entities only takes the [first property](https://github.com/IntelliTect/Coalesce/blob/320c376bb4751ed488708fab8fc66291c3a208c3/src/IntelliTect.Coalesce/TypeDefinition/ClassViewModel.cs#L367) with IsPrimaryKey and additionally because the IsPrimaryKey property only looks for the KeyAttribute (ignoring anything set up in the [fluent interface](https://docs.microsoft.com/en-us/ef/core/modeling/keys#fluent-api)), composite keys aren't currently supported by the generated API controllers.

Stuff needed to support this.

- [ ] Change ClassViewModel to have a collection of primary keys,
- [ ] Change ApiController generator to generate anonymous types for key parameters when keys number more than one.
- [ ] Change IsPrimaryKey impl to be aware of both fluently-defined keys and attributed ones.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.