diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/PropertyData.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/PropertyData.cs index 274811e24f..8463e97d3b 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/PropertyData.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/PropertyData.cs @@ -175,20 +175,6 @@ public static object CreatePropertyDto(PropertyData propertyData) { switch (propertyData[ResourceRenderer.RenderType]) { - case ResourceRenderer.RenderNull: - - return new - { - Null = new { }, - Property = propertyData.Render() - }; - case ResourceRenderer.RenderNullLookup: - - return new - { - NullLookup = new { }, - Property = propertyData.Render() - }; case ResourceRenderer.RenderStandard: return new @@ -343,17 +329,5 @@ public static PropertyData CreateUsiPrimaryKey(ResourceProperty property) return data; } - - public static PropertyData CreateNullProperty(ResourceProperty property) - { - var propertyData = CreateStandardProperty(property); - - propertyData[ResourceRenderer.RenderType] = - property.IsDescriptorUsage - ? ResourceRenderer.RenderNullLookup - : ResourceRenderer.RenderNull; - - return propertyData; - } } } diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourcePropertyRenderer.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourcePropertyRenderer.cs index a7832aabf9..6cf55726ef 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourcePropertyRenderer.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourcePropertyRenderer.cs @@ -223,17 +223,11 @@ public object AssembleInheritedProperties(ResourceClassBase resource) throw new ArgumentNullException(nameof(resource)); } - IList includedProperties = null; + IList includedProperties = null; includedProperties = resource.InheritedProperties() .OrderBy(x => x.PropertyName) .Where(x => !x.IsIdentifying && !x.PropertyName.Equals("Id")) - .Select( - x => new ResourcePropertyData - { - Property = x, - IsStandardProperty = false - }) .ToList(); var propertiesToRender = new List(); @@ -246,9 +240,7 @@ public object AssembleInheritedProperties(ResourceClassBase resource) includedProperties.Select( x => { - var propertyData = x.IsStandardProperty - ? PropertyData.CreateNullProperty(x.Property) - : PropertyData.CreateStandardProperty(x.Property); + var propertyData = PropertyData.CreateStandardProperty(x); propertyData[ResourceRenderer.MiscellaneousComment] = "// NOT in a reference, NOT a lookup column "; return propertyData; @@ -258,9 +250,7 @@ public object AssembleInheritedProperties(ResourceClassBase resource) { propertiesToRender.AddRange( includedProperties.Select( - x => x.IsStandardProperty - ? PropertyData.CreateNullProperty(x.Property) - : PropertyData.CreateStandardProperty(x.Property))); + PropertyData.CreateStandardProperty)); } return propertiesToRender.Any() @@ -408,14 +398,6 @@ orderby p.PropertyName foreach (var propertyPair in propertyPairs) { - // If the property was filtered out, then generate an explicit interface "Null" implementation only. - if (propertyPair.CurrentProperty == null) - { - yield return PropertyData.CreateNullProperty(propertyPair.UnderlyingProperty); - - continue; - } - var property = propertyPair.CurrentProperty; if (property.IsSynchronizable()) @@ -454,12 +436,5 @@ orderby p.PropertyName } } } - - private class ResourcePropertyData - { - public ResourceProperty Property { get; set; } - - public bool IsStandardProperty { get; set; } - } } } diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourceRenderer.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourceRenderer.cs index 95aac62b39..2a3210fa81 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourceRenderer.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Generators/Resources/ResourceRenderer.cs @@ -17,8 +17,6 @@ public static class ResourceRenderer public const string RenderReferenced = "referenced"; public const string RenderUnified = "unified"; public const string RenderUsi = "usi"; - public const string RenderNull = "null"; - public const string RenderNullLookup = "nullLookup"; public const object DoNotRenderProperty = null; public const bool DoRenderProperty = true; } diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Mustache/Resources.mustache b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Mustache/Resources.mustache index 59f2fddc37..e3e630c689 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Mustache/Resources.mustache +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen/Mustache/Resources.mustache @@ -482,26 +482,6 @@ namespace {{ResourceClassesNamespace}} {{/PropertyDefaultHasDomainMeaning}} {{/Property}} {{/Standard}} - {{#Null}} - {{#Property}} - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - {{PropertyType}} {{ParentNamespacePrefix}}I{{ParentName}}.{{PropertyName}} - { - get { return default({{PropertyType}}); } - set { } - } - {{/Property}} - {{/Null}} - {{#NullLookup}} - {{#Property}} - // IS a lookup column, Not supported by this model, so there's "null object pattern" style implementation - {{PropertyType}} {{ParentNamespacePrefix}}I{{ParentName}}.{{PropertyName}} - { - get { return null; } - set { } - } - {{/Property}} - {{/NullLookup}} {{#Referenced}} {{#Property}} @@ -828,28 +808,6 @@ namespace {{ResourceClassesNamespace}} public {{PropertyType}} {{PropertyName}} { get; set; } {{/Property}} {{/Standard}} - {{#Null}} - - {{#Property}} - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - {{PropertyType}} {{PropertyNamespacePrefix}}I{{ParentName}}.{{PropertyName}} - { - get { return default({{PropertyType}}); } - set { } - } - {{/Property}} - {{/Null}} - {{#NullLookup}} - - {{#Property}} - // IS a lookup column, Not supported by this model, so there's "null object pattern" style implementation - {{PropertyType}} {{PropertyNamespacePrefix}}I{{ParentName}}.{{PropertyName}} - { - get { return null; } - set { } - } - {{/Property}} - {{/NullLookup}} {{/Properties}} {{/InheritedProperties}} // ------------------------------------------------------------- @@ -1008,28 +966,6 @@ namespace {{ResourceClassesNamespace}} {{/PropertyDefaultHasDomainMeaning}} {{/Property}} {{/Standard}} - {{#Null}} - - {{#Property}} - // NOT a lookup column, Not supported by this model, so there's "null object pattern" style implementation - {{PropertyType}} {{NullPropertyPrefix}}{{CSharpSafePropertyName}} - { - get { return default({{PropertyType}}); } - set { } - } - {{/Property}} - {{/Null}} - {{#NullLookup}} - - {{#Property}} - // IS a lookup column, Not supported by this model, so there's "null object pattern" style implementation - {{PropertyType}} {{NullPropertyPrefix}}{{PropertyName}} - { - get { return null; } - set { } - } - {{/Property}} - {{/NullLookup}} {{/Properties}} {{/NonIdentifiers}} // -------------------------------------------------------------