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
![](https://secure.gravatar.com/avatar/c786326355b1cd03c67a1b293d6e775a?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)