in my Entity Framework model, I have that column
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public Nullable<global::System.Boolean> CanShow
{
get
{
return _CanShow;
}
set
{
OnCanShowChanging(value);
ReportPropertyChanging("CanShow");
_CanShow = StructuralObject.SetValidValue(value);
ReportPropertyChanged("CanShow");
OnCanShowChanged();
}
}
private Nullable<global::System.Boolean> _CanShow;
partial void OnCanShowChanging(Nullable<global::System.Boolean> value);
partial void OnCanShowChanged();
by using the partial class, I want to add some business logic in OnCanShowChanging
method
to do so, I try the code:
public partial class MyTable
{
partial void OnCanShowChanging(bool? value)
{
if (some_condition)
{
this.CanShow = value;
}
//else -> avoid column data change
}
}
But I get the StackOverflowException
I'm new in that scenario (partial method with Entity Framework), how to fix it ?