-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Description
CleanArchitecture/MinimalClean/src/MinimalClean.Architecture.Web/Domain/ProductAggregate/Product.cs
Line 12 in 5770078
| Guard.Against.InvalidInput(id, nameof(id), (id) => id == ProductId.New, |
This logic needs to be inverted to id != ProductId.New as predicate is checked inside InvalidInput this way if (!predicate(input)). Because of this seeding is failing when running minimal version for this template and seeding database:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentException: Use Product.Create() to create new products instead of passing ProductId.New to the constructor. (Parameter 'id')
Also there is a problem with Product creation, as it is using this: return new Product(ProductId.New, name, unitPrice);
So after the changes it won't be able to create new ones
Metadata
Metadata
Assignees
Labels
No labels