-
Notifications
You must be signed in to change notification settings - Fork 266
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
Untyped Save<T> when calling from Session #111
Comments
Hi. Sorry for the late reply. Can you please tell me what this would solve? Is there a bug happening the way it is now? Parsing to dynamic is very slow, so I'd like to have a good use case for it. |
I think it's a bug. When you implement your own Pseudo code: var aggregate = new MyAggregate();
session.Add(aggregate);
await session.Commit();
public class MyRepository : IRepository
{
public Task Save<T>(T aggregate, int? expectedVersion = null, CancellationToken cancellationToken = default) where T : AggregateRoot
{
Console.WriteLine(typeof(T).Name); // -> AggregateRoot
Console.WriteLine(aggregate.GetType().Name); // -> MyAggregate
// ...
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following line calls IRepository.Save untyped (T is always AggregateRoot)
CQRSlite/Framework/CQRSlite/Domain/Session.cs
Line 75 in ce8cc0f
I would suggest to use dynamic
This calls Save with the concrete Type of the aggregate.
The text was updated successfully, but these errors were encountered: