Skip to content

Product uniqueness not working as expected #552

Closed Answered by mattbrailsford
ja0b asked this question in Q&A
Discussion options

You must be logged in to vote

So uniquenessPropertyAliases needs to contain aliases or properties that are within the properties dictionary that you pass in (in your case postModel.ExtraProperties) which states for those properties, treat the uniqueness of the values to determine the creation of a new line.

The easiest way to force a unique order line would be to pass a value in the properties collection with a random generated guid and then pass the alias of that property into the uniquenessPropertyAliases collection.

var uniquenessPropertyAliases = new[]{ "myUnique" };
var props = new Dictionary<string, string> {
    { "myUnique", Guid.NewGuid().ToString() }
};
// TODO: Merge props with postModel.ExtraProperties
order.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mattbrailsford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants