If our model inherited from another class (for example : InvoiceViewModel : Invoice) the code generator does not generate any properties of the parent class.
As I checked the following function the problem comes from "prop.IsReadable()" where it returns False for all parent class's properties:
List<ModelProperty> GetEligibleProperties(EnvDTE.CodeType typeInfo, bool includeUnbindableProperties) {
List<ModelProperty> results = new List<ModelProperty>();
if (typeInfo != null) {
foreach (var prop in typeInfo.VisibleMembers().OfType<EnvDTE.CodeProperty>()) {
if (prop.IsReadable() && !prop.HasIndexParameters() && (includeUnbindableProperties || IsBindableType(prop.Type))) {
results.Add(new ModelProperty {
Name = prop.Name,
ValueExpression = "Model." + prop.Name,
Type = prop.Type,
IsPrimaryKey = Model.PrimaryKeyName == prop.Name,
IsForeignKey = ParentRelations.Any(x => x.RelationProperty == prop),
IsReadOnly = false//!prop.IsWriteable()
});
}
}
}
return results;
}