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

AggregateRoot with nested Entity #143

Open
Climax85 opened this issue May 24, 2021 · 3 comments
Open

AggregateRoot with nested Entity #143

Climax85 opened this issue May 24, 2021 · 3 comments

Comments

@Climax85
Copy link

For example, there is a Blog AggregateRoot with a list property of Posts:

public class Blog : AggregateRoot<Guid>
{
    public virtual string Title { get; protected set; }

    public virtual List<Post> Posts { get; protected set; }
}

public class Post : Entity<Guid>
{
    public virtual string Title { get; protected set; }

    public virtual string Content { get; protected set; }
}

When I generate the code for Blog, I would expect that a BlogDto and a PostDto would be generated.
Where the BlogDto contains a List of PostDto.

But what I get is just a BlogDto with a property of type List instead of List.

Would it be possible to support nested entities?

@wakuflair
Copy link
Member

Unfortunately, that's not supported yet.

@Climax85
Copy link
Author

Thank you for the fast reply. Is this task in your roadmap?
Could you give advise where and how to implement that on my own?
Should be some recursive function. But I'm not familiar with elsa workflow yet.
So I'm not sure where to implement that. There should probably be a list of EntityInfo?!

@wakuflair
Copy link
Member

Hi @Climax85

Is this task in your roadmap

Not for recent plan.

Could you give advise where and how to implement that on my own?

I think it's possible to implement this through Roslyn service, which is already used to parse entity classes.
It's not very related with elsa, although everything in ABPHelper is implemented as an elsa workflow.
For now entity properties are parsed as strings, for your feature, they should be parsed with more info rather than a simple string.

You might need a pre scan of all entity types.

A little bit trivial, but possible.

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

2 participants