dino2dy
❔ Access 2 properties from validationRule
Hi everyone,
I have a valdiation rule on textbox ID when entering a new user. A user inputs ID which is a unique string every person has. I have a validation rule that checks the ID against the db column ID to see if it is unique and hasn't been inputted before. This all works. The issue is that you can also edit an existing user. The user that is edited will throw the validation error for ID because the validation rules still checks the ID against the DB. I wish to access the newRow property from the VM in the validationRule so that the rule would only throw an error if the newRow flag is true. How can I do this?
7 replies
❔ Linq group by with multiple columns for the outer and then 1 other column for the inner group
Lets say I have a list of class Car. It has properties Id, Model, Year, Age,CarCode. A carCode is unique for a model but is not for all models.
I want to group by Model and Year together and then group that grouping by Age and then for each Agegroup in each model and year group send Model, Age, and list<string>CarCodes to a method which will update a db table with those CarCodes.
I found some pieces of code online but couldnt get anything to give me the thing I need.
this line of thinking did not work
What I want
3 replies