I have a problem with a partial class that implements one property.
In my case, I have a table mapped in a datacontext, so I obtain the self-generated MyDataContext.MYTABLE.cs class.
And I have a partial class with one property more. This property it's not mapped becouse I only use it internally in my app.
Code: Select all
public partial class MYTABLE
{
private string _PROPERTY_0;
public string PROPERTY_0
{
get { return _PROPERTY_0; }
set
{
if (_PROPERTY_0 != value)
{
SendPropertyChanging("PROPERTY_0");
_PROPERTY_0 = value;
SendPropertyChanged("PROPERTY_0");
}
}
}
}
But with last version, events "SendProperty..." give me a System.InvalidOperationException "Sequence contains no elements".
This only happens with properties that are not mapped and are implemented in a partial class.
I have commented the lines that throws the events to solve the problem but I'm not sure if it is a good idea.
The stacktrace:
Code: Select all
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Devart.Data.Linq.Engine.c7.b(Object A_0, PropertyChangingEventArgs A_1)
at FranceDataContext.MYTABLE.SendPropertyChanging(String propertyName) in ...