//The update gets a reference to the parent object as well.... public Modification <TContainer, TElement> Add <TField>(Expression <Func <TElement, TField> > fieldSelector, Action <TField, TElement> entityUpdateReferencingParent) where TField : class, IEntity, new() { var upd = new EntityAddition <TElement, TField>(fieldSelector, entityUpdateReferencingParent); this.EntityFieldModifications.Add(upd); return(this); }
//Add an entity as a field. Does not update any value inside it. public Modification <TContainer, TElement> Add <TField>(Expression <Func <TElement, TField> > fieldSelector) where TField : class, IEntity, new() { var upd = new EntityAddition <TElement, TField>(fieldSelector, x => { }); this.EntityFieldModifications.Add(upd); return(this); }