Hi, I'm having trouble trying to implement a shared method/property between two classes created by the linq2sql designer.
My two classes have two main properties (coming from the db model):
public partial class DirectorPoll
{
public bool Completed {get; set;}
public bool? Reopen { get; set; }
//more properties
}
public partial class StudentPoll
{
public bool Completed {get; set;}
public bool? Reopen { get; set; }
//more properties
}
Now for example I create an abstract class:
public abstract class GenericPoll
{
public abstract bool Completed { get; set; }
public abstract bool? Reopen { get; set; }
public bool CanEdit
{
get
{
if (Completed == false) return true;
if (Reopen.GetValueOrDefault(false) == false) return false;
return true;
}
}
}
Then
public partial class DirectorPoll : GenericPoll
public partial class StudentPoll: GenericPoll
But when I try to compile it says "Director does not implement inherited abstract member GenericPoll.Completed.get". But it is there. So I think I'm forced to put an override to the property automatically generated by the designer, but if I update the database later and recompile it will give me the same error.
I think I might be missing something here but I've tried different approaches with no success. ¿So what can I do here, besides implementing CanEdit in each of my partial classes? Thanks