Open c3dr0x opened 6 years ago
I have a DTO named MyResult that reference the Title property of both ParentA & ParentB
class ParentA
{
public string Title { get; set; }
}
class ParentB
{
public string Title { get; set; }
}
To make sure that I reference known columns I want to use DO_ALIAS to generate them
The generated DTO will then looks like the following code extract. Which is problematic because two properties can't have the same name. By default it uses the source object property name.
class MyDto
{
public string Title { get; set; }
public string Title { get; set; }
}
The DO_ALIAS offers an escape:
Then, the generated object will be:
class MyDto
{
public string TitleParentA { get; set; }
public string TitleParentB { get; set; }
}
I'm not comfortable with that solution because it does not correspond to the way naming conventions works with kinetix. When you add a link between two tables it is always with a reverse order of what is proposed here : ExternalTableId
or ExternalTableCode
.
I want to be able to do the same here using DO_ALIAS.
Have an evolution like what follows:
Table_Column_Role
(With Role
being optional). The generated property was as follow : ColumnRole
Table_Column_Pre_Post
(With Pre
& Post
being optional). Meaning you can write: Table_Column__Post
. The generated property is as follow : PreColumnPost
see : https://github.com/get-focus/kinetix-tools/commit/9481d74a9a530d0094958c6914c43f94eb0cea97
When generating a DTO with multiple DO_ALIAS that references columns of entities with the same name you need to use the alias' role feature. But it generates the code with a form of ColumnRole which is reverse from the others patterns. It should be something like PreColumnPost to be complete and more coherent with the rest of the application.