@@ -8,9 +8,10 @@ var entityName = entity.Name.ToCheckedCase();
88
99var typeDeclaration = entityName;
1010
11+
1112// In the case a entity type name ends with "Request", we will have a collision with the Request objects
12- // when we generate. For example, there are entities named EventMessage and EventMessageRequest. Those entities
13- // lead to the generation of an EventMessageRequest and EventMessageRequestRequest request objects in the same
13+ // when we generate. For example, there are entities named EventMessage and EventMessageRequest. Those entities
14+ // lead to the generation of an EventMessageRequest and EventMessageRequestRequest request objects in the same
1415// namespace as the entities. We add 'Object' to the end of the name to disambiguate the entity.
1516// This change needs to sync with changes for the *Request templates.
1617
@@ -19,10 +20,18 @@ if (typeDeclaration.EndsWith("Request"))
1920 typeDeclaration = String.Concat(typeDeclaration, "Object");
2021}
2122
23+ string cstorTypeDeclaration = typeDeclaration;
2224
2325if (entity.Base != null)
2426{
25- typeDeclaration = string.Format("{0} : {1}", typeDeclaration, entity.Base.Name.ToCheckedCase());
27+ var baseTypeDeclaration = entity.Base.Name.ToCheckedCase();
28+
29+ if (baseTypeDeclaration.EndsWith("Request"))
30+ {
31+ baseTypeDeclaration = String.Concat(baseTypeDeclaration, "Object");
32+ }
33+
34+ typeDeclaration = string.Format("{0} : {1}", typeDeclaration, baseTypeDeclaration);
2635}
2736
2837var attributeStringBuilder = new StringBuilder();
@@ -60,7 +69,7 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
6069 ///<summary>
6170 /// The internal <#=entityName#> constructor
6271 ///</summary>
63- protected internal <#=entityName #>()
72+ protected internal <#=cstorTypeDeclaration #>()
6473 {
6574 // Don't allow initialization of abstract entity types
6675 }
0 commit comments