Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve extended union models usage #18

Open
dimonchelli-dev opened this issue Sep 5, 2023 · 0 comments
Open

Improve extended union models usage #18

dimonchelli-dev opened this issue Sep 5, 2023 · 0 comments

Comments

@dimonchelli-dev
Copy link

dimonchelli-dev commented Sep 5, 2023

Seems, we need to repeat subtypes when try to extend union model

[UnionType(typeof(Result1))]
[UnionType(typeof(Result2))]
[UnionType(typeof(Result3))]
[UnionType(typeof(Result4))]
public partial class DataAccessUpdateResult
{
}

[UnionType(typeof(Result1))]
[UnionType(typeof(Result2))]
[UnionType(typeof(Result3))]
[UnionType(typeof(Result4))]
[UnionType(typeof(Result5))]
[UnionType(typeof(Result6))]
[UnionConverterFrom(typeof(DataAccessUpdateResult))]
public partial class BusinessLogicUpdateResult
{
}

Maybe it will be more convenient to not repeat it and have ability to describe the type we want to extend (and also have implicit converting from it)

[UnionType(typeof(Result1))]
[UnionType(typeof(Result2))]
[UnionType(typeof(Result3))]
[UnionType(typeof(Result4))]
public partial class DataAccessUpdateResult
{
}

[UnionType(typeof(Result5))]
[UnionType(typeof(Result6))]
[ExtendUnionFrom(typeof(DataAccessUpdateResult))]
public partial class BusinessLogicUpdateResult
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant