Skip to content

Question about the new() generics constraint on aggregate classes #12

@cmrdY

Description

@cmrdY

Hi @dasiths, thank you for your work.

Just a question,
in /src/NEventLite/Repository/Repository.cs (the CreateNewInstance() method), is it necessary to force a public parameter-less constructor to be defined on the aggregate class?
Why not something like this?
return (TAggregate)Activator.CreateInstance(typeof(TAggregate), nonPublic: true);

Thank you in advance. I am new to Github so I am sorry if I am not doing this right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions