POCO inherited type could not pass addObject method
- by bryanevil
Hi all
I am using a POCO class name "Company" generate from the T4 POCO code generator to create a derived class - name "CompanyBO" by "public class CompanyBO:Company", but when i call addObject method:
public void Delete(T entity)
{
CustomerWebPortalEntities entities = new CustomerWebPortalEntities();
entities.AddObject(entity.GetType().BaseType.Name, entity);
entities.DeleteObject(entity);
SaveChanges();
}
it compliant this:
The EntitySet name 'CustomerWebPortalEntities.Company' could not be found.
System.Data.Objects.ObjectContext.GetEntitySet(String entitySetName, String entityContainerName)
at System.Data.Objects.ObjectContext.GetEntitySetFromName(String entitySetName)
Could you please tell me whats going wrong here? How do I resolve this problem?
Best Regards
Bryan