I am using the inheritance and Interfaces concepts in my partial classes and my 1 class which is partial is inherited from an Interface but I found the typecasting error on this: My interface class ImedicalGroup.cs
public partial interface IMedicalGroup : IAudit
{
int Id { get; set; }
string Name { get; set; }
}
My Child partial class medicalgroups.cs
public partial class MedicalGroups : IMedicalGroup,IAudit
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
#Audit region
}
My 2nd partial class of medicalgroups.cs in QueryableDbContext.cs
[global::System.Data.Services.Common.DataServiceKeyAttribute("Id")]
public partial class MedicalGroups
{
....
}
But I have found error on this line is "Cannot implicitly convert type 'HRBC.BusinessDataContext.MedicalGroups' to 'HRBC.Domain.Entities.IMedicalGroup'. An explicit conversion exists (are you missing a cast?)"
IMedicalGroup IClient.MedicalGroup { get { return MedicalGroup; } }
IMedicalGroup
, you don't need to specify IAudit
too, since IMedicalGroup
already forces you to implement IAudit
Cheers! :)