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

Using value object collections with a CosmosDB repository causes PopulateFromEntity to render invalid code #115

Open
stephanjohnson opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@stephanjohnson
Copy link

What happened?

For the template Intent.CosmosDB.CosmosDBDocument when i use a value object as a property type, and set it as a collection, the following code is produced for the PopulateFromEntity method

public EventDocument PopulateFromEntity(Event entity, Func<string, string?> getEtag)
{
    Id = entity.Id;
    TraceId = entity.TraceId;
    TokenId = entity.TokenId;
    UserId = entity.UserId;
    IncomingClaims = .Select(x => ClaimValueObjectDocument.FromEntity(x)!).ToList();
    RequestedScopes = entity.RequestedScopes.ToList();
    Metadata = entity.Metadata;
    Timestamp = entity.Timestamp;

    _etag = _etag == null ? getEtag(((IItem)this).Id) : _etag;

    return this;
}

The problematic code being

IncomingClaims = .Select(x => ClaimValueObjectDocument.FromEntity(x)!).ToList();

What version of Intent Architect are you using?

4.3.9

Additional information

No response

@stephanjohnson stephanjohnson added the bug Something isn't working label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant