create a Clear method for the BaseProxyClass
A Clear Method should allow us to execute _changedValues.Clear();
public T Clear<T>() where T : BaseProxyClass
{
_changedValues.Clear();
return (T)this;
}
Reason being following request:
var leads = (from l in crmContext.CreateQuery<Lead>()
select new Lead
{
LastName = l.LastName,
LeadSourceType = l.LeadSourceType
}.Clear<Lead>());
The only way to select column here is by creating a new instance of Lead in select. This will cause all columns to be considered "changed". Even though they were just retrieved.
Therefore it should be possible to Clear the _changedValues property.
3
votes
Ahash Sritharan
shared this idea