Is it possible to ignore a value while using AddOrUpdate?
Also, what values does it look for when matching to a value and deciding what to change. I tried reading this article, but obviously it didn't help.
Let's say I have two objects in db (I realize this isn't real code):
Obj1.fieldA == 1, Obj1.fieldB == 2, Obj1.fieldC == 5
Obj1.fieldA == 1, Obj1.fieldB == 3, Obj1.fieldC == 6
And then I try to AddOrUpdate an object that matches both:
Obj3.fieldA == 1, Obj3.fieldB == 2, Obj3.fieldC == 6
How is it going to decide which one to update, if any/both?
Edit based on comments/answers in regard to Id, which I don't specify.
var someGroup = new API.Models.Group
{
Name = "Blah"
Organization = "Blabedy blah",
Description = "Blah blah"
}
db.Groups.AddOrUpdate(someGroup);
The id property is there but automatically generated:
// Id
[Key]
public long Id { get; set; }