I am using MVC Scaffolding + EF6 in a Web applicatioon project in VS 2013.
Domain classes (Entites) and the context (DbContext
) are in two separate projects referenced by the Web project.
I have a Patient class which has a complex property like follows.
public class Patient
{
public int PatientId { get; set; }
// Some properties
// Complex property
public MyComplexType Complex { get; set; }
}
public class MyComplexType
{
public SomeType Property1 { get; set; }
public SomeOtherType Property2 { get; set; }
}
Problem:
MVC scaffolding engine does not detect the complex property in Patient
class and generated views don't contain fields to show or edit that property. I tried decorating MyComplexType
class with ComplexType
attribute but it didn't work.
What can be done?