diff --git a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs index 1564bd109..8a62647e4 100644 --- a/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs +++ b/Utilities/CodeGeneration/EdFi.Ods.CodeGen.Tests/Approval/5.2.0/DataStandard_520_ApprovalTests.Verify.Standard_Std_5.2.0_Models_Entities_Entities.generated.approved.cs @@ -16,75 +16,99 @@ using EdFi.Ods.Common.Infrastructure.Extensibility; using EdFi.Ods.Common; using EdFi.Ods.Common.Extensions; +using EdFi.Ods.Common.Serialization; using EdFi.Ods.Entities.Common.EdFi; using Newtonsoft.Json; +using MessagePack; +using KeyAttribute = MessagePack.KeyAttribute; -// Aggregate: AbsenceEventCategoryDescriptor +// Aggregate: Descriptor -namespace EdFi.Ods.Entities.NHibernate.AbsenceEventCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AbsenceEventCategoryDescriptor table of the AbsenceEventCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.Descriptor table of the Descriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AbsenceEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAbsenceEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public abstract class Descriptor : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDescriptor, IHasPrimaryKeyValues, IHasAlternateKeyValues, IHasLookupColumnPropertyMap { + public virtual void SuspendReferenceAssignmentCheck() { } + + public Descriptor() + { + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int AbsenceEventCategoryDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + [Key(6)] + public virtual int DescriptorId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(7)] + public virtual string CodeValue { get; set; } + [Key(8)] + public virtual string Description { get; set; } + [Key(9)] + public virtual DateTime? EffectiveBeginDate + { + get { return _effectiveBeginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _effectiveBeginDate = null; + } else + { + var given = (DateTime) value; + _effectiveBeginDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _effectiveBeginDate; + + [Key(10)] + public virtual DateTime? EffectiveEndDate + { + get { return _effectiveEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _effectiveEndDate = null; + } else + { + var given = (DateTime) value; + _effectiveEndDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _effectiveEndDate; + + [Key(11)] + public virtual string Namespace { get; set; } + [Key(12)] + public virtual string ShortDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -124,11 +148,20 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AbsenceEventCategoryDescriptorId", AbsenceEventCategoryDescriptorId); + keyValues.Add("DescriptorId", DescriptorId); return keyValues; } + // Provide alternate key information + (OrderedDictionary keyValues, bool isDefinedOnBaseType) IHasAlternateKeyValues.GetAlternateKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + keyValues.Add("Namespace", Namespace); + keyValues.Add("CodeValue", CodeValue); + return (keyValues, true); + } #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -186,115 +219,37 @@ public override int GetHashCode() return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAbsenceEventCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAbsenceEventCategoryDescriptor) target, null); - } - } } -// Aggregate: AcademicHonorCategoryDescriptor +// Aggregate: EducationOrganization -namespace EdFi.Ods.Entities.NHibernate.AcademicHonorCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationAggregate.EdFi { -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.AcademicHonorCategoryDescriptor table of the AcademicHonorCategoryDescriptor aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AcademicHonorCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAcademicHonorCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class EducationOrganizationReferenceData : IHasPrimaryKeyValues { - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int AcademicHonorCategoryDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + [Key(0)] + public virtual long EducationOrganizationId { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(1)] + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(2)] + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -303,7 +258,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AcademicHonorCategoryDescriptorId", AcademicHonorCategoryDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -324,18 +279,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -352,97 +297,97 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAcademicHonorCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAcademicHonorCategoryDescriptor) target, null); - } - } -} -// Aggregate: AcademicSubjectDescriptor -namespace EdFi.Ods.Entities.NHibernate.AcademicSubjectDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AcademicSubjectDescriptor table of the AcademicSubjectDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganization table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AcademicSubjectDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAcademicSubjectDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public abstract class EducationOrganization : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEducationOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganization() + { + EducationOrganizationAddresses = new HashSet(); + EducationOrganizationCategories = new HashSet(); + EducationOrganizationIdentificationCodes = new HashSet(); + EducationOrganizationIndicators = new HashSet(); + EducationOrganizationInstitutionTelephones = new HashSet(); + EducationOrganizationInternationalAddresses = new HashSet(); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int AcademicSubjectDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + [Key(6)] + public virtual long EducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(7)] + public virtual string NameOfInstitution { get; set; } + [Key(8)] + public virtual int? OperationalStatusDescriptorId + { + get + { + if (_operationalStatusDescriptorId == default(int?)) + _operationalStatusDescriptorId = string.IsNullOrWhiteSpace(_operationalStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OperationalStatusDescriptor", _operationalStatusDescriptor); + + return _operationalStatusDescriptorId; + } + set + { + _operationalStatusDescriptorId = value; + _operationalStatusDescriptor = null; + } + } + + private int? _operationalStatusDescriptorId; + private string _operationalStatusDescriptor; + + [IgnoreMember] + public virtual string OperationalStatusDescriptor + { + get + { + if (_operationalStatusDescriptor == null) + _operationalStatusDescriptor = _operationalStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OperationalStatusDescriptor", _operationalStatusDescriptorId.Value); + + return _operationalStatusDescriptor; + } + set + { + _operationalStatusDescriptor = value; + _operationalStatusDescriptorId = default(int?); + } + } + [Key(9)] + public virtual string ShortNameOfInstitution { get; set; } + [Key(10)] + public virtual string WebSite { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -463,125 +408,342 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + private ICollection _educationOrganizationAddresses; + private ICollection _educationOrganizationAddressesCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationAddresses + { + get { - }; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationAddresses is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationOrganizationAddresses"); + } + + foreach (var item in _educationOrganizationAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _educationOrganizationAddresses; + } + set + { + _educationOrganizationAddresses = value; + _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - return keyValues; + return _educationOrganizationAddressesCovariant; + } + set + { + EducationOrganizationAddresses = new HashSet(value.Cast()); + } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + + private ICollection _educationOrganizationCategories; + private ICollection _educationOrganizationCategoriesCovariant; + [Key(12)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationCategories { - var compareTo = obj as IHasPrimaryKeyValues; + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationCategories is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationOrganizationCategories"); + } + + foreach (var item in _educationOrganizationCategories) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - if (ReferenceEquals(this, compareTo)) - return true; + return _educationOrganizationCategories; + } + set + { + _educationOrganizationCategories = value; + _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + } + } - if (compareTo == null) - return false; + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationCategories) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + return _educationOrganizationCategoriesCovariant; + } + set + { + EducationOrganizationCategories = new HashSet(value.Cast()); + } + } - foreach (DictionaryEntry entry in theseKeys) + + private ICollection _educationOrganizationIdentificationCodes; + private ICollection _educationOrganizationIdentificationCodesCovariant; + [Key(13)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationIdentificationCodes + { + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationIdentificationCodes is DeserializedPersistentGenericSet set) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + set.Reattach(this, "EducationOrganizationIdentificationCodes"); } - } + + foreach (var item in _educationOrganizationIdentificationCodes) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - return true; + return _educationOrganizationIdentificationCodes; + } + set + { + _educationOrganizationIdentificationCodes = value; + _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIdentificationCodes) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - if (keyValues.Count == 0) - return base.GetHashCode(); + return _educationOrganizationIdentificationCodesCovariant; + } + set + { + EducationOrganizationIdentificationCodes = new HashSet(value.Cast()); + } + } - var hashCode = new HashCode(); - foreach (DictionaryEntry entry in keyValues) + private ICollection _educationOrganizationIndicators; + private ICollection _educationOrganizationIndicatorsCovariant; + [Key(14)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationIndicators + { + get { - if (entry.Value is string) + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationIndicators is DeserializedPersistentGenericSet set) { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + set.Reattach(this, "EducationOrganizationIndicators"); } - else + + foreach (var item in _educationOrganizationIndicators) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationIndicators; + } + set + { + _educationOrganizationIndicators = value; + _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIndicators) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationIndicatorsCovariant; + } + set + { + EducationOrganizationIndicators = new HashSet(value.Cast()); + } + } + + + private ICollection _educationOrganizationInstitutionTelephones; + private ICollection _educationOrganizationInstitutionTelephonesCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationInstitutionTelephones + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationInstitutionTelephones is DeserializedPersistentGenericSet set) { - hashCode.Add(entry.Value); + set.Reattach(this, "EducationOrganizationInstitutionTelephones"); } - } + + foreach (var item in _educationOrganizationInstitutionTelephones) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- - return hashCode.ToHashCode(); + return _educationOrganizationInstitutionTelephones; + } + set + { + _educationOrganizationInstitutionTelephones = value; + _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + } } - #endregion - bool ISynchronizable.Synchronize(object target) + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones { - return this.SynchronizeTo((Entities.Common.EdFi.IAcademicSubjectDescriptor)target); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationInstitutionTelephones) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationInstitutionTelephonesCovariant; + } + set + { + EducationOrganizationInstitutionTelephones = new HashSet(value.Cast()); + } } - void IMappable.Map(object target) + + private ICollection _educationOrganizationInternationalAddresses; + private ICollection _educationOrganizationInternationalAddressesCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationInternationalAddresses { - this.MapTo((Entities.Common.EdFi.IAcademicSubjectDescriptor) target, null); + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationInternationalAddresses is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationOrganizationInternationalAddresses"); + } + + foreach (var item in _educationOrganizationInternationalAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationInternationalAddresses; + } + set + { + _educationOrganizationInternationalAddresses = value; + _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } } - } -} -// Aggregate: AcademicWeek + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationInternationalAddresses) + if (item.EducationOrganization == null) + item.EducationOrganization = this; + // ------------------------------------------------------------- + + return _educationOrganizationInternationalAddressesCovariant; + } + set + { + EducationOrganizationInternationalAddresses = new HashSet(value.Cast()); + } + } -namespace EdFi.Ods.Entities.NHibernate.AcademicWeekAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class AcademicWeekReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long SchoolId { get; set; } - public virtual string WeekIdentifier { get; set; } // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + }; - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -590,8 +752,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("WeekIdentifier", WeekIdentifier); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -612,8 +773,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -630,31 +801,39 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AcademicWeek table of the AcademicWeek aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationAddress table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AcademicWeek : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAcademicWeek, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationOrganizationAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AcademicWeek() + public EducationOrganizationAddress() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + EducationOrganizationAddressPeriods = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -662,10 +841,98 @@ public AcademicWeek() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationAddress.EducationOrganization + { + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } + } + [DomainSignature] - public virtual long SchoolId { get; set; } + [Key(1)] + public virtual int AddressTypeDescriptorId + { + get + { + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + + return _addressTypeDescriptorId; + } + set + { + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; + } + } + + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; + + [IgnoreMember] + public virtual string AddressTypeDescriptor + { + get + { + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + + return _addressTypeDescriptor; + } + set + { + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); + } + } [DomainSignature] - public virtual string WeekIdentifier { get; set; } + [Key(2)] + public virtual string City { get; set; } + [DomainSignature] + [Key(3)] + public virtual string PostalCode { get; set; } + [DomainSignature] + [Key(4)] + public virtual int StateAbbreviationDescriptorId + { + get + { + if (_stateAbbreviationDescriptorId == default(int)) + _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); + + return _stateAbbreviationDescriptorId; + } + set + { + _stateAbbreviationDescriptorId = value; + _stateAbbreviationDescriptor = null; + } + } + + private int _stateAbbreviationDescriptorId; + private string _stateAbbreviationDescriptor; + + [IgnoreMember] + public virtual string StateAbbreviationDescriptor + { + get + { + if (_stateAbbreviationDescriptor == null) + _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); + + return _stateAbbreviationDescriptor; + } + set + { + _stateAbbreviationDescriptor = value; + _stateAbbreviationDescriptorId = default(int); + } + } + [DomainSignature] + [Key(5)] + public virtual string StreetNumberName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -676,25 +943,58 @@ public AcademicWeek() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime BeginDate + [Key(6)] + public virtual string ApartmentRoomSuiteNumber { get; set; } + [Key(7)] + public virtual string BuildingSiteNumber { get; set; } + [Key(8)] + public virtual string CongressionalDistrict { get; set; } + [Key(9)] + public virtual string CountyFIPSCode { get; set; } + [Key(10)] + public virtual bool? DoNotPublishIndicator { get; set; } + [Key(11)] + public virtual string Latitude { get; set; } + [Key(12)] + public virtual int? LocaleDescriptorId { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_localeDescriptorId == default(int?)) + _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); + + return _localeDescriptorId; + } + set + { + _localeDescriptorId = value; + _localeDescriptor = null; + } } - private DateTime _beginDate; - - public virtual DateTime EndDate + private int? _localeDescriptorId; + private string _localeDescriptor; + + [IgnoreMember] + public virtual string LocaleDescriptor { - get { return _endDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _endDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_localeDescriptor == null) + _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); + + return _localeDescriptor; + } + set + { + _localeDescriptor = value; + _localeDescriptorId = default(int?); + } } - - private DateTime _endDate; - - public virtual int TotalInstructionalDays { get; set; } + [Key(13)] + public virtual string Longitude { get; set; } + [Key(14)] + public virtual string NameOfCounty { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -707,14 +1007,27 @@ public virtual DateTime EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationAddress")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -733,33 +1046,119 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationAddress")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAcademicWeek.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _educationOrganizationAddressPeriods; + private ICollection _educationOrganizationAddressPeriodsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationAddressPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationAddressPeriods is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationOrganizationAddressPeriods"); + } + + foreach (var item in _educationOrganizationAddressPeriods) + if (item.EducationOrganizationAddress == null) + item.EducationOrganizationAddress = this; + // ------------------------------------------------------------- + + return _educationOrganizationAddressPeriods; + } + set + { + _educationOrganizationAddressPeriods = value; + _educationOrganizationAddressPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganizationAddress.EducationOrganizationAddressPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationAddressPeriods) + if (item.EducationOrganizationAddress == null) + item.EducationOrganizationAddress = this; + // ------------------------------------------------------------- + + return _educationOrganizationAddressPeriodsCovariant; + } + set + { + EducationOrganizationAddressPeriods = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -770,12 +1169,15 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("WeekIdentifier", WeekIdentifier); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("City", City); + keyValues.Add("PostalCode", PostalCode); + keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); + keyValues.Add("StreetNumberName", StreetNumberName); return keyValues; } @@ -839,82 +1241,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAcademicWeek)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAcademicWeek) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddress) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: AccommodationDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AccommodationDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AccommodationDescriptor table of the AccommodationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationAddressPeriod table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AccommodationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAccommodationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class EducationOrganizationAddressPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationAddressPeriod() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual EducationOrganizationAddress EducationOrganizationAddress { get; set; } + + Entities.Common.EdFi.IEducationOrganizationAddress IEducationOrganizationAddressPeriod.EducationOrganizationAddress + { + get { return EducationOrganizationAddress; } + set { EducationOrganizationAddress = (EducationOrganizationAddress) value; } + } + [DomainSignature] - public virtual int AccommodationDescriptorId + [Key(1)] + public virtual DateTime BeginDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _beginDate; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual DateTime? EndDate { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -925,6 +1339,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationAddressPeriod")] + [Key(3)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationAddressPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -940,6 +1436,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -950,11 +1448,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganizationAddress as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -1018,117 +1516,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAccommodationDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAccommodationDescriptor) target, null); - } - - } -} -// Aggregate: AccountabilityRating - -namespace EdFi.Ods.Entities.NHibernate.AccountabilityRatingAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class AccountabilityRatingReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual string RatingTitle { get; set; } - public virtual short SchoolYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("RatingTitle", RatingTitle); - keyValues.Add("SchoolYear", SchoolYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + EducationOrganizationAddress = (EducationOrganizationAddress) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AccountabilityRating table of the AccountabilityRating aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationCategory table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AccountabilityRating : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAccountabilityRating, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationOrganizationCategory : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AccountabilityRating() + public EducationOrganizationCategory() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -1136,12 +1554,52 @@ public AccountabilityRating() // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationCategory.EducationOrganization + { + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } + } + [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string RatingTitle { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } + [Key(1)] + public virtual int EducationOrganizationCategoryDescriptorId + { + get + { + if (_educationOrganizationCategoryDescriptorId == default(int)) + _educationOrganizationCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptor); + + return _educationOrganizationCategoryDescriptorId; + } + set + { + _educationOrganizationCategoryDescriptorId = value; + _educationOrganizationCategoryDescriptor = null; + } + } + + private int _educationOrganizationCategoryDescriptorId; + private string _educationOrganizationCategoryDescriptor; + + [IgnoreMember] + public virtual string EducationOrganizationCategoryDescriptor + { + get + { + if (_educationOrganizationCategoryDescriptor == null) + _educationOrganizationCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptorId); + + return _educationOrganizationCategoryDescriptor; + } + set + { + _educationOrganizationCategoryDescriptor = value; + _educationOrganizationCategoryDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -1152,28 +1610,6 @@ public AccountabilityRating() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string Rating { get; set; } - public virtual DateTime? RatingDate - { - get { return _ratingDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _ratingDate = null; - } else - { - var given = (DateTime) value; - _ratingDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _ratingDate; - - public virtual string RatingOrganization { get; set; } - public virtual string RatingProgram { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -1186,14 +1622,27 @@ public virtual DateTime? RatingDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationCategory")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -1212,43 +1661,52 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationCategory")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAccountabilityRating.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAccountabilityRating.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } + _aggregateExtensions = value; + } } - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } - - /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAccountabilityRating.SchoolYearTypeResourceId - { - get { return SchoolYearTypeReferenceData?.Id; } - set { } - } + // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- // ------------------------------------------------------------- //============================================================= @@ -1259,6 +1717,7 @@ string Entities.Common.EdFi.IAccountabilityRating.EducationOrganizationDiscrimin // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "EducationOrganizationCategoryDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationCategoryDescriptorId", LookupTypeName = "EducationOrganizationCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -1269,13 +1728,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("RatingTitle", RatingTitle); - keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("EducationOrganizationCategoryDescriptorId", EducationOrganizationCategoryDescriptorId); return keyValues; } @@ -1339,82 +1796,102 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAccountabilityRating)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationCategory)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAccountabilityRating) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationCategory) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: AccountTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AccountTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AccountTypeDescriptor table of the AccountTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationIdentificationCode table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AccountTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAccountTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class EducationOrganizationIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int AccountTypeDescriptorId + public EducationOrganizationIdentificationCode() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIdentificationCode.EducationOrganization { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int EducationOrganizationIdentificationSystemDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_educationOrganizationIdentificationSystemDescriptorId == default(int)) + _educationOrganizationIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptor); + + return _educationOrganizationIdentificationSystemDescriptorId; + } + set + { + _educationOrganizationIdentificationSystemDescriptorId = value; + _educationOrganizationIdentificationSystemDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _educationOrganizationIdentificationSystemDescriptorId; + private string _educationOrganizationIdentificationSystemDescriptor; + + [IgnoreMember] + public virtual string EducationOrganizationIdentificationSystemDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_educationOrganizationIdentificationSystemDescriptor == null) + _educationOrganizationIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptorId); + + return _educationOrganizationIdentificationSystemDescriptor; + } + set + { + _educationOrganizationIdentificationSystemDescriptor = value; + _educationOrganizationIdentificationSystemDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -1425,6 +1902,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationIdentificationCode")] + [Key(3)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationIdentificationCode")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -1440,6 +1999,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "EducationOrganizationIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationIdentificationSystemDescriptorId", LookupTypeName = "EducationOrganizationIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -1450,11 +2010,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AccountTypeDescriptorId", AccountTypeDescriptorId); + keyValues.Add("EducationOrganizationIdentificationSystemDescriptorId", EducationOrganizationIdentificationSystemDescriptorId); return keyValues; } @@ -1518,82 +2078,177 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAccountTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAccountTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: AchievementCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AchievementCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AchievementCategoryDescriptor table of the AchievementCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationIndicator table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AchievementCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAchievementCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class EducationOrganizationIndicator : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationIndicator, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationIndicator() + { + EducationOrganizationIndicatorPeriods = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIndicator.EducationOrganization + { + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } + } + [DomainSignature] - public virtual int AchievementCategoryDescriptorId + [Key(1)] + public virtual int IndicatorDescriptorId { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get + { + if (_indicatorDescriptorId == default(int)) + _indicatorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorDescriptor", _indicatorDescriptor); + + return _indicatorDescriptorId; + } + set + { + _indicatorDescriptorId = value; + _indicatorDescriptor = null; + } + } + + private int _indicatorDescriptorId; + private string _indicatorDescriptor; + + [IgnoreMember] + public virtual string IndicatorDescriptor + { + get + { + if (_indicatorDescriptor == null) + _indicatorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorDescriptor", _indicatorDescriptorId); + + return _indicatorDescriptor; + } + set + { + _indicatorDescriptor = value; + _indicatorDescriptorId = default(int); + } } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual string DesignatedBy { get; set; } + [Key(3)] + public virtual int? IndicatorGroupDescriptorId { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_indicatorGroupDescriptorId == default(int?)) + _indicatorGroupDescriptorId = string.IsNullOrWhiteSpace(_indicatorGroupDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorGroupDescriptor", _indicatorGroupDescriptor); + + return _indicatorGroupDescriptorId; + } + set + { + _indicatorGroupDescriptorId = value; + _indicatorGroupDescriptor = null; + } } - DateTime? IDescriptor.EffectiveEndDate + + private int? _indicatorGroupDescriptorId; + private string _indicatorGroupDescriptor; + + [IgnoreMember] + public virtual string IndicatorGroupDescriptor { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_indicatorGroupDescriptor == null) + _indicatorGroupDescriptor = _indicatorGroupDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorGroupDescriptor", _indicatorGroupDescriptorId.Value); + + return _indicatorGroupDescriptor; + } + set + { + _indicatorGroupDescriptor = value; + _indicatorGroupDescriptorId = default(int?); + } } - string IDescriptor.Namespace + [Key(4)] + public virtual int? IndicatorLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_indicatorLevelDescriptorId == default(int?)) + _indicatorLevelDescriptorId = string.IsNullOrWhiteSpace(_indicatorLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorLevelDescriptor", _indicatorLevelDescriptor); + + return _indicatorLevelDescriptorId; + } + set + { + _indicatorLevelDescriptorId = value; + _indicatorLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int? _indicatorLevelDescriptorId; + private string _indicatorLevelDescriptor; + + [IgnoreMember] + public virtual string IndicatorLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_indicatorLevelDescriptor == null) + _indicatorLevelDescriptor = _indicatorLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorLevelDescriptor", _indicatorLevelDescriptorId.Value); + + return _indicatorLevelDescriptor; + } + set + { + _indicatorLevelDescriptor = value; + _indicatorLevelDescriptorId = default(int?); + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- + [Key(5)] + public virtual string IndicatorValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -1604,6 +2259,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationIndicator")] + [Key(6)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationIndicator")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -1614,11 +2351,68 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _educationOrganizationIndicatorPeriods; + private ICollection _educationOrganizationIndicatorPeriodsCovariant; + [Key(8)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationOrganizationIndicatorPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationOrganizationIndicatorPeriods is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationOrganizationIndicatorPeriods"); + } + + foreach (var item in _educationOrganizationIndicatorPeriods) + if (item.EducationOrganizationIndicator == null) + item.EducationOrganizationIndicator = this; + // ------------------------------------------------------------- + + return _educationOrganizationIndicatorPeriods; + } + set + { + _educationOrganizationIndicatorPeriods = value; + _educationOrganizationIndicatorPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationOrganizationIndicator.EducationOrganizationIndicatorPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationOrganizationIndicatorPeriods) + if (item.EducationOrganizationIndicator == null) + item.EducationOrganizationIndicator = this; + // ------------------------------------------------------------- + + return _educationOrganizationIndicatorPeriodsCovariant; + } + set + { + EducationOrganizationIndicatorPeriods = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, + { "IndicatorGroupDescriptor", new LookupColumnDetails { PropertyName = "IndicatorGroupDescriptorId", LookupTypeName = "IndicatorGroupDescriptor"} }, + { "IndicatorLevelDescriptor", new LookupColumnDetails { PropertyName = "IndicatorLevelDescriptorId", LookupTypeName = "IndicatorLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -1629,11 +2423,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AchievementCategoryDescriptorId", AchievementCategoryDescriptorId); + keyValues.Add("IndicatorDescriptorId", IndicatorDescriptorId); return keyValues; } @@ -1697,82 +2491,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAchievementCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicator)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAchievementCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicator) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: AdditionalCreditTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AdditionalCreditTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AdditionalCreditTypeDescriptor table of the AdditionalCreditTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationIndicatorPeriod table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AdditionalCreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAdditionalCreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class EducationOrganizationIndicatorPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationIndicatorPeriod() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual EducationOrganizationIndicator EducationOrganizationIndicator { get; set; } + + Entities.Common.EdFi.IEducationOrganizationIndicator IEducationOrganizationIndicatorPeriod.EducationOrganizationIndicator + { + get { return EducationOrganizationIndicator; } + set { EducationOrganizationIndicator = (EducationOrganizationIndicator) value; } + } + [DomainSignature] - public virtual int AdditionalCreditTypeDescriptorId + [Key(1)] + public virtual DateTime BeginDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _beginDate; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -1783,6 +2589,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationIndicatorPeriod")] + [Key(3)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationIndicatorPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -1798,6 +2686,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -1808,11 +2697,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganizationIndicator as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AdditionalCreditTypeDescriptorId", AdditionalCreditTypeDescriptorId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -1876,92 +2765,194 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAdditionalCreditTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAdditionalCreditTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganizationIndicator = (EducationOrganizationIndicator) value; + } } -} -// Aggregate: AddressTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AddressTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AddressTypeDescriptor table of the AddressTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationInstitutionTelephone table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AddressTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAddressTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class EducationOrganizationInstitutionTelephone : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int AddressTypeDescriptorId + public EducationOrganizationInstitutionTelephone() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace + [DomainSignature, IgnoreMember] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInstitutionTelephone.EducationOrganization { - get { return Namespace; } - set { Namespace = value; } + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } } - string IDescriptor.ShortDescription + + [DomainSignature] + [Key(1)] + public virtual int InstitutionTelephoneNumberTypeDescriptorId { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_institutionTelephoneNumberTypeDescriptorId == default(int)) + _institutionTelephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptor); + + return _institutionTelephoneNumberTypeDescriptorId; + } + set + { + _institutionTelephoneNumberTypeDescriptorId = value; + _institutionTelephoneNumberTypeDescriptor = null; + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private int _institutionTelephoneNumberTypeDescriptorId; + private string _institutionTelephoneNumberTypeDescriptor; - // ============================================================= - // One-to-one relationships + [IgnoreMember] + public virtual string InstitutionTelephoneNumberTypeDescriptor + { + get + { + if (_institutionTelephoneNumberTypeDescriptor == null) + _institutionTelephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptorId); + + return _institutionTelephoneNumberTypeDescriptor; + } + set + { + _institutionTelephoneNumberTypeDescriptor = value; + _institutionTelephoneNumberTypeDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual string TelephoneNumber { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationInstitutionTelephone")] + [Key(3)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationInstitutionTelephone")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -1977,6 +2968,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "InstitutionTelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "InstitutionTelephoneNumberTypeDescriptorId", LookupTypeName = "InstitutionTelephoneNumberTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -1987,11 +2979,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("InstitutionTelephoneNumberTypeDescriptorId", InstitutionTelephoneNumberTypeDescriptorId); return keyValues; } @@ -2055,82 +3047,188 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAddressTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAddressTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } -} -// Aggregate: AdministrationEnvironmentDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AdministrationEnvironmentDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AdministrationEnvironmentDescriptor table of the AdministrationEnvironmentDescriptor aggregate in the ODS database. + /// A class which represents the edfi.EducationOrganizationInternationalAddress table of the EducationOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AdministrationEnvironmentDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAdministrationEnvironmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class EducationOrganizationInternationalAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationOrganizationInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public EducationOrganizationInternationalAddress() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual EducationOrganization EducationOrganization { get; set; } + + Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInternationalAddress.EducationOrganization + { + get { return EducationOrganization; } + set { EducationOrganization = (EducationOrganization) value; } + } + [DomainSignature] - public virtual int AdministrationEnvironmentDescriptorId + [Key(1)] + public virtual int AddressTypeDescriptorId { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get + { + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + + return _addressTypeDescriptorId; + } + set + { + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; + } + } + + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; + + [IgnoreMember] + public virtual string AddressTypeDescriptor + { + get + { + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + + return _addressTypeDescriptor; + } + set + { + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); + } } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual string AddressLine1 { get; set; } + [Key(3)] + public virtual string AddressLine2 { get; set; } + [Key(4)] + public virtual string AddressLine3 { get; set; } + [Key(5)] + public virtual string AddressLine4 { get; set; } + [Key(6)] + public virtual DateTime? BeginDate { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - DateTime? IDescriptor.EffectiveEndDate + + private DateTime? _beginDate; + + [Key(7)] + public virtual int CountryDescriptorId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_countryDescriptorId == default(int)) + _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); + + return _countryDescriptorId; + } + set + { + _countryDescriptorId = value; + _countryDescriptor = null; + } } - string IDescriptor.Namespace + + private int _countryDescriptorId; + private string _countryDescriptor; + + [IgnoreMember] + public virtual string CountryDescriptor { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_countryDescriptor == null) + _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); + + return _countryDescriptor; + } + set + { + _countryDescriptor = value; + _countryDescriptorId = default(int); + } } - string IDescriptor.ShortDescription + [Key(8)] + public virtual DateTime? EndDate { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + private DateTime? _endDate; + + [Key(9)] + public virtual string Latitude { get; set; } + [Key(10)] + public virtual string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -2141,6 +3239,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationInternationalAddress")] + [Key(11)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganization", "EducationOrganizationInternationalAddress")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -2156,6 +3336,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -2166,11 +3348,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (EducationOrganization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AdministrationEnvironmentDescriptorId", AdministrationEnvironmentDescriptorId); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); return keyValues; } @@ -2234,82 +3416,663 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAdministrationEnvironmentDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAdministrationEnvironmentDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress) target, null); } + void IChildEntity.SetParent(object value) + { + EducationOrganization = (EducationOrganization) value; + } } } -// Aggregate: AdministrativeFundingControlDescriptor +// Aggregate: GeneralStudentProgramAssociation -namespace EdFi.Ods.Entities.NHibernate.AdministrativeFundingControlDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.GeneralStudentProgramAssociationAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class GeneralStudentProgramAssociationReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual DateTime BeginDate { get; set; } + [Key(1)] + public virtual long EducationOrganizationId { get; set; } + [Key(2)] + public virtual long ProgramEducationOrganizationId { get; set; } + [Key(3)] + public virtual string ProgramName { get; set; } + [Key(4)] + public virtual int ProgramTypeDescriptorId { get; set; } + [Key(5)] + public virtual int StudentUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(6)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(7)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AdministrativeFundingControlDescriptor table of the AdministrativeFundingControlDescriptor aggregate in the ODS database. + /// A class which represents the edfi.GeneralStudentProgramAssociation table of the GeneralStudentProgramAssociation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AdministrativeFundingControlDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAdministrativeFundingControlDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class GeneralStudentProgramAssociation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap { + public virtual void SuspendReferenceAssignmentCheck() { } + + public GeneralStudentProgramAssociation() + { + GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int AdministrativeFundingControlDescriptorId + [Key(6)] + public virtual DateTime BeginDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _beginDate; + [Key(7)] + public virtual long EducationOrganizationId { get; set; } + [Key(8)] + public virtual long ProgramEducationOrganizationId { get; set; } + [Key(9)] + public virtual string ProgramName { get; set; } + [Key(10)] + public virtual int ProgramTypeDescriptorId + { + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } + } + + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + [IgnoreMember] + public virtual string ProgramTypeDescriptor + { + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } + } + [Key(11)] + public virtual int StudentUSI + { + get + { + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } + + return _studentUSI; + } + set + { + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } + + private int _studentUSI; + private string _studentUniqueId; + + [IgnoreMember] + public virtual string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(12)] + public virtual DateTime? EndDate { - get { return CodeValue; } - set { CodeValue = value; } + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - string IDescriptor.Description + + private DateTime? _endDate; + + [Key(13)] + public virtual int? ReasonExitedDescriptorId { - get { return Description; } - set { Description = value; } + get + { + if (_reasonExitedDescriptorId == default(int?)) + _reasonExitedDescriptorId = string.IsNullOrWhiteSpace(_reasonExitedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReasonExitedDescriptor", _reasonExitedDescriptor); + + return _reasonExitedDescriptorId; + } + set + { + _reasonExitedDescriptorId = value; + _reasonExitedDescriptor = null; + } } - DateTime? IDescriptor.EffectiveBeginDate + + private int? _reasonExitedDescriptorId; + private string _reasonExitedDescriptor; + + [IgnoreMember] + public virtual string ReasonExitedDescriptor { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get + { + if (_reasonExitedDescriptor == null) + _reasonExitedDescriptor = _reasonExitedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReasonExitedDescriptor", _reasonExitedDescriptorId.Value); + + return _reasonExitedDescriptor; + } + set + { + _reasonExitedDescriptor = value; + _reasonExitedDescriptorId = default(int?); + } } - DateTime? IDescriptor.EffectiveEndDate + [Key(14)] + public virtual bool? ServedOutsideOfRegularSession { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(15)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationDiscriminator { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } } - string IDescriptor.Namespace + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationResourceId { - get { return Namespace; } - set { Namespace = value; } + get { return EducationOrganizationReferenceData?.Id; } + set { } } - string IDescriptor.ShortDescription + + [Key(16)] + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramDiscriminator { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } + set { } + } + + [Key(17)] + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentResourceId + { + get { return StudentReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _generalStudentProgramAssociationProgramParticipationStatuses; + private ICollection _generalStudentProgramAssociationProgramParticipationStatusesCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection GeneralStudentProgramAssociationProgramParticipationStatuses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_generalStudentProgramAssociationProgramParticipationStatuses is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "GeneralStudentProgramAssociationProgramParticipationStatuses"); + } + + foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) + if (item.GeneralStudentProgramAssociation == null) + item.GeneralStudentProgramAssociation = this; + // ------------------------------------------------------------- + + return _generalStudentProgramAssociationProgramParticipationStatuses; + } + set + { + _generalStudentProgramAssociationProgramParticipationStatuses = value; + _generalStudentProgramAssociationProgramParticipationStatusesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IGeneralStudentProgramAssociation.GeneralStudentProgramAssociationProgramParticipationStatuses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) + if (item.GeneralStudentProgramAssociation == null) + item.GeneralStudentProgramAssociation = this; + // ------------------------------------------------------------- + + return _generalStudentProgramAssociationProgramParticipationStatusesCovariant; + } + set + { + GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "ReasonExitedDescriptor", new LookupColumnDetails { PropertyName = "ReasonExitedDescriptorId", LookupTypeName = "ReasonExitedDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("StudentUSI", StudentUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.GeneralStudentProgramAssociationProgramParticipationStatus table of the GeneralStudentProgramAssociation aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class GeneralStudentProgramAssociationProgramParticipationStatus : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public GeneralStudentProgramAssociationProgramParticipationStatus() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual GeneralStudentProgramAssociation GeneralStudentProgramAssociation { get; set; } + + Entities.Common.EdFi.IGeneralStudentProgramAssociation IGeneralStudentProgramAssociationProgramParticipationStatus.GeneralStudentProgramAssociation + { + get { return GeneralStudentProgramAssociation; } + set { GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; } + } + + [DomainSignature] + [Key(1)] + public virtual int ParticipationStatusDescriptorId + { + get + { + if (_participationStatusDescriptorId == default(int)) + _participationStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ParticipationStatusDescriptor", _participationStatusDescriptor); + + return _participationStatusDescriptorId; + } + set + { + _participationStatusDescriptorId = value; + _participationStatusDescriptor = null; + } + } + + private int _participationStatusDescriptorId; + private string _participationStatusDescriptor; + + [IgnoreMember] + public virtual string ParticipationStatusDescriptor + { + get + { + if (_participationStatusDescriptor == null) + _participationStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ParticipationStatusDescriptor", _participationStatusDescriptorId); + + return _participationStatusDescriptor; + } + set + { + _participationStatusDescriptor = value; + _participationStatusDescriptorId = default(int); + } + } + [DomainSignature] + [Key(2)] + public virtual DateTime StatusBeginDate + { + get { return _statusBeginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _statusBeginDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _statusBeginDate; + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] + public virtual string DesignatedBy { get; set; } + [Key(4)] + public virtual DateTime? StatusEndDate + { + get { return _statusEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _statusEndDate = null; + } else + { + var given = (DateTime) value; + _statusEndDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _statusEndDate; + // ------------------------------------------------------------- // ============================================================= @@ -2320,6 +4083,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GeneralStudentProgramAssociation", "GeneralStudentProgramAssociationProgramParticipationStatus")] + [Key(5)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GeneralStudentProgramAssociation", "GeneralStudentProgramAssociationProgramParticipationStatus")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -2335,6 +4180,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ParticipationStatusDescriptor", new LookupColumnDetails { PropertyName = "ParticipationStatusDescriptorId", LookupTypeName = "ParticipationStatusDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -2345,11 +4192,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (GeneralStudentProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AdministrativeFundingControlDescriptorId", AdministrativeFundingControlDescriptorId); + keyValues.Add("ParticipationStatusDescriptorId", ParticipationStatusDescriptorId); + keyValues.Add("StatusBeginDate", StatusBeginDate); return keyValues; } @@ -2413,37 +4261,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAdministrativeFundingControlDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAdministrativeFundingControlDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus) target, null); } + void IChildEntity.SetParent(object value) + { + GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; + } } } -// Aggregate: AncestryEthnicOriginDescriptor +// Aggregate: AbsenceEventCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.AncestryEthnicOriginDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AbsenceEventCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AncestryEthnicOriginDescriptor table of the AncestryEthnicOriginDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AbsenceEventCategoryDescriptor table of the AbsenceEventCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AncestryEthnicOriginDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAncestryEthnicOriginDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AbsenceEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAbsenceEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AncestryEthnicOriginDescriptorId + [IgnoreMember] + public virtual int AbsenceEventCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -2528,7 +4382,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AncestryEthnicOriginDescriptorId", AncestryEthnicOriginDescriptorId); + keyValues.Add("AbsenceEventCategoryDescriptorId", AbsenceEventCategoryDescriptorId); return keyValues; } @@ -2592,41 +4446,408 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAncestryEthnicOriginDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAbsenceEventCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAncestryEthnicOriginDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAbsenceEventCategoryDescriptor) target, null); } } } -// Aggregate: Assessment +// Aggregate: AcademicHonorCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.AssessmentAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AcademicHonorCategoryDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AcademicHonorCategoryDescriptor table of the AcademicHonorCategoryDescriptor aggregate in the ODS database. /// - public class AssessmentReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AcademicHonorCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAcademicHonorCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AssessmentIdentifier { get; set; } - public virtual string Namespace { get; set; } + [DomainSignature] + [IgnoreMember] + public virtual int AcademicHonorCategoryDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AcademicHonorCategoryDescriptorId", AcademicHonorCategoryDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAcademicHonorCategoryDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAcademicHonorCategoryDescriptor) target, null); + } + + } +} +// Aggregate: AcademicSubjectDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AcademicSubjectDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AcademicSubjectDescriptor table of the AcademicSubjectDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AcademicSubjectDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAcademicSubjectDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int AcademicSubjectDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAcademicSubjectDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAcademicSubjectDescriptor) target, null); + } + + } +} +// Aggregate: AcademicWeek + +namespace EdFi.Ods.Entities.NHibernate.AcademicWeekAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class AcademicWeekReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual long SchoolId { get; set; } + [Key(1)] + public virtual string WeekIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -2636,8 +4857,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("Namespace", Namespace); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("WeekIdentifier", WeekIdentifier); return keyValues; } @@ -2688,30 +4909,20 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Assessment table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AcademicWeek table of the AcademicWeek aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Assessment : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AcademicWeek : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAcademicWeek, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Assessment() + public AcademicWeek() { - AssessmentContentStandardPersistentList = new HashSet(); - AssessmentAcademicSubjects = new HashSet(); - AssessmentAssessedGradeLevels = new HashSet(); - AssessmentIdentificationCodes = new HashSet(); - AssessmentLanguages = new HashSet(); - AssessmentPerformanceLevels = new HashSet(); - AssessmentPeriods = new HashSet(); - AssessmentPlatformTypes = new HashSet(); - AssessmentPrograms = new HashSet(); - AssessmentScores = new HashSet(); - AssessmentSections = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -2720,9 +4931,11 @@ public Assessment() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string AssessmentIdentifier { get; set; } + [Key(6)] + public virtual long SchoolId { get; set; } [DomainSignature] - public virtual string Namespace { get; set; } + [Key(7)] + public virtual string WeekIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -2733,130 +4946,582 @@ public Assessment() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool? AdaptiveAssessment { get; set; } - public virtual int? AssessmentCategoryDescriptorId + [Key(8)] + public virtual DateTime BeginDate { - get + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _beginDate; + + [Key(9)] + public virtual DateTime EndDate + { + get { return _endDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _endDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _endDate; + + [Key(10)] + public virtual int TotalInstructionalDays { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AcademicWeek", "AcademicWeek")] + [Key(11)] + public IDictionary Extensions + { + get { - if (_assessmentCategoryDescriptorId == default(int?)) - _assessmentCategoryDescriptorId = string.IsNullOrWhiteSpace(_assessmentCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentCategoryDescriptor", _assessmentCategoryDescriptor); + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } - return _assessmentCategoryDescriptorId; - } + return _extensions; + } set { - _assessmentCategoryDescriptorId = value; - _assessmentCategoryDescriptor = null; + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; } } - private int? _assessmentCategoryDescriptorId; - private string _assessmentCategoryDescriptor; + private IDictionary _aggregateExtensions; - public virtual string AssessmentCategoryDescriptor - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AcademicWeek", "AcademicWeek")] + [Key(12)] + public IDictionary AggregateExtensions + { get { - if (_assessmentCategoryDescriptor == null) - _assessmentCategoryDescriptor = _assessmentCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentCategoryDescriptor", _assessmentCategoryDescriptorId.Value); - - return _assessmentCategoryDescriptor; + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; } set { - _assessmentCategoryDescriptor = value; - _assessmentCategoryDescriptorId = default(int?); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - public virtual string AssessmentFamily { get; set; } - public virtual string AssessmentForm { get; set; } - public virtual string AssessmentTitle { get; set; } - public virtual int? AssessmentVersion { get; set; } - public virtual long? EducationOrganizationId { get; set; } - public virtual decimal? MaxRawScore { get; set; } - public virtual string Nomenclature { get; set; } - public virtual DateTime? RevisionDate + + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(13)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAcademicWeek.SchoolResourceId { - get { return _revisionDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) + get { return SchoolReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("WeekIdentifier", WeekIdentifier); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) { - _revisionDate = null; - } else + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else { - var given = (DateTime) value; - _revisionDate = new DateTime(given.Year, given.Month, given.Day); + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } } + + return true; } - private DateTime? _revisionDate; + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAcademicWeek)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAcademicWeek) target, null); + } + + } +} +// Aggregate: AccommodationDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AccommodationDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AccommodationDescriptor table of the AccommodationDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AccommodationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAccommodationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int AccommodationDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Inherited Properties // ------------------------------------------------------------- - public virtual Entities.NHibernate.AssessmentAggregate.EdFi.AssessmentContentStandard AssessmentContentStandard + string IDescriptor.CodeValue { - get - { - // Return the item in the list, if one exists - if (AssessmentContentStandardPersistentList.Any()) - return AssessmentContentStandardPersistentList.First(); + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - // No reference is present - return null; - } - set + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - // Delete the existing object - if (AssessmentContentStandardPersistentList.Any()) - AssessmentContentStandardPersistentList.Clear(); + }; - // If we're setting a value, add it to the list now - if (value != null) + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) { - // Set the back-reference to the parent - value.Assessment = this; + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } - AssessmentContentStandardPersistentList.Add(value); + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAccommodationDescriptor)target); } - Entities.Common.EdFi.IAssessmentContentStandard Entities.Common.EdFi.IAssessment.AssessmentContentStandard + void IMappable.Map(object target) { - get { return AssessmentContentStandard; } - set { AssessmentContentStandard = (Entities.NHibernate.AssessmentAggregate.EdFi.AssessmentContentStandard) value; } + this.MapTo((Entities.Common.EdFi.IAccommodationDescriptor) target, null); } - private ICollection _assessmentContentStandardPersistentList; + } +} +// Aggregate: AccountabilityRating - public virtual ICollection AssessmentContentStandardPersistentList +namespace EdFi.Ods.Entities.NHibernate.AccountabilityRatingAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class AccountabilityRatingReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual long EducationOrganizationId { get; set; } + [Key(1)] + public virtual string RatingTitle { get; set; } + [Key(2)] + public virtual short SchoolYear { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(3)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(4)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentContentStandardPersistentList) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - return _assessmentContentStandardPersistentList; + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("RatingTitle", RatingTitle); + keyValues.Add("SchoolYear", SchoolYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } - set + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - _assessmentContentStandardPersistentList = value; + hashCode.Add(entry.Value); } + + return hashCode.ToHashCode(); + } + #endregion + } + +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AccountabilityRating table of the AccountabilityRating aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AccountabilityRating : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAccountabilityRating, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AccountabilityRating() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [Key(6)] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + [Key(7)] + public virtual string RatingTitle { get; set; } + [DomainSignature] + [Key(8)] + public virtual short SchoolYear { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(9)] + public virtual string Rating { get; set; } + [Key(10)] + public virtual DateTime? RatingDate + { + get { return _ratingDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _ratingDate = null; + } else + { + var given = (DateTime) value; + _ratingDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _ratingDate; + + [Key(11)] + public virtual string RatingOrganization { get; set; } + [Key(12)] + public virtual string RatingProgram { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -2864,14 +5529,27 @@ public virtual ICollection _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -2890,18 +5568,59 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AccountabilityRating", "AccountabilityRating")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessment.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IAccountabilityRating.EducationOrganizationDiscriminator { get { return EducationOrganizationReferenceData?.Discriminator; } set { } @@ -2910,493 +5629,941 @@ string Entities.Common.EdFi.IAssessment.EducationOrganizationDiscriminator /// /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessment.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IAccountabilityRating.EducationOrganizationResourceId { get { return EducationOrganizationReferenceData?.Id; } set { } } + [Key(16)] + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAccountabilityRating.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + // ------------------------------------------------------------- - private ICollection _assessmentAcademicSubjects; - private ICollection _assessmentAcademicSubjectsCovariant; - public virtual ICollection AssessmentAcademicSubjects - { - get + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAcademicSubjects) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + }; - return _assessmentAcademicSubjects; - } - set - { - _assessmentAcademicSubjects = value; - _assessmentAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); - } + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentAcademicSubjects + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAcademicSubjects) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - return _assessmentAcademicSubjectsCovariant; - } - set - { - AssessmentAcademicSubjects = new HashSet(value.Cast()); - } - } + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("RatingTitle", RatingTitle); + keyValues.Add("SchoolYear", SchoolYear); + return keyValues; + } - private ICollection _assessmentAssessedGradeLevels; - private ICollection _assessmentAssessedGradeLevelsCovariant; - public virtual ICollection AssessmentAssessedGradeLevels + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAssessedGradeLevels) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _assessmentAssessedGradeLevels; - } - set + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _assessmentAssessedGradeLevels = value; - _assessmentAssessedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentAssessedGradeLevels + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAssessedGradeLevels) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _assessmentAssessedGradeLevelsCovariant; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - AssessmentAssessedGradeLevels = new HashSet(value.Cast()); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } - } + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAccountabilityRating)target); + } - private ICollection _assessmentIdentificationCodes; - private ICollection _assessmentIdentificationCodesCovariant; - public virtual ICollection AssessmentIdentificationCodes + void IMappable.Map(object target) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentIdentificationCodes) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + this.MapTo((Entities.Common.EdFi.IAccountabilityRating) target, null); + } - return _assessmentIdentificationCodes; - } - set - { - _assessmentIdentificationCodes = value; - _assessmentIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } + } +} +// Aggregate: AccountTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AccountTypeDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AccountTypeDescriptor table of the AccountTypeDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AccountTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAccountTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int AccountTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentIdentificationCodes + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentIdentificationCodes) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - return _assessmentIdentificationCodesCovariant; - } - set + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - AssessmentIdentificationCodes = new HashSet(value.Cast()); - } + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } } + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - private ICollection _assessmentLanguages; - private ICollection _assessmentLanguagesCovariant; - public virtual ICollection AssessmentLanguages + // Add current key values + keyValues.Add("AccountTypeDescriptorId", AccountTypeDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentLanguages) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _assessmentLanguages; - } - set + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _assessmentLanguages = value; - _assessmentLanguagesCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentLanguages + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentLanguages) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _assessmentLanguagesCovariant; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - AssessmentLanguages = new HashSet(value.Cast()); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAccountTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAccountTypeDescriptor) target, null); } + } +} +// Aggregate: AchievementCategoryDescriptor - private ICollection _assessmentPerformanceLevels; - private ICollection _assessmentPerformanceLevelsCovariant; - public virtual ICollection AssessmentPerformanceLevels +namespace EdFi.Ods.Entities.NHibernate.AchievementCategoryDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AchievementCategoryDescriptor table of the AchievementCategoryDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AchievementCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAchievementCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int AchievementCategoryDescriptorId { - get + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPerformanceLevels) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + }; - return _assessmentPerformanceLevels; - } - set + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AchievementCategoryDescriptorId", AchievementCategoryDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _assessmentPerformanceLevels = value; - _assessmentPerformanceLevelsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentPerformanceLevels + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPerformanceLevels) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _assessmentPerformanceLevelsCovariant; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - AssessmentPerformanceLevels = new HashSet(value.Cast()); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAchievementCategoryDescriptor)target); } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAchievementCategoryDescriptor) target, null); + } - private ICollection _assessmentPeriods; - private ICollection _assessmentPeriodsCovariant; - public virtual ICollection AssessmentPeriods + } +} +// Aggregate: AdditionalCreditTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AdditionalCreditTypeDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AdditionalCreditTypeDescriptor table of the AdditionalCreditTypeDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AdditionalCreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAdditionalCreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int AdditionalCreditTypeDescriptorId { - get + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPeriods) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + }; - return _assessmentPeriods; - } - set + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AdditionalCreditTypeDescriptorId", AdditionalCreditTypeDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _assessmentPeriods = value; - _assessmentPeriodsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentPeriods + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPeriods) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _assessmentPeriodsCovariant; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - AssessmentPeriods = new HashSet(value.Cast()); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IAdditionalCreditTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAdditionalCreditTypeDescriptor) target, null); + } + + } +} +// Aggregate: AddressTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AddressTypeDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.AddressTypeDescriptor table of the AddressTypeDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AddressTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAddressTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int AddressTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } - private ICollection _assessmentPlatformTypes; - private ICollection _assessmentPlatformTypesCovariant; - public virtual ICollection AssessmentPlatformTypes + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPlatformTypes) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - return _assessmentPlatformTypes; - } - set - { - _assessmentPlatformTypes = value; - _assessmentPlatformTypesCovariant = new CovariantCollectionAdapter(value); - } + // Add current key values + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + + return keyValues; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentPlatformTypes + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPlatformTypes) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _assessmentPlatformTypesCovariant; - } - set - { - AssessmentPlatformTypes = new HashSet(value.Cast()); - } - } + if (ReferenceEquals(this, compareTo)) + return true; + if (compareTo == null) + return false; - private ICollection _assessmentPrograms; - private ICollection _assessmentProgramsCovariant; - public virtual ICollection AssessmentPrograms - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPrograms) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); - return _assessmentPrograms; - } - set + foreach (DictionaryEntry entry in theseKeys) { - _assessmentPrograms = value; - _assessmentProgramsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentPrograms + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentPrograms) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- - - return _assessmentProgramsCovariant; - } - set - { - AssessmentPrograms = new HashSet(value.Cast()); - } - } + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + if (keyValues.Count == 0) + return base.GetHashCode(); - private ICollection _assessmentScores; - private ICollection _assessmentScoresCovariant; - public virtual ICollection AssessmentScores - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentScores) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + var hashCode = new HashCode(); - return _assessmentScores; - } - set + foreach (DictionaryEntry entry in keyValues) { - _assessmentScores = value; - _assessmentScoresCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentScores + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentScores) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + return this.SynchronizeTo((Entities.Common.EdFi.IAddressTypeDescriptor)target); + } - return _assessmentScoresCovariant; - } - set - { - AssessmentScores = new HashSet(value.Cast()); - } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IAddressTypeDescriptor) target, null); } + } +} +// Aggregate: AdministrationEnvironmentDescriptor - private ICollection _assessmentSections; - private ICollection _assessmentSectionsCovariant; - public virtual ICollection AssessmentSections - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentSections) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- +namespace EdFi.Ods.Entities.NHibernate.AdministrationEnvironmentDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 - return _assessmentSections; - } - set - { - _assessmentSections = value; - _assessmentSectionsCovariant = new CovariantCollectionAdapter(value); - } - } + /// + /// A class which represents the edfi.AdministrationEnvironmentDescriptor table of the AdministrationEnvironmentDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AdministrationEnvironmentDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAdministrationEnvironmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessment.AssessmentSections + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int AdministrationEnvironmentDescriptorId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentSections) - if (item.Assessment == null) - item.Assessment = this; - // ------------------------------------------------------------- + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- - return _assessmentSectionsCovariant; - } - set - { - AssessmentSections = new HashSet(value.Cast()); - } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentCategoryDescriptor", new LookupColumnDetails { PropertyName = "AssessmentCategoryDescriptorId", LookupTypeName = "AssessmentCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -3411,8 +6578,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("Namespace", Namespace); + keyValues.Add("AdministrationEnvironmentDescriptorId", AdministrationEnvironmentDescriptorId); return keyValues; } @@ -3476,88 +6642,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessment)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAdministrationEnvironmentDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessment) target, null); + this.MapTo((Entities.Common.EdFi.IAdministrationEnvironmentDescriptor) target, null); } } +} +// Aggregate: AdministrativeFundingControlDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AdministrativeFundingControlDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentAcademicSubject table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AdministrativeFundingControlDescriptor table of the AdministrativeFundingControlDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AdministrativeFundingControlDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAdministrativeFundingControlDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public AssessmentAcademicSubject() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Assessment Assessment { get; set; } - - Entities.Common.EdFi.IAssessment IAssessmentAcademicSubject.Assessment - { - get { return Assessment; } - set { Assessment = (Assessment) value; } - } - [DomainSignature] - public virtual int AcademicSubjectDescriptorId - { - get - { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } - } - - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor + [IgnoreMember] + public virtual int AdministrativeFundingControlDescriptorId { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -3573,35 +6730,6 @@ public virtual string AcademicSubjectDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -3617,7 +6745,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -3628,11 +6755,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("AdministrativeFundingControlDescriptorId", AdministrativeFundingControlDescriptorId); return keyValues; } @@ -3696,92 +6823,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAdministrativeFundingControlDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.IAdministrativeFundingControlDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Assessment = (Assessment) value; - } } +} +// Aggregate: AncestryEthnicOriginDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AncestryEthnicOriginDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentAssessedGradeLevel table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AncestryEthnicOriginDescriptor table of the AncestryEthnicOriginDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentAssessedGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentAssessedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AncestryEthnicOriginDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAncestryEthnicOriginDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public AssessmentAssessedGradeLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Assessment Assessment { get; set; } - - Entities.Common.EdFi.IAssessment IAssessmentAssessedGradeLevel.Assessment - { - get { return Assessment; } - set { Assessment = (Assessment) value; } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + [IgnoreMember] + public virtual int AncestryEthnicOriginDescriptorId { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -3797,35 +6911,6 @@ public virtual string GradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -3841,7 +6926,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -3852,11 +6936,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("AncestryEthnicOriginDescriptorId", AncestryEthnicOriginDescriptorId); return keyValues; } @@ -3920,37 +7004,132 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAssessedGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAncestryEthnicOriginDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentAssessedGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IAncestryEthnicOriginDescriptor) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: Assessment + +namespace EdFi.Ods.Entities.NHibernate.AssessmentAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class AssessmentReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual string AssessmentIdentifier { get; set; } + [Key(1)] + public virtual string Namespace { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(2)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(3)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - Assessment = (Assessment) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentContentStandard table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.Assessment table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentContentStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentContentStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class Assessment : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentContentStandard() + public Assessment() { - AssessmentContentStandardAuthors = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentContentStandardPersistentList = new HashSet(); + AssessmentAcademicSubjects = new HashSet(); + AssessmentAssessedGradeLevels = new HashSet(); + AssessmentIdentificationCodes = new HashSet(); + AssessmentLanguages = new HashSet(); + AssessmentPerformanceLevels = new HashSet(); + AssessmentPeriods = new HashSet(); + AssessmentPlatformTypes = new HashSet(); + AssessmentPrograms = new HashSet(); + AssessmentScores = new HashSet(); + AssessmentSections = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -3958,15 +7137,12 @@ public AssessmentContentStandard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Assessment Assessment { get; set; } - - Entities.Common.EdFi.IAssessment IAssessmentContentStandard.Assessment - { - get { return Assessment; } - set { Assessment = (Assessment) value; } - } - + [DomainSignature] + [Key(6)] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + [Key(7)] + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -3977,107 +7153,149 @@ Entities.Common.EdFi.IAssessment IAssessmentContentStandard.Assessment // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? BeginDate + [Key(8)] + public virtual bool? AdaptiveAssessment { get; set; } + [Key(9)] + public virtual int? AssessmentCategoryDescriptorId { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } + get + { + if (_assessmentCategoryDescriptorId == default(int?)) + _assessmentCategoryDescriptorId = string.IsNullOrWhiteSpace(_assessmentCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentCategoryDescriptor", _assessmentCategoryDescriptor); + + return _assessmentCategoryDescriptorId; + } + set + { + _assessmentCategoryDescriptorId = value; + _assessmentCategoryDescriptor = null; } } - private DateTime? _beginDate; - - public virtual DateTime? EndDate + private int? _assessmentCategoryDescriptorId; + private string _assessmentCategoryDescriptor; + + [IgnoreMember] + public virtual string AssessmentCategoryDescriptor { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } + get + { + if (_assessmentCategoryDescriptor == null) + _assessmentCategoryDescriptor = _assessmentCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentCategoryDescriptor", _assessmentCategoryDescriptorId.Value); + + return _assessmentCategoryDescriptor; + } + set + { + _assessmentCategoryDescriptor = value; + _assessmentCategoryDescriptorId = default(int?); } } - - private DateTime? _endDate; - - public virtual long? MandatingEducationOrganizationId { get; set; } - public virtual DateTime? PublicationDate + [Key(10)] + public virtual string AssessmentFamily { get; set; } + [Key(11)] + public virtual string AssessmentForm { get; set; } + [Key(12)] + public virtual string AssessmentTitle { get; set; } + [Key(13)] + public virtual int? AssessmentVersion { get; set; } + [Key(14)] + public virtual long? EducationOrganizationId { get; set; } + [Key(15)] + public virtual decimal? MaxRawScore { get; set; } + [Key(16)] + public virtual string Nomenclature { get; set; } + [Key(17)] + public virtual DateTime? RevisionDate { - get { return _publicationDate; } + get { return _revisionDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _publicationDate = null; + _revisionDate = null; } else { var given = (DateTime) value; - _publicationDate = new DateTime(given.Year, given.Month, given.Day); + _revisionDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _publicationDate; + private DateTime? _revisionDate; - public virtual int? PublicationStatusDescriptorId + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + [IgnoreMember] + public virtual Entities.NHibernate.AssessmentAggregate.EdFi.AssessmentContentStandard AssessmentContentStandard { get { - if (_publicationStatusDescriptorId == default(int?)) - _publicationStatusDescriptorId = string.IsNullOrWhiteSpace(_publicationStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PublicationStatusDescriptor", _publicationStatusDescriptor); + // Return the item in the list, if one exists + if (AssessmentContentStandardPersistentList.Any()) + return AssessmentContentStandardPersistentList.First(); - return _publicationStatusDescriptorId; - } + // No reference is present + return null; + } set { - _publicationStatusDescriptorId = value; - _publicationStatusDescriptor = null; + // Delete the existing object + if (AssessmentContentStandardPersistentList.Any()) + AssessmentContentStandardPersistentList.Clear(); + + // If we're setting a value, add it to the list now + if (value != null) + { + // Set the back-reference to the parent + value.Assessment = this; + + AssessmentContentStandardPersistentList.Add(value); + } } } - private int? _publicationStatusDescriptorId; - private string _publicationStatusDescriptor; + Entities.Common.EdFi.IAssessmentContentStandard Entities.Common.EdFi.IAssessment.AssessmentContentStandard + { + get { return AssessmentContentStandard; } + set { AssessmentContentStandard = (Entities.NHibernate.AssessmentAggregate.EdFi.AssessmentContentStandard) value; } + } - public virtual string PublicationStatusDescriptor + private ICollection _assessmentContentStandardPersistentList; + + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentContentStandardPersistentList { get { - if (_publicationStatusDescriptor == null) - _publicationStatusDescriptor = _publicationStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PublicationStatusDescriptor", _publicationStatusDescriptorId.Value); - - return _publicationStatusDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentContentStandardPersistentList is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentContentStandard"); + } + + foreach (var item in _assessmentContentStandardPersistentList) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentContentStandardPersistentList; } set { - _publicationStatusDescriptor = value; - _publicationStatusDescriptorId = default(int?); + _assessmentContentStandardPersistentList = value; } } - public virtual short? PublicationYear { get; set; } - public virtual string Title { get; set; } - public virtual string URI { get; set; } - public virtual string Version { get; set; } - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -4085,14 +7303,27 @@ public virtual string PublicationStatusDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "Assessment")] + [Key(19)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -4111,41 +7342,246 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "Assessment")] + [Key(20)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MandatingEducationOrganizationReferenceData { get; set; } + [Key(21)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the MandatingEducationOrganization discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentContentStandard.MandatingEducationOrganizationDiscriminator + string Entities.Common.EdFi.IAssessment.EducationOrganizationDiscriminator { - get { return MandatingEducationOrganizationReferenceData?.Discriminator; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the MandatingEducationOrganization resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentContentStandard.MandatingEducationOrganizationResourceId + Guid? Entities.Common.EdFi.IAssessment.EducationOrganizationResourceId { - get { return MandatingEducationOrganizationReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Id; } set { } } // ------------------------------------------------------------- - //============================================================= - // Collections - // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _assessmentAcademicSubjects; + private ICollection _assessmentAcademicSubjectsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentAcademicSubjects is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentAcademicSubjects"); + } + + foreach (var item in _assessmentAcademicSubjects) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentAcademicSubjects; + } + set + { + _assessmentAcademicSubjects = value; + _assessmentAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentAcademicSubjects + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentAcademicSubjects) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentAcademicSubjectsCovariant; + } + set + { + AssessmentAcademicSubjects = new HashSet(value.Cast()); + } + } + + + private ICollection _assessmentAssessedGradeLevels; + private ICollection _assessmentAssessedGradeLevelsCovariant; + [Key(23)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentAssessedGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentAssessedGradeLevels is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentAssessedGradeLevels"); + } + + foreach (var item in _assessmentAssessedGradeLevels) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentAssessedGradeLevels; + } + set + { + _assessmentAssessedGradeLevels = value; + _assessmentAssessedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentAssessedGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentAssessedGradeLevels) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentAssessedGradeLevelsCovariant; + } + set + { + AssessmentAssessedGradeLevels = new HashSet(value.Cast()); + } + } + + + private ICollection _assessmentIdentificationCodes; + private ICollection _assessmentIdentificationCodesCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentIdentificationCodes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentIdentificationCodes is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentIdentificationCodes"); + } + + foreach (var item in _assessmentIdentificationCodes) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentIdentificationCodes; + } + set + { + _assessmentIdentificationCodes = value; + _assessmentIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentIdentificationCodes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentIdentificationCodes) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentIdentificationCodesCovariant; + } + set + { + AssessmentIdentificationCodes = new HashSet(value.Cast()); + } + } + - private ICollection _assessmentContentStandardAuthors; - private ICollection _assessmentContentStandardAuthorsCovariant; - public virtual ICollection AssessmentContentStandardAuthors + private ICollection _assessmentLanguages; + private ICollection _assessmentLanguagesCovariant; + [Key(25)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentLanguages { get { @@ -4154,462 +7590,376 @@ public virtual ICollection set) + { + set.Reattach(this, "AssessmentLanguages"); + } + + foreach (var item in _assessmentLanguages) + if (item.Assessment == null) + item.Assessment = this; // ------------------------------------------------------------- - return _assessmentContentStandardAuthors; + return _assessmentLanguages; } set { - _assessmentContentStandardAuthors = value; - _assessmentContentStandardAuthorsCovariant = new CovariantCollectionAdapter(value); + _assessmentLanguages = value; + _assessmentLanguagesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentContentStandard.AssessmentContentStandardAuthors + ICollection Entities.Common.EdFi.IAssessment.AssessmentLanguages { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _assessmentContentStandardAuthors) - if (item.AssessmentContentStandard == null) - item.AssessmentContentStandard = this; + foreach (var item in _assessmentLanguages) + if (item.Assessment == null) + item.Assessment = this; // ------------------------------------------------------------- - return _assessmentContentStandardAuthorsCovariant; + return _assessmentLanguagesCovariant; } set { - AssessmentContentStandardAuthors = new HashSet(value.Cast()); + AssessmentLanguages = new HashSet(value.Cast()); } } - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "PublicationStatusDescriptor", new LookupColumnDetails { PropertyName = "PublicationStatusDescriptorId", LookupTypeName = "PublicationStatusDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - - return keyValues; - } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + private ICollection _assessmentPerformanceLevels; + private ICollection _assessmentPerformanceLevelsCovariant; + [Key(26)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentPerformanceLevels { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentPerformanceLevels is DeserializedPersistentGenericSet set) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + set.Reattach(this, "AssessmentPerformanceLevels"); } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + + foreach (var item in _assessmentPerformanceLevels) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - foreach (DictionaryEntry entry in keyValues) + return _assessmentPerformanceLevels; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + _assessmentPerformanceLevels = value; + _assessmentPerformanceLevelsCovariant = new CovariantCollectionAdapter(value); } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentContentStandard)target); } - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAssessmentContentStandard) target, null); - } - - void IChildEntity.SetParent(object value) - { - Assessment = (Assessment) value; - } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.AssessmentContentStandardAuthor table of the Assessment aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentContentStandardAuthor : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentContentStandardAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public AssessmentContentStandardAuthor() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentPerformanceLevels { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentContentStandard AssessmentContentStandard { get; set; } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentPerformanceLevels) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - Entities.Common.EdFi.IAssessmentContentStandard IAssessmentContentStandardAuthor.AssessmentContentStandard - { - get { return AssessmentContentStandard; } - set { AssessmentContentStandard = (AssessmentContentStandard) value; } + return _assessmentPerformanceLevelsCovariant; + } + set + { + AssessmentPerformanceLevels = new HashSet(value.Cast()); + } } - [DomainSignature] - public virtual string Author { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - public IDictionary Extensions + private ICollection _assessmentPeriods; + private ICollection _assessmentPeriodsCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentPeriods { - get => _extensions; - set + get { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentPeriods is DeserializedPersistentGenericSet set) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } + set.Reattach(this, "AssessmentPeriods"); } + + foreach (var item in _assessmentPeriods) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - _extensions = value; + return _assessmentPeriods; } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + set { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + _assessmentPeriods = value; + _assessmentPeriodsCovariant = new CovariantCollectionAdapter(value); + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentPeriods { - // Get parent key values - var keyValues = (AssessmentContentStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("Author", Author); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentPeriods) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - return keyValues; + return _assessmentPeriodsCovariant; + } + set + { + AssessmentPeriods = new HashSet(value.Cast()); + } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - foreach (DictionaryEntry entry in theseKeys) + private ICollection _assessmentPlatformTypes; + private ICollection _assessmentPlatformTypesCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentPlatformTypes + { + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentPlatformTypes is DeserializedPersistentGenericSet set) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + set.Reattach(this, "AssessmentPlatformTypes"); } - } + + foreach (var item in _assessmentPlatformTypes) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - return true; + return _assessmentPlatformTypes; + } + set + { + _assessmentPlatformTypes = value; + _assessmentPlatformTypesCovariant = new CovariantCollectionAdapter(value); + } } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentPlatformTypes { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentPlatformTypes) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - if (keyValues.Count == 0) - return base.GetHashCode(); + return _assessmentPlatformTypesCovariant; + } + set + { + AssessmentPlatformTypes = new HashSet(value.Cast()); + } + } - var hashCode = new HashCode(); - foreach (DictionaryEntry entry in keyValues) + private ICollection _assessmentPrograms; + private ICollection _assessmentProgramsCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentPrograms + { + get { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentPrograms is DeserializedPersistentGenericSet set) { - hashCode.Add(entry.Value); + set.Reattach(this, "AssessmentPrograms"); } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentContentStandardAuthor)target); - } + + foreach (var item in _assessmentPrograms) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAssessmentContentStandardAuthor) target, null); + return _assessmentPrograms; + } + set + { + _assessmentPrograms = value; + _assessmentProgramsCovariant = new CovariantCollectionAdapter(value); + } } - void IChildEntity.SetParent(object value) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentPrograms { - AssessmentContentStandard = (AssessmentContentStandard) value; - } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.AssessmentIdentificationCode table of the Assessment aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentPrograms) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - public AssessmentIdentificationCode() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + return _assessmentProgramsCovariant; + } + set + { + AssessmentPrograms = new HashSet(value.Cast()); + } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentIdentificationCode.Assessment - { - get { return Assessment; } - set { Assessment = (Assessment) value; } - } - [DomainSignature] - public virtual int AssessmentIdentificationSystemDescriptorId + private ICollection _assessmentScores; + private ICollection _assessmentScoresCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentScores { get { - if (_assessmentIdentificationSystemDescriptorId == default(int)) - _assessmentIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentIdentificationSystemDescriptor", _assessmentIdentificationSystemDescriptor); + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentScores is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentScores"); + } + + foreach (var item in _assessmentScores) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - return _assessmentIdentificationSystemDescriptorId; - } + return _assessmentScores; + } set { - _assessmentIdentificationSystemDescriptorId = value; - _assessmentIdentificationSystemDescriptor = null; + _assessmentScores = value; + _assessmentScoresCovariant = new CovariantCollectionAdapter(value); } } - private int _assessmentIdentificationSystemDescriptorId; - private string _assessmentIdentificationSystemDescriptor; - - public virtual string AssessmentIdentificationSystemDescriptor + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentScores { get { - if (_assessmentIdentificationSystemDescriptor == null) - _assessmentIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentIdentificationSystemDescriptor", _assessmentIdentificationSystemDescriptorId); - - return _assessmentIdentificationSystemDescriptor; + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentScores) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- + + return _assessmentScoresCovariant; } set { - _assessmentIdentificationSystemDescriptor = value; - _assessmentIdentificationSystemDescriptorId = default(int); + AssessmentScores = new HashSet(value.Cast()); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string AssigningOrganizationIdentificationCode { get; set; } - public virtual string IdentificationCode { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - public IDictionary Extensions + private ICollection _assessmentSections; + private ICollection _assessmentSectionsCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentSections { - get => _extensions; - set + get { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentSections is DeserializedPersistentGenericSet set) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } + set.Reattach(this, "AssessmentSections"); } + + foreach (var item in _assessmentSections) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - _extensions = value; + return _assessmentSections; + } + set + { + _assessmentSections = value; + _assessmentSectionsCovariant = new CovariantCollectionAdapter(value); } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessment.AssessmentSections + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentSections) + if (item.Assessment == null) + item.Assessment = this; + // ------------------------------------------------------------- - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _assessmentSectionsCovariant; + } + set + { + AssessmentSections = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "AssessmentIdentificationSystemDescriptorId", LookupTypeName = "AssessmentIdentificationSystemDescriptor"} }, + { "AssessmentCategoryDescriptor", new LookupColumnDetails { PropertyName = "AssessmentCategoryDescriptorId", LookupTypeName = "AssessmentCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -4620,11 +7970,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentIdentificationSystemDescriptorId", AssessmentIdentificationSystemDescriptorId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); return keyValues; } @@ -4688,36 +8039,33 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.IAssessment) target, null); } - void IChildEntity.SetParent(object value) - { - Assessment = (Assessment) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentLanguage table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAcademicSubject table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentLanguage : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentLanguage() + public AssessmentAcademicSubject() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -4725,48 +8073,50 @@ public AssessmentLanguage() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentLanguage.Assessment + Entities.Common.EdFi.IAssessment IAssessmentAcademicSubject.Assessment { get { return Assessment; } set { Assessment = (Assessment) value; } } [DomainSignature] - public virtual int LanguageDescriptorId + [Key(1)] + public virtual int AcademicSubjectDescriptorId { get { - if (_languageDescriptorId == default(int)) - _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - return _languageDescriptorId; + return _academicSubjectDescriptorId; } set { - _languageDescriptorId = value; - _languageDescriptor = null; + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; } } - private int _languageDescriptorId; - private string _languageDescriptor; + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; - public virtual string LanguageDescriptor + [IgnoreMember] + public virtual string AcademicSubjectDescriptor { get { - if (_languageDescriptor == null) - _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); - return _languageDescriptor; + return _academicSubjectDescriptor; } set { - _languageDescriptor = value; - _languageDescriptorId = default(int); + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -4791,14 +8141,27 @@ public virtual string LanguageDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentAcademicSubject")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -4817,7 +8180,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentAcademicSubject")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -4833,7 +8236,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -4845,10 +8248,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -4912,12 +8315,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentLanguage)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentLanguage) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAcademicSubject) target, null); } void IChildEntity.SetParent(object value) @@ -4929,19 +8332,20 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentPerformanceLevel table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAssessedGradeLevel table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentAssessedGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentAssessedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentPerformanceLevel() + public AssessmentAssessedGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -4949,83 +8353,50 @@ public AssessmentPerformanceLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentPerformanceLevel.Assessment + Entities.Common.EdFi.IAssessment IAssessmentAssessedGradeLevel.Assessment { get { return Assessment; } set { Assessment = (Assessment) value; } } [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId - { - get - { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - - return _assessmentReportingMethodDescriptorId; - } - set - { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; - } - } - - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; - - public virtual string AssessmentReportingMethodDescriptor - { - get - { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); - - return _assessmentReportingMethodDescriptor; - } - set - { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); - } - } - [DomainSignature] - public virtual int PerformanceLevelDescriptorId + [Key(1)] + public virtual int GradeLevelDescriptorId { get { - if (_performanceLevelDescriptorId == default(int)) - _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - return _performanceLevelDescriptorId; + return _gradeLevelDescriptorId; } set { - _performanceLevelDescriptorId = value; - _performanceLevelDescriptor = null; + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; } } - private int _performanceLevelDescriptorId; - private string _performanceLevelDescriptor; + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; - public virtual string PerformanceLevelDescriptor + [IgnoreMember] + public virtual string GradeLevelDescriptor { get { - if (_performanceLevelDescriptor == null) - _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - return _performanceLevelDescriptor; + return _gradeLevelDescriptor; } set { - _performanceLevelDescriptor = value; - _performanceLevelDescriptorId = default(int); + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -5038,43 +8409,6 @@ public virtual string PerformanceLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } - public virtual string PerformanceLevelIndicatorName { get; set; } - public virtual int? ResultDatatypeTypeDescriptorId - { - get - { - if (_resultDatatypeTypeDescriptorId == default(int?)) - _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - - return _resultDatatypeTypeDescriptorId; - } - set - { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; - } - } - - private int? _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; - - public virtual string ResultDatatypeTypeDescriptor - { - get - { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); - - return _resultDatatypeTypeDescriptor; - } - set - { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -5087,14 +8421,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentAssessedGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -5113,7 +8460,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentAssessedGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -5129,9 +8516,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -5143,11 +8528,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); - keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -5211,12 +8595,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPerformanceLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAssessedGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentPerformanceLevel) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAssessedGradeLevel) target, null); } void IChildEntity.SetParent(object value) @@ -5228,19 +8612,21 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentPeriod table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AssessmentContentStandard table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentContentStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentContentStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentPeriod() + public AssessmentContentStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentContentStandardAuthors = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -5248,50 +8634,15 @@ public AssessmentPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentPeriod.Assessment + Entities.Common.EdFi.IAssessment IAssessmentContentStandard.Assessment { get { return Assessment; } set { Assessment = (Assessment) value; } } - [DomainSignature] - public virtual int AssessmentPeriodDescriptorId - { - get - { - if (_assessmentPeriodDescriptorId == default(int)) - _assessmentPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentPeriodDescriptor", _assessmentPeriodDescriptor); - - return _assessmentPeriodDescriptorId; - } - set - { - _assessmentPeriodDescriptorId = value; - _assessmentPeriodDescriptor = null; - } - } - - private int _assessmentPeriodDescriptorId; - private string _assessmentPeriodDescriptor; - - public virtual string AssessmentPeriodDescriptor - { - get - { - if (_assessmentPeriodDescriptor == null) - _assessmentPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentPeriodDescriptor", _assessmentPeriodDescriptorId); - - return _assessmentPeriodDescriptor; - } - set - { - _assessmentPeriodDescriptor = value; - _assessmentPeriodDescriptorId = default(int); - } - } // ------------------------------------------------------------- // ============================================================= @@ -5302,6 +8653,7 @@ public virtual string AssessmentPeriodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(1)] public virtual DateTime? BeginDate { get { return _beginDate; } @@ -5321,6 +8673,7 @@ public virtual DateTime? BeginDate private DateTime? _beginDate; + [Key(2)] public virtual DateTime? EndDate { get { return _endDate; } @@ -5340,6 +8693,72 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(3)] + public virtual long? MandatingEducationOrganizationId { get; set; } + [Key(4)] + public virtual DateTime? PublicationDate + { + get { return _publicationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _publicationDate = null; + } else + { + var given = (DateTime) value; + _publicationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _publicationDate; + + [Key(5)] + public virtual int? PublicationStatusDescriptorId + { + get + { + if (_publicationStatusDescriptorId == default(int?)) + _publicationStatusDescriptorId = string.IsNullOrWhiteSpace(_publicationStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PublicationStatusDescriptor", _publicationStatusDescriptor); + + return _publicationStatusDescriptorId; + } + set + { + _publicationStatusDescriptorId = value; + _publicationStatusDescriptor = null; + } + } + + private int? _publicationStatusDescriptorId; + private string _publicationStatusDescriptor; + + [IgnoreMember] + public virtual string PublicationStatusDescriptor + { + get + { + if (_publicationStatusDescriptor == null) + _publicationStatusDescriptor = _publicationStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PublicationStatusDescriptor", _publicationStatusDescriptorId.Value); + + return _publicationStatusDescriptor; + } + set + { + _publicationStatusDescriptor = value; + _publicationStatusDescriptorId = default(int?); + } + } + [Key(6)] + public virtual short? PublicationYear { get; set; } + [Key(7)] + public virtual string Title { get; set; } + [Key(8)] + public virtual string URI { get; set; } + [Key(9)] + public virtual string Version { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -5352,14 +8771,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentContentStandard")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -5378,23 +8810,138 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentContentStandard")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MandatingEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the MandatingEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentContentStandard.MandatingEducationOrganizationDiscriminator + { + get { return MandatingEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the MandatingEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentContentStandard.MandatingEducationOrganizationResourceId + { + get { return MandatingEducationOrganizationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _assessmentContentStandardAuthors; + private ICollection _assessmentContentStandardAuthorsCovariant; + [Key(13)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentContentStandardAuthors + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentContentStandardAuthors is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentContentStandardAuthors"); + } + + foreach (var item in _assessmentContentStandardAuthors) + if (item.AssessmentContentStandard == null) + item.AssessmentContentStandard = this; + // ------------------------------------------------------------- + + return _assessmentContentStandardAuthors; + } + set + { + _assessmentContentStandardAuthors = value; + _assessmentContentStandardAuthorsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentContentStandard.AssessmentContentStandardAuthors + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentContentStandardAuthors) + if (item.AssessmentContentStandard == null) + item.AssessmentContentStandard = this; + // ------------------------------------------------------------- + + return _assessmentContentStandardAuthorsCovariant; + } + set + { + AssessmentContentStandardAuthors = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentPeriodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentPeriodDescriptorId", LookupTypeName = "AssessmentPeriodDescriptor"} }, + { "PublicationStatusDescriptor", new LookupColumnDetails { PropertyName = "PublicationStatusDescriptorId", LookupTypeName = "PublicationStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -5406,10 +8953,9 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentPeriodDescriptorId", AssessmentPeriodDescriptorId); return keyValues; } @@ -5473,12 +9019,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentContentStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentContentStandard) target, null); } void IChildEntity.SetParent(object value) @@ -5490,19 +9036,20 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentPlatformType table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AssessmentContentStandardAuthor table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentPlatformType : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentPlatformType, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentContentStandardAuthor : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentContentStandardAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentPlatformType() + public AssessmentContentStandardAuthor() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -5510,50 +9057,18 @@ public AssessmentPlatformType() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Assessment Assessment { get; set; } + [DomainSignature, IgnoreMember] + public virtual AssessmentContentStandard AssessmentContentStandard { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentPlatformType.Assessment + Entities.Common.EdFi.IAssessmentContentStandard IAssessmentContentStandardAuthor.AssessmentContentStandard { - get { return Assessment; } - set { Assessment = (Assessment) value; } + get { return AssessmentContentStandard; } + set { AssessmentContentStandard = (AssessmentContentStandard) value; } } [DomainSignature] - public virtual int PlatformTypeDescriptorId - { - get - { - if (_platformTypeDescriptorId == default(int)) - _platformTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PlatformTypeDescriptor", _platformTypeDescriptor); - - return _platformTypeDescriptorId; - } - set - { - _platformTypeDescriptorId = value; - _platformTypeDescriptor = null; - } - } - - private int _platformTypeDescriptorId; - private string _platformTypeDescriptor; - - public virtual string PlatformTypeDescriptor - { - get - { - if (_platformTypeDescriptor == null) - _platformTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PlatformTypeDescriptor", _platformTypeDescriptorId); - - return _platformTypeDescriptor; - } - set - { - _platformTypeDescriptor = value; - _platformTypeDescriptorId = default(int); - } - } + [Key(1)] + public virtual string Author { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -5576,14 +9091,27 @@ public virtual string PlatformTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentContentStandardAuthor")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -5602,7 +9130,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentContentStandardAuthor")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -5618,7 +9186,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "PlatformTypeDescriptor", new LookupColumnDetails { PropertyName = "PlatformTypeDescriptorId", LookupTypeName = "PlatformTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -5630,10 +9197,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentContentStandard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("PlatformTypeDescriptorId", PlatformTypeDescriptorId); + keyValues.Add("Author", Author); return keyValues; } @@ -5697,36 +9264,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPlatformType)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentContentStandardAuthor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentPlatformType) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentContentStandardAuthor) target, null); } void IChildEntity.SetParent(object value) { - Assessment = (Assessment) value; + AssessmentContentStandard = (AssessmentContentStandard) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentProgram table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AssessmentIdentificationCode table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentProgram : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentProgram() + public AssessmentIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -5734,52 +9302,50 @@ public AssessmentProgram() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentProgram.Assessment + Entities.Common.EdFi.IAssessment IAssessmentIdentificationCode.Assessment { get { return Assessment; } set { Assessment = (Assessment) value; } } [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramName { get; set; } - [DomainSignature] - public virtual int ProgramTypeDescriptorId + [Key(1)] + public virtual int AssessmentIdentificationSystemDescriptorId { get { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + if (_assessmentIdentificationSystemDescriptorId == default(int)) + _assessmentIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentIdentificationSystemDescriptor", _assessmentIdentificationSystemDescriptor); - return _programTypeDescriptorId; + return _assessmentIdentificationSystemDescriptorId; } set { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; + _assessmentIdentificationSystemDescriptorId = value; + _assessmentIdentificationSystemDescriptor = null; } } - private int _programTypeDescriptorId; - private string _programTypeDescriptor; + private int _assessmentIdentificationSystemDescriptorId; + private string _assessmentIdentificationSystemDescriptor; - public virtual string ProgramTypeDescriptor + [IgnoreMember] + public virtual string AssessmentIdentificationSystemDescriptor { get { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + if (_assessmentIdentificationSystemDescriptor == null) + _assessmentIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentIdentificationSystemDescriptor", _assessmentIdentificationSystemDescriptorId); - return _programTypeDescriptor; + return _assessmentIdentificationSystemDescriptor; } set { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); + _assessmentIdentificationSystemDescriptor = value; + _assessmentIdentificationSystemDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -5792,6 +9358,10 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual string AssigningOrganizationIdentificationCode { get; set; } + [Key(3)] + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -5804,14 +9374,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentIdentificationCode")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -5830,34 +9413,54 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentIdentificationCode")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentProgram.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentProgram.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } + _aggregateExtensions = value; + } } // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= // Collections // ------------------------------------------------------------- @@ -5866,7 +9469,7 @@ string Entities.Common.EdFi.IAssessmentProgram.ProgramDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "AssessmentIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "AssessmentIdentificationSystemDescriptorId", LookupTypeName = "AssessmentIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -5878,12 +9481,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("AssessmentIdentificationSystemDescriptorId", AssessmentIdentificationSystemDescriptorId); return keyValues; } @@ -5947,12 +9548,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentProgram) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentIdentificationCode) target, null); } void IChildEntity.SetParent(object value) @@ -5964,19 +9565,20 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentScore table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AssessmentLanguage table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentScore : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentLanguage : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentScore() + public AssessmentLanguage() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -5984,48 +9586,50 @@ public AssessmentScore() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentScore.Assessment + Entities.Common.EdFi.IAssessment IAssessmentLanguage.Assessment { get { return Assessment; } set { Assessment = (Assessment) value; } } [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId + [Key(1)] + public virtual int LanguageDescriptorId { get { - if (_assessmentReportingMethodDescriptorId == default(int)) - _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + if (_languageDescriptorId == default(int)) + _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); - return _assessmentReportingMethodDescriptorId; + return _languageDescriptorId; } set { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; + _languageDescriptorId = value; + _languageDescriptor = null; } } - private int _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; + private int _languageDescriptorId; + private string _languageDescriptor; - public virtual string AssessmentReportingMethodDescriptor + [IgnoreMember] + public virtual string LanguageDescriptor { get { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + if (_languageDescriptor == null) + _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); - return _assessmentReportingMethodDescriptor; + return _languageDescriptor; } set { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int); + _languageDescriptor = value; + _languageDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -6038,42 +9642,6 @@ public virtual string AssessmentReportingMethodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } - public virtual int? ResultDatatypeTypeDescriptorId - { - get - { - if (_resultDatatypeTypeDescriptorId == default(int?)) - _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); - - return _resultDatatypeTypeDescriptorId; - } - set - { - _resultDatatypeTypeDescriptorId = value; - _resultDatatypeTypeDescriptor = null; - } - } - - private int? _resultDatatypeTypeDescriptorId; - private string _resultDatatypeTypeDescriptor; - - public virtual string ResultDatatypeTypeDescriptor - { - get - { - if (_resultDatatypeTypeDescriptor == null) - _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); - - return _resultDatatypeTypeDescriptor; - } - set - { - _resultDatatypeTypeDescriptor = value; - _resultDatatypeTypeDescriptorId = default(int?); - } - } // ------------------------------------------------------------- // ============================================================= @@ -6086,14 +9654,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentLanguage")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -6112,7 +9693,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentLanguage")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -6128,8 +9749,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, - { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, + { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -6141,10 +9761,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); return keyValues; } @@ -6208,12 +9828,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScore)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentLanguage)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentScore) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentLanguage) target, null); } void IChildEntity.SetParent(object value) @@ -6225,19 +9845,20 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentSection table of the Assessment aggregate in the ODS database. + /// A class which represents the edfi.AssessmentPerformanceLevel table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentSection : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentSection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentSection() + public AssessmentPerformanceLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -6245,25 +9866,89 @@ public AssessmentSection() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessment IAssessmentSection.Assessment + Entities.Common.EdFi.IAssessment IAssessmentPerformanceLevel.Assessment { get { return Assessment; } set { Assessment = (Assessment) value; } } - - [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [DomainSignature] - public virtual string SectionIdentifier { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } + + [DomainSignature] + [Key(1)] + public virtual int AssessmentReportingMethodDescriptorId + { + get + { + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } + } + + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; + + [IgnoreMember] + public virtual string AssessmentReportingMethodDescriptor + { + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } + } + [DomainSignature] + [Key(2)] + public virtual int PerformanceLevelDescriptorId + { + get + { + if (_performanceLevelDescriptorId == default(int)) + _performanceLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PerformanceLevelDescriptor", _performanceLevelDescriptor); + + return _performanceLevelDescriptorId; + } + set + { + _performanceLevelDescriptorId = value; + _performanceLevelDescriptor = null; + } + } + + private int _performanceLevelDescriptorId; + private string _performanceLevelDescriptor; + + [IgnoreMember] + public virtual string PerformanceLevelDescriptor + { + get + { + if (_performanceLevelDescriptor == null) + _performanceLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PerformanceLevelDescriptor", _performanceLevelDescriptorId); + + return _performanceLevelDescriptor; + } + set + { + _performanceLevelDescriptor = value; + _performanceLevelDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -6274,6 +9959,48 @@ Entities.Common.EdFi.IAssessment IAssessmentSection.Assessment // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] + public virtual string MaximumScore { get; set; } + [Key(4)] + public virtual string MinimumScore { get; set; } + [Key(5)] + public virtual string PerformanceLevelIndicatorName { get; set; } + [Key(6)] + public virtual int? ResultDatatypeTypeDescriptorId + { + get + { + if (_resultDatatypeTypeDescriptorId == default(int?)) + _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + + return _resultDatatypeTypeDescriptorId; + } + set + { + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; + } + } + + private int? _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; + + [IgnoreMember] + public virtual string ResultDatatypeTypeDescriptor + { + get + { + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); + + return _resultDatatypeTypeDescriptor; + } + set + { + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -6286,14 +10013,27 @@ Entities.Common.EdFi.IAssessment IAssessmentSection.Assessment // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentPerformanceLevel")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -6312,34 +10052,54 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentPerformanceLevel")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - /// - /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentSection.SectionDiscriminator - { - get { return SectionReferenceData?.Discriminator; } - set { } - } + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - /// - /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentSection.SectionResourceId - { - get { return SectionReferenceData?.Id; } - set { } + _aggregateExtensions = value; + } } // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= // Collections // ------------------------------------------------------------- @@ -6348,6 +10108,9 @@ string Entities.Common.EdFi.IAssessmentSection.SectionDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "PerformanceLevelDescriptor", new LookupColumnDetails { PropertyName = "PerformanceLevelDescriptorId", LookupTypeName = "PerformanceLevelDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -6359,14 +10122,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Assessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("PerformanceLevelDescriptorId", PerformanceLevelDescriptorId); return keyValues; } @@ -6430,12 +10190,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentSection)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPerformanceLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentSection) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentPerformanceLevel) target, null); } void IChildEntity.SetParent(object value) @@ -6443,127 +10203,77 @@ void IChildEntity.SetParent(object value) Assessment = (Assessment) value; } } -} -// Aggregate: AssessmentAdministration +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 -namespace EdFi.Ods.Entities.NHibernate.AssessmentAdministrationAggregate.EdFi -{ /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.AssessmentPeriod table of the Assessment aggregate in the ODS database. /// - public class AssessmentAdministrationReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AssessmentPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentPeriod() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AdministrationIdentifier { get; set; } - public virtual string AssessmentIdentifier { get; set; } - public virtual long AssigningEducationOrganizationId { get; set; } - public virtual string Namespace { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + [DomainSignature, IgnoreMember] + public virtual Assessment Assessment { get; set; } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + Entities.Common.EdFi.IAssessment IAssessmentPeriod.Assessment { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); - keyValues.Add("Namespace", Namespace); - - return keyValues; + get { return Assessment; } + set { Assessment = (Assessment) value; } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [DomainSignature] + [Key(1)] + public virtual int AssessmentPeriodDescriptorId { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + if (_assessmentPeriodDescriptorId == default(int)) + _assessmentPeriodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentPeriodDescriptor", _assessmentPeriodDescriptor); - foreach (DictionaryEntry entry in keyValues) + return _assessmentPeriodDescriptorId; + } + set { - hashCode.Add(entry.Value); + _assessmentPeriodDescriptorId = value; + _assessmentPeriodDescriptor = null; } - - return hashCode.ToHashCode(); } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.AssessmentAdministration table of the AssessmentAdministration aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentAdministration : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessmentAdministration, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } + private int _assessmentPeriodDescriptorId; + private string _assessmentPeriodDescriptor; - public AssessmentAdministration() + [IgnoreMember] + public virtual string AssessmentPeriodDescriptor { - AssessmentAdministrationAssessmentBatteryParts = new HashSet(); - AssessmentAdministrationPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get + { + if (_assessmentPeriodDescriptor == null) + _assessmentPeriodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentPeriodDescriptor", _assessmentPeriodDescriptorId); + + return _assessmentPeriodDescriptor; + } + set + { + _assessmentPeriodDescriptor = value; + _assessmentPeriodDescriptorId = default(int); + } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual string AdministrationIdentifier { get; set; } - [DomainSignature] - public virtual string AssessmentIdentifier { get; set; } - [DomainSignature] - public virtual long AssigningEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -6574,6 +10284,46 @@ public AssessmentAdministration() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual DateTime? BeginDate + { + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _beginDate; + + [Key(3)] + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -6586,14 +10336,27 @@ public AssessmentAdministration() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentPeriod")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -6612,156 +10375,63 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } - - /// - /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentAdministration.AssessmentDiscriminator - { - get { return AssessmentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentAdministration.AssessmentResourceId - { - get { return AssessmentReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData AssigningEducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the AssigningEducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationDiscriminator - { - get { return AssigningEducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the AssigningEducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationResourceId - { - get { return AssigningEducationOrganizationReferenceData?.Id; } - set { } - } - - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _assessmentAdministrationAssessmentBatteryParts; - private ICollection _assessmentAdministrationAssessmentBatteryPartsCovariant; - public virtual ICollection AssessmentAdministrationAssessmentBatteryParts - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAdministrationAssessmentBatteryParts) - if (item.AssessmentAdministration == null) - item.AssessmentAdministration = this; - // ------------------------------------------------------------- - - return _assessmentAdministrationAssessmentBatteryParts; - } - set - { - _assessmentAdministrationAssessmentBatteryParts = value; - _assessmentAdministrationAssessmentBatteryPartsCovariant = new CovariantCollectionAdapter(value); - } - } + private IDictionary _aggregateExtensions; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationAssessmentBatteryParts - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentPeriod")] + [Key(5)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAdministrationAssessmentBatteryParts) - if (item.AssessmentAdministration == null) - item.AssessmentAdministration = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _assessmentAdministrationAssessmentBatteryPartsCovariant; + return _aggregateExtensions; } set { - AssessmentAdministrationAssessmentBatteryParts = new HashSet(value.Cast()); - } - } - - - private ICollection _assessmentAdministrationPeriods; - private ICollection _assessmentAdministrationPeriodsCovariant; - public virtual ICollection AssessmentAdministrationPeriods - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAdministrationPeriods) - if (item.AssessmentAdministration == null) - item.AssessmentAdministration = this; - // ------------------------------------------------------------- + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - return _assessmentAdministrationPeriods; - } - set - { - _assessmentAdministrationPeriods = value; - _assessmentAdministrationPeriodsCovariant = new CovariantCollectionAdapter(value); + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationPeriods - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAdministrationPeriods) - if (item.AssessmentAdministration == null) - item.AssessmentAdministration = this; - // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _assessmentAdministrationPeriodsCovariant; - } - set - { - AssessmentAdministrationPeriods = new HashSet(value.Cast()); - } - } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentPeriodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentPeriodDescriptorId", LookupTypeName = "AssessmentPeriodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -6772,14 +10442,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); - keyValues.Add("Namespace", Namespace); + keyValues.Add("AssessmentPeriodDescriptorId", AssessmentPeriodDescriptorId); return keyValues; } @@ -6843,32 +10510,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministration)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentAdministration) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentPeriod) target, null); } + void IChildEntity.SetParent(object value) + { + Assessment = (Assessment) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentAdministrationAssessmentBatteryPart table of the AssessmentAdministration aggregate in the ODS database. + /// A class which represents the edfi.AssessmentPlatformType table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentAdministrationAssessmentBatteryPart : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentPlatformType : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentPlatformType, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentAdministrationAssessmentBatteryPart() + public AssessmentPlatformType() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -6876,17 +10548,52 @@ public AssessmentAdministrationAssessmentBatteryPart() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentAdministration AssessmentAdministration { get; set; } + [DomainSignature, IgnoreMember] + public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationAssessmentBatteryPart.AssessmentAdministration + Entities.Common.EdFi.IAssessment IAssessmentPlatformType.Assessment { - get { return AssessmentAdministration; } - set { AssessmentAdministration = (AssessmentAdministration) value; } + get { return Assessment; } + set { Assessment = (Assessment) value; } } [DomainSignature] - public virtual string AssessmentBatteryPartName { get; set; } + [Key(1)] + public virtual int PlatformTypeDescriptorId + { + get + { + if (_platformTypeDescriptorId == default(int)) + _platformTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PlatformTypeDescriptor", _platformTypeDescriptor); + + return _platformTypeDescriptorId; + } + set + { + _platformTypeDescriptorId = value; + _platformTypeDescriptor = null; + } + } + + private int _platformTypeDescriptorId; + private string _platformTypeDescriptor; + + [IgnoreMember] + public virtual string PlatformTypeDescriptor + { + get + { + if (_platformTypeDescriptor == null) + _platformTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PlatformTypeDescriptor", _platformTypeDescriptorId); + + return _platformTypeDescriptor; + } + set + { + _platformTypeDescriptor = value; + _platformTypeDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -6909,14 +10616,27 @@ Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationAssessme // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentPlatformType")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -6935,34 +10655,54 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartReferenceData AssessmentBatteryPartReferenceData { get; set; } + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentPlatformType")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - /// - /// Read-only property that allows the AssessmentBatteryPart discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartDiscriminator - { - get { return AssessmentBatteryPartReferenceData?.Discriminator; } - set { } - } + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - /// - /// Read-only property that allows the AssessmentBatteryPart resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartResourceId - { - get { return AssessmentBatteryPartReferenceData?.Id; } - set { } + _aggregateExtensions = value; + } } // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= // Collections // ------------------------------------------------------------- @@ -6971,6 +10711,7 @@ string Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.Asses // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "PlatformTypeDescriptor", new LookupColumnDetails { PropertyName = "PlatformTypeDescriptorId", LookupTypeName = "PlatformTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -6982,10 +10723,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentAdministration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); + keyValues.Add("PlatformTypeDescriptorId", PlatformTypeDescriptorId); return keyValues; } @@ -7049,36 +10790,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPlatformType)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentPlatformType) target, null); } void IChildEntity.SetParent(object value) { - AssessmentAdministration = (AssessmentAdministration) value; + Assessment = (Assessment) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentAdministrationPeriod table of the AssessmentAdministration aggregate in the ODS database. + /// A class which represents the edfi.AssessmentProgram table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentAdministrationPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentAdministrationPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentProgram : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentAdministrationPeriod() + public AssessmentProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -7086,25 +10828,58 @@ public AssessmentAdministrationPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentAdministration AssessmentAdministration { get; set; } + [DomainSignature, IgnoreMember] + public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationPeriod.AssessmentAdministration + Entities.Common.EdFi.IAssessment IAssessmentProgram.Assessment { - get { return AssessmentAdministration; } - set { AssessmentAdministration = (AssessmentAdministration) value; } + get { return Assessment; } + set { Assessment = (Assessment) value; } } [DomainSignature] - public virtual DateTime BeginDate + [Key(1)] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + [Key(2)] + public virtual string ProgramName { get; set; } + [DomainSignature] + [Key(3)] + public virtual int ProgramTypeDescriptorId { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + + return _programTypeDescriptorId; + } + set + { + _programTypeDescriptorId = value; + _programTypeDescriptor = null; + } } - private DateTime _beginDate; - + private int _programTypeDescriptorId; + private string _programTypeDescriptor; + + [IgnoreMember] + public virtual string ProgramTypeDescriptor + { + get + { + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + + return _programTypeDescriptor; + } + set + { + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -7115,25 +10890,6 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - // ------------------------------------------------------------- // ============================================================= @@ -7146,14 +10902,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentProgram")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -7172,12 +10941,73 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentProgram")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentProgram.ProgramDiscriminator + { + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentProgram.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -7188,6 +11018,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -7199,10 +11030,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentAdministration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -7266,143 +11099,90 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentProgram) target, null); } void IChildEntity.SetParent(object value) { - AssessmentAdministration = (AssessmentAdministration) value; + Assessment = (Assessment) value; } } -} -// Aggregate: AssessmentAdministrationParticipation +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 -namespace EdFi.Ods.Entities.NHibernate.AssessmentAdministrationParticipationAggregate.EdFi -{ /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.AssessmentScore table of the Assessment aggregate in the ODS database. /// - public class AssessmentAdministrationParticipationReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class AssessmentScore : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentScore() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AdministrationIdentifier { get; set; } - public virtual string AssessmentIdentifier { get; set; } - public virtual long AssigningEducationOrganizationId { get; set; } - public virtual string Namespace { get; set; } - public virtual long ParticipatingEducationOrganizationId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + [DomainSignature, IgnoreMember] + public virtual Assessment Assessment { get; set; } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + Entities.Common.EdFi.IAssessment IAssessmentScore.Assessment { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); - keyValues.Add("Namespace", Namespace); - keyValues.Add("ParticipatingEducationOrganizationId", ParticipatingEducationOrganizationId); - - return keyValues; + get { return Assessment; } + set { Assessment = (Assessment) value; } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [DomainSignature] + [Key(1)] + public virtual int AssessmentReportingMethodDescriptorId { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + if (_assessmentReportingMethodDescriptorId == default(int)) + _assessmentReportingMethodDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); - foreach (DictionaryEntry entry in keyValues) + return _assessmentReportingMethodDescriptorId; + } + set { - hashCode.Add(entry.Value); + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; } - - return hashCode.ToHashCode(); } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.AssessmentAdministrationParticipation table of the AssessmentAdministrationParticipation aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentAdministrationParticipation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessmentAdministrationParticipation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } + private int _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; - public AssessmentAdministrationParticipation() + [IgnoreMember] + public virtual string AssessmentReportingMethodDescriptor { - AssessmentAdministrationParticipationAdministrationPointOfContacts = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int); + } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual string AdministrationIdentifier { get; set; } - [DomainSignature] - public virtual string AssessmentIdentifier { get; set; } - [DomainSignature] - public virtual long AssigningEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string Namespace { get; set; } - [DomainSignature] - public virtual long ParticipatingEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -7413,6 +11193,46 @@ public AssessmentAdministrationParticipation() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual string MaximumScore { get; set; } + [Key(3)] + public virtual string MinimumScore { get; set; } + [Key(4)] + public virtual int? ResultDatatypeTypeDescriptorId + { + get + { + if (_resultDatatypeTypeDescriptorId == default(int?)) + _resultDatatypeTypeDescriptorId = string.IsNullOrWhiteSpace(_resultDatatypeTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptor); + + return _resultDatatypeTypeDescriptorId; + } + set + { + _resultDatatypeTypeDescriptorId = value; + _resultDatatypeTypeDescriptor = null; + } + } + + private int? _resultDatatypeTypeDescriptorId; + private string _resultDatatypeTypeDescriptor; + + [IgnoreMember] + public virtual string ResultDatatypeTypeDescriptor + { + get + { + if (_resultDatatypeTypeDescriptor == null) + _resultDatatypeTypeDescriptor = _resultDatatypeTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ResultDatatypeTypeDescriptor", _resultDatatypeTypeDescriptorId.Value); + + return _resultDatatypeTypeDescriptor; + } + set + { + _resultDatatypeTypeDescriptor = value; + _resultDatatypeTypeDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -7425,14 +11245,27 @@ public AssessmentAdministrationParticipation() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentScore")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -7451,109 +11284,64 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationReferenceData AssessmentAdministrationReferenceData { get; set; } - - /// - /// Read-only property that allows the AssessmentAdministration discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentAdministrationParticipation.AssessmentAdministrationDiscriminator - { - get { return AssessmentAdministrationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the AssessmentAdministration resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentAdministrationParticipation.AssessmentAdministrationResourceId - { - get { return AssessmentAdministrationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParticipatingEducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the ParticipatingEducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentAdministrationParticipation.ParticipatingEducationOrganizationDiscriminator - { - get { return ParticipatingEducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ParticipatingEducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentAdministrationParticipation.ParticipatingEducationOrganizationResourceId - { - get { return ParticipatingEducationOrganizationReferenceData?.Id; } - set { } - } - - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - private ICollection _assessmentAdministrationParticipationAdministrationPointOfContacts; - private ICollection _assessmentAdministrationParticipationAdministrationPointOfContactsCovariant; - public virtual ICollection AssessmentAdministrationParticipationAdministrationPointOfContacts - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentScore")] + [Key(6)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAdministrationParticipationAdministrationPointOfContacts) - if (item.AssessmentAdministrationParticipation == null) - item.AssessmentAdministrationParticipation = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _assessmentAdministrationParticipationAdministrationPointOfContacts; + return _aggregateExtensions; } set { - _assessmentAdministrationParticipationAdministrationPointOfContacts = value; - _assessmentAdministrationParticipationAdministrationPointOfContactsCovariant = new CovariantCollectionAdapter(value); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentAdministrationParticipation.AssessmentAdministrationParticipationAdministrationPointOfContacts - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentAdministrationParticipationAdministrationPointOfContacts) - if (item.AssessmentAdministrationParticipation == null) - item.AssessmentAdministrationParticipation = this; - // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _assessmentAdministrationParticipationAdministrationPointOfContactsCovariant; - } - set - { - AssessmentAdministrationParticipationAdministrationPointOfContacts = new HashSet(value.Cast()); - } - } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "ResultDatatypeTypeDescriptor", new LookupColumnDetails { PropertyName = "ResultDatatypeTypeDescriptorId", LookupTypeName = "ResultDatatypeTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -7564,15 +11352,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); - keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); - keyValues.Add("Namespace", Namespace); - keyValues.Add("ParticipatingEducationOrganizationId", ParticipatingEducationOrganizationId); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); return keyValues; } @@ -7636,32 +11420,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationParticipation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScore)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationParticipation) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentScore) target, null); } + void IChildEntity.SetParent(object value) + { + Assessment = (Assessment) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentAdministrationParticipationAdministrationPointOfContact table of the AssessmentAdministrationParticipation aggregate in the ODS database. + /// A class which represents the edfi.AssessmentSection table of the Assessment aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentAdministrationParticipationAdministrationPointOfContact : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentSection : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentSection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentAdministrationParticipationAdministrationPointOfContact() + public AssessmentSection() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -7669,19 +11458,30 @@ public AssessmentAdministrationParticipationAdministrationPointOfContact() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentAdministrationParticipation AssessmentAdministrationParticipation { get; set; } + [DomainSignature, IgnoreMember] + public virtual Assessment Assessment { get; set; } - Entities.Common.EdFi.IAssessmentAdministrationParticipation IAssessmentAdministrationParticipationAdministrationPointOfContact.AssessmentAdministrationParticipation + Entities.Common.EdFi.IAssessment IAssessmentSection.Assessment { - get { return AssessmentAdministrationParticipation; } - set { AssessmentAdministrationParticipation = (AssessmentAdministrationParticipation) value; } + get { return Assessment; } + set { Assessment = (Assessment) value; } } [DomainSignature] - public virtual long EducationOrganizationId { get; set; } + [Key(1)] + public virtual string LocalCourseCode { get; set; } [DomainSignature] - public virtual string ElectronicMailAddress { get; set; } + [Key(2)] + public virtual long SchoolId { get; set; } + [DomainSignature] + [Key(3)] + public virtual short SchoolYear { get; set; } + [DomainSignature] + [Key(4)] + public virtual string SectionIdentifier { get; set; } + [DomainSignature] + [Key(5)] + public virtual string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -7692,9 +11492,6 @@ Entities.Common.EdFi.IAssessmentAdministrationParticipation IAssessmentAdministr // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string FirstName { get; set; } - public virtual string LastSurname { get; set; } - public virtual string LoginId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -7707,14 +11504,27 @@ Entities.Common.EdFi.IAssessmentAdministrationParticipation IAssessmentAdministr // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Assessment", "AssessmentSection")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -7733,29 +11543,70 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Assessment", "AssessmentSection")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + [Key(8)] + public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IAssessmentSection.SectionDiscriminator { - get { return EducationOrganizationReferenceData?.Discriminator; } + get { return SectionReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IAssessmentSection.SectionResourceId { - get { return EducationOrganizationReferenceData?.Id; } + get { return SectionReferenceData?.Id; } set { } } @@ -7780,11 +11631,14 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentAdministrationParticipation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Assessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); return keyValues; } @@ -7848,46 +11702,54 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentSection)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentSection) target, null); } void IChildEntity.SetParent(object value) { - AssessmentAdministrationParticipation = (AssessmentAdministrationParticipation) value; + Assessment = (Assessment) value; } } } -// Aggregate: AssessmentBatteryPart +// Aggregate: AssessmentAdministration -namespace EdFi.Ods.Entities.NHibernate.AssessmentBatteryPartAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentAdministrationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class AssessmentBatteryPartReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class AssessmentAdministrationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AssessmentBatteryPartName { get; set; } + [Key(0)] + public virtual string AdministrationIdentifier { get; set; } + [Key(1)] public virtual string AssessmentIdentifier { get; set; } + [Key(2)] + public virtual long AssigningEducationOrganizationId { get; set; } + [Key(3)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -7897,8 +11759,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("Namespace", Namespace); return keyValues; @@ -7950,20 +11813,22 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentBatteryPart table of the AssessmentBatteryPart aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministration table of the AssessmentAdministration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentBatteryPart : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessmentBatteryPart, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentAdministration : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentAdministration, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentBatteryPart() + public AssessmentAdministration() { - AssessmentBatteryPartObjectiveAssessments = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentAdministrationAssessmentBatteryParts = new HashSet(); + AssessmentAdministrationPeriods = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -7972,10 +11837,16 @@ public AssessmentBatteryPart() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string AssessmentBatteryPartName { get; set; } + [Key(6)] + public virtual string AdministrationIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] + [Key(8)] + public virtual long AssigningEducationOrganizationId { get; set; } + [DomainSignature] + [Key(9)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -7999,14 +11870,27 @@ public AssessmentBatteryPart() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentAdministration", "AssessmentAdministration")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -8025,18 +11909,59 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentAdministration", "AssessmentAdministration")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } /// /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentAdministration.AssessmentDiscriminator { get { return AssessmentReferenceData?.Discriminator; } set { } @@ -8045,21 +11970,44 @@ string Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentDiscriminator /// /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentAdministration.AssessmentResourceId { get { return AssessmentReferenceData?.Id; } set { } } + [Key(13)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData AssigningEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the AssigningEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationDiscriminator + { + get { return AssigningEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the AssigningEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentAdministration.AssigningEducationOrganizationResourceId + { + get { return AssigningEducationOrganizationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _assessmentBatteryPartObjectiveAssessments; - private ICollection _assessmentBatteryPartObjectiveAssessmentsCovariant; - public virtual ICollection AssessmentBatteryPartObjectiveAssessments + private ICollection _assessmentAdministrationAssessmentBatteryParts; + private ICollection _assessmentAdministrationAssessmentBatteryPartsCovariant; + [Key(14)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentAdministrationAssessmentBatteryParts { get { @@ -8068,38 +12016,97 @@ public virtual ICollection set) + { + set.Reattach(this, "AssessmentAdministrationAssessmentBatteryParts"); + } + + foreach (var item in _assessmentAdministrationAssessmentBatteryParts) + if (item.AssessmentAdministration == null) + item.AssessmentAdministration = this; // ------------------------------------------------------------- - return _assessmentBatteryPartObjectiveAssessments; + return _assessmentAdministrationAssessmentBatteryParts; } set { - _assessmentBatteryPartObjectiveAssessments = value; - _assessmentBatteryPartObjectiveAssessmentsCovariant = new CovariantCollectionAdapter(value); + _assessmentAdministrationAssessmentBatteryParts = value; + _assessmentAdministrationAssessmentBatteryPartsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentBatteryPartObjectiveAssessments + ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationAssessmentBatteryParts { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _assessmentBatteryPartObjectiveAssessments) - if (item.AssessmentBatteryPart == null) - item.AssessmentBatteryPart = this; + foreach (var item in _assessmentAdministrationAssessmentBatteryParts) + if (item.AssessmentAdministration == null) + item.AssessmentAdministration = this; // ------------------------------------------------------------- - return _assessmentBatteryPartObjectiveAssessmentsCovariant; + return _assessmentAdministrationAssessmentBatteryPartsCovariant; } set { - AssessmentBatteryPartObjectiveAssessments = new HashSet(value.Cast()); + AssessmentAdministrationAssessmentBatteryParts = new HashSet(value.Cast()); + } + } + + + private ICollection _assessmentAdministrationPeriods; + private ICollection _assessmentAdministrationPeriodsCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentAdministrationPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentAdministrationPeriods is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentAdministrationPeriods"); + } + + foreach (var item in _assessmentAdministrationPeriods) + if (item.AssessmentAdministration == null) + item.AssessmentAdministration = this; + // ------------------------------------------------------------- + + return _assessmentAdministrationPeriods; + } + set + { + _assessmentAdministrationPeriods = value; + _assessmentAdministrationPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentAdministration.AssessmentAdministrationPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentAdministrationPeriods) + if (item.AssessmentAdministration == null) + item.AssessmentAdministration = this; + // ------------------------------------------------------------- + + return _assessmentAdministrationPeriodsCovariant; + } + set + { + AssessmentAdministrationPeriods = new HashSet(value.Cast()); } } @@ -8122,8 +12129,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("Namespace", Namespace); return keyValues; @@ -8188,12 +12196,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentBatteryPart)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministration)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentBatteryPart) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministration) target, null); } } @@ -8201,19 +12209,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentBatteryPartObjectiveAssessment table of the AssessmentBatteryPart aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministrationAssessmentBatteryPart table of the AssessmentAdministration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentBatteryPartObjectiveAssessment : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentAdministrationAssessmentBatteryPart : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentBatteryPartObjectiveAssessment() + public AssessmentAdministrationAssessmentBatteryPart() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -8221,17 +12230,18 @@ public AssessmentBatteryPartObjectiveAssessment() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentBatteryPart AssessmentBatteryPart { get; set; } + [DomainSignature, IgnoreMember] + public virtual AssessmentAdministration AssessmentAdministration { get; set; } - Entities.Common.EdFi.IAssessmentBatteryPart IAssessmentBatteryPartObjectiveAssessment.AssessmentBatteryPart + Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationAssessmentBatteryPart.AssessmentAdministration { - get { return AssessmentBatteryPart; } - set { AssessmentBatteryPart = (AssessmentBatteryPart) value; } + get { return AssessmentAdministration; } + set { AssessmentAdministration = (AssessmentAdministration) value; } } [DomainSignature] - public virtual string IdentificationCode { get; set; } + [Key(1)] + public virtual string AssessmentBatteryPartName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -8254,14 +12264,27 @@ Entities.Common.EdFi.IAssessmentBatteryPart IAssessmentBatteryPartObjectiveAsses // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentAdministration", "AssessmentAdministrationAssessmentBatteryPart")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -8280,29 +12303,70 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentAdministration", "AssessmentAdministrationAssessmentBatteryPart")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } + [Key(4)] + public virtual NHibernate.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartReferenceData AssessmentBatteryPartReferenceData { get; set; } /// - /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentBatteryPart discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartDiscriminator { - get { return ObjectiveAssessmentReferenceData?.Discriminator; } + get { return AssessmentBatteryPartReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentBatteryPart resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart.AssessmentBatteryPartResourceId { - get { return ObjectiveAssessmentReferenceData?.Id; } + get { return AssessmentBatteryPartReferenceData?.Id; } set { } } @@ -8327,10 +12391,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentBatteryPart as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentAdministration as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); return keyValues; } @@ -8394,86 +12458,94 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationAssessmentBatteryPart) target, null); } void IChildEntity.SetParent(object value) { - AssessmentBatteryPart = (AssessmentBatteryPart) value; + AssessmentAdministration = (AssessmentAdministration) value; } } -} -// Aggregate: AssessmentCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AssessmentCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentCategoryDescriptor table of the AssessmentCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministrationPeriod table of the AssessmentAdministration aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentAdministrationPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentAdministrationPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentAdministrationPeriod() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual AssessmentAdministration AssessmentAdministration { get; set; } + + Entities.Common.EdFi.IAssessmentAdministration IAssessmentAdministrationPeriod.AssessmentAdministration + { + get { return AssessmentAdministration; } + set { AssessmentAdministration = (AssessmentAdministration) value; } + } + [DomainSignature] - public virtual int AssessmentCategoryDescriptorId + [Key(1)] + public virtual DateTime BeginDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _beginDate; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -8484,185 +12556,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AssessmentCategoryDescriptorId", AssessmentCategoryDescriptorId); - - return keyValues; - } + private IDictionary _extensions; - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentAdministration", "AssessmentAdministrationPeriod")] + [Key(3)] + public IDictionary Extensions { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) + foreach (var key in _extensions.Keys) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) { - return false; + collection.ReattachExtension(this, (string) key); } } - else + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } } - } - return true; + _extensions = value; + } } - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + private IDictionary _aggregateExtensions; - foreach (DictionaryEntry entry in keyValues) + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentAdministration", "AssessmentAdministrationPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get { - if (entry.Value is string) + foreach (var key in _aggregateExtensions.Keys) { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } } - else + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) { - hashCode.Add(entry.Value); + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor) target, null); - } - - } -} -// Aggregate: AssessmentIdentificationSystemDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AssessmentIdentificationSystemDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.AssessmentIdentificationSystemDescriptor table of the AssessmentIdentificationSystemDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int AssessmentIdentificationSystemDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + _aggregateExtensions = value; + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -8688,11 +12663,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (AssessmentAdministration as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentIdentificationSystemDescriptorId", AssessmentIdentificationSystemDescriptorId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -8756,42 +12731,56 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationPeriod) target, null); } + void IChildEntity.SetParent(object value) + { + AssessmentAdministration = (AssessmentAdministration) value; + } } } -// Aggregate: AssessmentItem +// Aggregate: AssessmentAdministrationParticipation -namespace EdFi.Ods.Entities.NHibernate.AssessmentItemAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentAdministrationParticipationAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class AssessmentItemReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class AssessmentAdministrationParticipationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] + public virtual string AdministrationIdentifier { get; set; } + [Key(1)] public virtual string AssessmentIdentifier { get; set; } - public virtual string IdentificationCode { get; set; } + [Key(2)] + public virtual long AssigningEducationOrganizationId { get; set; } + [Key(3)] public virtual string Namespace { get; set; } + [Key(4)] + public virtual long ParticipatingEducationOrganizationId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -8801,9 +12790,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("Namespace", Namespace); + keyValues.Add("ParticipatingEducationOrganizationId", ParticipatingEducationOrganizationId); return keyValues; } @@ -8854,21 +12845,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItem table of the AssessmentItem aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministrationParticipation table of the AssessmentAdministrationParticipation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItem : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentAdministrationParticipation : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentAdministrationParticipation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentItem() + public AssessmentAdministrationParticipation() { - AssessmentItemLearningStandards = new HashSet(); - AssessmentItemPossibleResponses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentAdministrationParticipationAdministrationPointOfContacts = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -8877,11 +12868,20 @@ public AssessmentItem() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] + public virtual string AdministrationIdentifier { get; set; } + [DomainSignature] + [Key(7)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] - public virtual string IdentificationCode { get; set; } + [Key(8)] + public virtual long AssigningEducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual string Namespace { get; set; } + [DomainSignature] + [Key(10)] + public virtual long ParticipatingEducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -8892,45 +12892,6 @@ public AssessmentItem() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AssessmentItemCategoryDescriptorId - { - get - { - if (_assessmentItemCategoryDescriptorId == default(int?)) - _assessmentItemCategoryDescriptorId = string.IsNullOrWhiteSpace(_assessmentItemCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptor); - - return _assessmentItemCategoryDescriptorId; - } - set - { - _assessmentItemCategoryDescriptorId = value; - _assessmentItemCategoryDescriptor = null; - } - } - - private int? _assessmentItemCategoryDescriptorId; - private string _assessmentItemCategoryDescriptor; - - public virtual string AssessmentItemCategoryDescriptor - { - get - { - if (_assessmentItemCategoryDescriptor == null) - _assessmentItemCategoryDescriptor = _assessmentItemCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptorId.Value); - - return _assessmentItemCategoryDescriptor; - } - set - { - _assessmentItemCategoryDescriptor = value; - _assessmentItemCategoryDescriptorId = default(int?); - } - } - public virtual string AssessmentItemURI { get; set; } - public virtual string ExpectedTimeAssessed { get; set; } - public virtual string ItemText { get; set; } - public virtual decimal? MaxRawScore { get; set; } - public virtual string Nomenclature { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -8943,14 +12904,27 @@ public virtual string AssessmentItemCategoryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentAdministrationParticipation", "AssessmentAdministrationParticipation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -8969,88 +12943,105 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentAdministrationParticipation", "AssessmentAdministrationParticipation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } + [Key(13)] + public virtual NHibernate.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationReferenceData AssessmentAdministrationReferenceData { get; set; } /// - /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentAdministration discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentAdministrationParticipation.AssessmentAdministrationDiscriminator { - get { return AssessmentReferenceData?.Discriminator; } + get { return AssessmentAdministrationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the AssessmentAdministration resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentItem.AssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentAdministrationParticipation.AssessmentAdministrationResourceId { - get { return AssessmentReferenceData?.Id; } + get { return AssessmentAdministrationReferenceData?.Id; } set { } } - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + [Key(14)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParticipatingEducationOrganizationReferenceData { get; set; } - private ICollection _assessmentItemLearningStandards; - private ICollection _assessmentItemLearningStandardsCovariant; - public virtual ICollection AssessmentItemLearningStandards + /// + /// Read-only property that allows the ParticipatingEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentAdministrationParticipation.ParticipatingEducationOrganizationDiscriminator { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentItemLearningStandards) - if (item.AssessmentItem == null) - item.AssessmentItem = this; - // ------------------------------------------------------------- - - return _assessmentItemLearningStandards; - } - set - { - _assessmentItemLearningStandards = value; - _assessmentItemLearningStandardsCovariant = new CovariantCollectionAdapter(value); - } + get { return ParticipatingEducationOrganizationReferenceData?.Discriminator; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemLearningStandards + /// + /// Read-only property that allows the ParticipatingEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentAdministrationParticipation.ParticipatingEducationOrganizationResourceId { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _assessmentItemLearningStandards) - if (item.AssessmentItem == null) - item.AssessmentItem = this; - // ------------------------------------------------------------- - - return _assessmentItemLearningStandardsCovariant; - } - set - { - AssessmentItemLearningStandards = new HashSet(value.Cast()); - } + get { return ParticipatingEducationOrganizationReferenceData?.Id; } + set { } } + // ------------------------------------------------------------- - private ICollection _assessmentItemPossibleResponses; - private ICollection _assessmentItemPossibleResponsesCovariant; - public virtual ICollection AssessmentItemPossibleResponses + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _assessmentAdministrationParticipationAdministrationPointOfContacts; + private ICollection _assessmentAdministrationParticipationAdministrationPointOfContactsCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentAdministrationParticipationAdministrationPointOfContacts { get { @@ -9059,38 +13050,43 @@ public virtual ICollection set) + { + set.Reattach(this, "AssessmentAdministrationParticipationAdministrationPointOfContacts"); + } + + foreach (var item in _assessmentAdministrationParticipationAdministrationPointOfContacts) + if (item.AssessmentAdministrationParticipation == null) + item.AssessmentAdministrationParticipation = this; // ------------------------------------------------------------- - return _assessmentItemPossibleResponses; + return _assessmentAdministrationParticipationAdministrationPointOfContacts; } set { - _assessmentItemPossibleResponses = value; - _assessmentItemPossibleResponsesCovariant = new CovariantCollectionAdapter(value); + _assessmentAdministrationParticipationAdministrationPointOfContacts = value; + _assessmentAdministrationParticipationAdministrationPointOfContactsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemPossibleResponses + ICollection Entities.Common.EdFi.IAssessmentAdministrationParticipation.AssessmentAdministrationParticipationAdministrationPointOfContacts { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _assessmentItemPossibleResponses) - if (item.AssessmentItem == null) - item.AssessmentItem = this; + foreach (var item in _assessmentAdministrationParticipationAdministrationPointOfContacts) + if (item.AssessmentAdministrationParticipation == null) + item.AssessmentAdministrationParticipation = this; // ------------------------------------------------------------- - return _assessmentItemPossibleResponsesCovariant; + return _assessmentAdministrationParticipationAdministrationPointOfContactsCovariant; } set { - AssessmentItemPossibleResponses = new HashSet(value.Cast()); + AssessmentAdministrationParticipationAdministrationPointOfContacts = new HashSet(value.Cast()); } } @@ -9099,7 +13095,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentItemCategoryDescriptor", new LookupColumnDetails { PropertyName = "AssessmentItemCategoryDescriptorId", LookupTypeName = "AssessmentItemCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -9114,9 +13109,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values + keyValues.Add("AdministrationIdentifier", AdministrationIdentifier); keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); - keyValues.Add("IdentificationCode", IdentificationCode); + keyValues.Add("AssigningEducationOrganizationId", AssigningEducationOrganizationId); keyValues.Add("Namespace", Namespace); + keyValues.Add("ParticipatingEducationOrganizationId", ParticipatingEducationOrganizationId); return keyValues; } @@ -9180,12 +13177,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItem)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationParticipation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItem) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationParticipation) target, null); } } @@ -9193,19 +13190,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItemLearningStandard table of the AssessmentItem aggregate in the ODS database. + /// A class which represents the edfi.AssessmentAdministrationParticipationAdministrationPointOfContact table of the AssessmentAdministrationParticipation aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItemLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentItemLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentAdministrationParticipationAdministrationPointOfContact : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentItemLearningStandard() + public AssessmentAdministrationParticipationAdministrationPointOfContact() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -9213,17 +13211,21 @@ public AssessmentItemLearningStandard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentItem AssessmentItem { get; set; } + [DomainSignature, IgnoreMember] + public virtual AssessmentAdministrationParticipation AssessmentAdministrationParticipation { get; set; } - Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentItem + Entities.Common.EdFi.IAssessmentAdministrationParticipation IAssessmentAdministrationParticipationAdministrationPointOfContact.AssessmentAdministrationParticipation { - get { return AssessmentItem; } - set { AssessmentItem = (AssessmentItem) value; } + get { return AssessmentAdministrationParticipation; } + set { AssessmentAdministrationParticipation = (AssessmentAdministrationParticipation) value; } } [DomainSignature] - public virtual string LearningStandardId { get; set; } + [Key(1)] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + [Key(2)] + public virtual string ElectronicMailAddress { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -9234,6 +13236,12 @@ Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentI // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] + public virtual string FirstName { get; set; } + [Key(4)] + public virtual string LastSurname { get; set; } + [Key(5)] + public virtual string LoginId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -9246,14 +13254,27 @@ Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentI // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentAdministrationParticipation", "AssessmentAdministrationParticipationAdministrationPointOfContact")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -9272,29 +13293,70 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentAdministrationParticipation", "AssessmentAdministrationParticipationAdministrationPointOfContact")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + [Key(8)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardDiscriminator + string Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationDiscriminator { - get { return LearningStandardReferenceData?.Discriminator; } + get { return EducationOrganizationReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardResourceId + Guid? Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact.EducationOrganizationResourceId { - get { return LearningStandardReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Id; } set { } } @@ -9319,10 +13381,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentItem as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentAdministrationParticipation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); return keyValues; } @@ -9386,135 +13449,64 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItemLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentAdministrationParticipationAdministrationPointOfContact) target, null); } void IChildEntity.SetParent(object value) { - AssessmentItem = (AssessmentItem) value; + AssessmentAdministrationParticipation = (AssessmentAdministrationParticipation) value; } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 +} +// Aggregate: AssessmentBatteryPart +namespace EdFi.Ods.Entities.NHibernate.AssessmentBatteryPartAggregate.EdFi +{ /// - /// A class which represents the edfi.AssessmentItemPossibleResponse table of the AssessmentItem aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AssessmentItemPossibleResponse : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentItemPossibleResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentBatteryPartReferenceData : IHasPrimaryKeyValues { - public virtual void SuspendReferenceAssignmentCheck() { } - - public AssessmentItemPossibleResponse() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentItem AssessmentItem { get; set; } - - Entities.Common.EdFi.IAssessmentItem IAssessmentItemPossibleResponse.AssessmentItem - { - get { return AssessmentItem; } - set { AssessmentItem = (AssessmentItem) value; } - } - - [DomainSignature] - public virtual string ResponseValue { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual bool? CorrectResponse { get; set; } - public virtual string ResponseDescription { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + [Key(0)] + public virtual string AssessmentBatteryPartName { get; set; } + [Key(1)] + public virtual string AssessmentIdentifier { get; set; } + [Key(2)] + public virtual string Namespace { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(3)] + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(4)] + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (AssessmentItem as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ResponseValue", ResponseValue); + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); return keyValues; } @@ -9535,18 +13527,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -9563,96 +13545,54 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse) target, null); - } - - void IChildEntity.SetParent(object value) - { - AssessmentItem = (AssessmentItem) value; - } } -} -// Aggregate: AssessmentItemCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.AssessmentItemCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItemCategoryDescriptor table of the AssessmentItemCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentBatteryPart table of the AssessmentBatteryPart aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItemCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentItemCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentBatteryPart : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentBatteryPart, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentBatteryPart() + { + AssessmentBatteryPartObjectiveAssessments = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AssessmentItemCategoryDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + [Key(6)] + public virtual string AssessmentBatteryPartName { get; set; } + [DomainSignature] + [Key(7)] + public virtual string AssessmentIdentifier { get; set; } + [DomainSignature] + [Key(8)] + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -9668,16 +13608,173 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentBatteryPart", "AssessmentBatteryPart")] + [Key(9)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentBatteryPart", "AssessmentBatteryPart")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(11)] + public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentDiscriminator + { + get { return AssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentResourceId + { + get { return AssessmentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _assessmentBatteryPartObjectiveAssessments; + private ICollection _assessmentBatteryPartObjectiveAssessmentsCovariant; + [Key(12)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentBatteryPartObjectiveAssessments + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentBatteryPartObjectiveAssessments is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentBatteryPartObjectiveAssessments"); + } + + foreach (var item in _assessmentBatteryPartObjectiveAssessments) + if (item.AssessmentBatteryPart == null) + item.AssessmentBatteryPart = this; + // ------------------------------------------------------------- + + return _assessmentBatteryPartObjectiveAssessments; + } + set + { + _assessmentBatteryPartObjectiveAssessments = value; + _assessmentBatteryPartObjectiveAssessmentsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentBatteryPart.AssessmentBatteryPartObjectiveAssessments + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentBatteryPartObjectiveAssessments) + if (item.AssessmentBatteryPart == null) + item.AssessmentBatteryPart = this; + // ------------------------------------------------------------- + + return _assessmentBatteryPartObjectiveAssessmentsCovariant; + } + set + { + AssessmentBatteryPartObjectiveAssessments = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map @@ -9697,7 +13794,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentItemCategoryDescriptorId", AssessmentItemCategoryDescriptorId); + keyValues.Add("AssessmentBatteryPartName", AssessmentBatteryPartName); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); return keyValues; } @@ -9761,77 +13860,57 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentBatteryPart)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentBatteryPart) target, null); } } -} -// Aggregate: AssessmentItemResultDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AssessmentItemResultDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentItemResultDescriptor table of the AssessmentItemResultDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentBatteryPartObjectiveAssessment table of the AssessmentBatteryPart aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentItemResultDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentItemResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentBatteryPartObjectiveAssessment : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentBatteryPartObjectiveAssessment() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int AssessmentItemResultDescriptorId + [DomainSignature, IgnoreMember] + public virtual AssessmentBatteryPart AssessmentBatteryPart { get; set; } + + Entities.Common.EdFi.IAssessmentBatteryPart IAssessmentBatteryPartObjectiveAssessment.AssessmentBatteryPart { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return AssessmentBatteryPart; } + set { AssessmentBatteryPart = (AssessmentBatteryPart) value; } } - + + [DomainSignature] + [Key(1)] + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -9847,11 +13926,114 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentBatteryPart", "AssessmentBatteryPartObjectiveAssessment")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentBatteryPart", "AssessmentBatteryPartObjectiveAssessment")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] + public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentDiscriminator + { + get { return ObjectiveAssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment.ObjectiveAssessmentResourceId + { + get { return ObjectiveAssessmentReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -9872,11 +14054,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (AssessmentBatteryPart as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentItemResultDescriptorId", AssessmentItemResultDescriptorId); + keyValues.Add("IdentificationCode", IdentificationCode); return keyValues; } @@ -9940,37 +14122,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentBatteryPartObjectiveAssessment) target, null); } + void IChildEntity.SetParent(object value) + { + AssessmentBatteryPart = (AssessmentBatteryPart) value; + } } } -// Aggregate: AssessmentPeriodDescriptor +// Aggregate: AssessmentCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.AssessmentPeriodDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentPeriodDescriptor table of the AssessmentPeriodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentCategoryDescriptor table of the AssessmentCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AssessmentPeriodDescriptorId + [IgnoreMember] + public virtual int AssessmentCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -10055,7 +14243,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentPeriodDescriptorId", AssessmentPeriodDescriptorId); + keyValues.Add("AssessmentCategoryDescriptorId", AssessmentCategoryDescriptorId); return keyValues; } @@ -10119,37 +14307,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentCategoryDescriptor) target, null); } } } -// Aggregate: AssessmentReportingMethodDescriptor +// Aggregate: AssessmentIdentificationSystemDescriptor -namespace EdFi.Ods.Entities.NHibernate.AssessmentReportingMethodDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentIdentificationSystemDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentReportingMethodDescriptor table of the AssessmentReportingMethodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentIdentificationSystemDescriptor table of the AssessmentIdentificationSystemDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentReportingMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssessmentReportingMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AssessmentReportingMethodDescriptorId + [IgnoreMember] + public virtual int AssessmentIdentificationSystemDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -10234,7 +14424,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); + keyValues.Add("AssessmentIdentificationSystemDescriptorId", AssessmentIdentificationSystemDescriptorId); return keyValues; } @@ -10298,42 +14488,48 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentIdentificationSystemDescriptor) target, null); } } } -// Aggregate: AssessmentScoreRangeLearningStandard +// Aggregate: AssessmentItem -namespace EdFi.Ods.Entities.NHibernate.AssessmentScoreRangeLearningStandardAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentItemAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class AssessmentScoreRangeLearningStandardReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class AssessmentItemReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AssessmentIdentifier { get; set; } + [Key(1)] + public virtual string IdentificationCode { get; set; } + [Key(2)] public virtual string Namespace { get; set; } - public virtual string ScoreRangeId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -10344,8 +14540,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("IdentificationCode", IdentificationCode); keyValues.Add("Namespace", Namespace); - keyValues.Add("ScoreRangeId", ScoreRangeId); return keyValues; } @@ -10396,20 +14592,22 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentScoreRangeLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItem table of the AssessmentItem aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandard : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentItem : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentScoreRangeLearningStandard() + public AssessmentItem() { - AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentItemLearningStandards = new HashSet(); + AssessmentItemPossibleResponses = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -10418,11 +14616,14 @@ public AssessmentScoreRangeLearningStandard() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] - public virtual string Namespace { get; set; } + [Key(7)] + public virtual string IdentificationCode { get; set; } [DomainSignature] - public virtual string ScoreRangeId { get; set; } + [Key(8)] + public virtual string Namespace { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10433,43 +14634,52 @@ public AssessmentScoreRangeLearningStandard() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AssessmentReportingMethodDescriptorId + [Key(9)] + public virtual int? AssessmentItemCategoryDescriptorId { get { - if (_assessmentReportingMethodDescriptorId == default(int?)) - _assessmentReportingMethodDescriptorId = string.IsNullOrWhiteSpace(_assessmentReportingMethodDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + if (_assessmentItemCategoryDescriptorId == default(int?)) + _assessmentItemCategoryDescriptorId = string.IsNullOrWhiteSpace(_assessmentItemCategoryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptor); - return _assessmentReportingMethodDescriptorId; + return _assessmentItemCategoryDescriptorId; } set { - _assessmentReportingMethodDescriptorId = value; - _assessmentReportingMethodDescriptor = null; + _assessmentItemCategoryDescriptorId = value; + _assessmentItemCategoryDescriptor = null; } } - private int? _assessmentReportingMethodDescriptorId; - private string _assessmentReportingMethodDescriptor; + private int? _assessmentItemCategoryDescriptorId; + private string _assessmentItemCategoryDescriptor; - public virtual string AssessmentReportingMethodDescriptor + [IgnoreMember] + public virtual string AssessmentItemCategoryDescriptor { get { - if (_assessmentReportingMethodDescriptor == null) - _assessmentReportingMethodDescriptor = _assessmentReportingMethodDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId.Value); + if (_assessmentItemCategoryDescriptor == null) + _assessmentItemCategoryDescriptor = _assessmentItemCategoryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentItemCategoryDescriptor", _assessmentItemCategoryDescriptorId.Value); - return _assessmentReportingMethodDescriptor; + return _assessmentItemCategoryDescriptor; } set { - _assessmentReportingMethodDescriptor = value; - _assessmentReportingMethodDescriptorId = default(int?); + _assessmentItemCategoryDescriptor = value; + _assessmentItemCategoryDescriptorId = default(int?); } } - public virtual string IdentificationCode { get; set; } - public virtual string MaximumScore { get; set; } - public virtual string MinimumScore { get; set; } + [Key(10)] + public virtual string AssessmentItemURI { get; set; } + [Key(11)] + public virtual string ExpectedTimeAssessed { get; set; } + [Key(12)] + public virtual string ItemText { get; set; } + [Key(13)] + public virtual decimal? MaxRawScore { get; set; } + [Key(14)] + public virtual string Nomenclature { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10482,14 +14692,27 @@ public virtual string AssessmentReportingMethodDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentItem", "AssessmentItem")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -10508,18 +14731,59 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentItem", "AssessmentItem")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } /// /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDiscriminator + string Entities.Common.EdFi.IAssessmentItem.AssessmentDiscriminator { get { return AssessmentReferenceData?.Discriminator; } set { } @@ -10528,41 +14792,77 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDisc /// /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentResourceId + Guid? Entities.Common.EdFi.IAssessmentItem.AssessmentResourceId { get { return AssessmentReferenceData?.Id; } set { } } - public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } + // ------------------------------------------------------------- - /// - /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentDiscriminator + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _assessmentItemLearningStandards; + private ICollection _assessmentItemLearningStandardsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentItemLearningStandards { - get { return ObjectiveAssessmentReferenceData?.Discriminator; } - set { } + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_assessmentItemLearningStandards is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "AssessmentItemLearningStandards"); + } + + foreach (var item in _assessmentItemLearningStandards) + if (item.AssessmentItem == null) + item.AssessmentItem = this; + // ------------------------------------------------------------- + + return _assessmentItemLearningStandards; + } + set + { + _assessmentItemLearningStandards = value; + _assessmentItemLearningStandardsCovariant = new CovariantCollectionAdapter(value); + } } - /// - /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentResourceId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemLearningStandards { - get { return ObjectiveAssessmentReferenceData?.Id; } - set { } - } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _assessmentItemLearningStandards) + if (item.AssessmentItem == null) + item.AssessmentItem = this; + // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _assessmentItemLearningStandardsCovariant; + } + set + { + AssessmentItemLearningStandards = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _assessmentScoreRangeLearningStandardLearningStandards; - private ICollection _assessmentScoreRangeLearningStandardLearningStandardsCovariant; - public virtual ICollection AssessmentScoreRangeLearningStandardLearningStandards + private ICollection _assessmentItemPossibleResponses; + private ICollection _assessmentItemPossibleResponsesCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentItemPossibleResponses { get { @@ -10571,38 +14871,43 @@ public virtual ICollection set) + { + set.Reattach(this, "AssessmentItemPossibleResponses"); + } + + foreach (var item in _assessmentItemPossibleResponses) + if (item.AssessmentItem == null) + item.AssessmentItem = this; // ------------------------------------------------------------- - return _assessmentScoreRangeLearningStandardLearningStandards; + return _assessmentItemPossibleResponses; } set { - _assessmentScoreRangeLearningStandardLearningStandards = value; - _assessmentScoreRangeLearningStandardLearningStandardsCovariant = new CovariantCollectionAdapter(value); + _assessmentItemPossibleResponses = value; + _assessmentItemPossibleResponsesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentScoreRangeLearningStandardLearningStandards + ICollection Entities.Common.EdFi.IAssessmentItem.AssessmentItemPossibleResponses { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) - if (item.AssessmentScoreRangeLearningStandard == null) - item.AssessmentScoreRangeLearningStandard = this; + foreach (var item in _assessmentItemPossibleResponses) + if (item.AssessmentItem == null) + item.AssessmentItem = this; // ------------------------------------------------------------- - return _assessmentScoreRangeLearningStandardLearningStandardsCovariant; + return _assessmentItemPossibleResponsesCovariant; } set { - AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(value.Cast()); + AssessmentItemPossibleResponses = new HashSet(value.Cast()); } } @@ -10611,7 +14916,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, + { "AssessmentItemCategoryDescriptor", new LookupColumnDetails { PropertyName = "AssessmentItemCategoryDescriptorId", LookupTypeName = "AssessmentItemCategoryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -10627,8 +14932,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() // Add current key values keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("IdentificationCode", IdentificationCode); keyValues.Add("Namespace", Namespace); - keyValues.Add("ScoreRangeId", ScoreRangeId); return keyValues; } @@ -10692,12 +14997,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItem)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItem) target, null); } } @@ -10705,19 +15010,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssessmentScoreRangeLearningStandardLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItemLearningStandard table of the AssessmentItem aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssessmentScoreRangeLearningStandardLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentItemLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentItemLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public AssessmentScoreRangeLearningStandardLearningStandard() + public AssessmentItemLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -10725,16 +15031,17 @@ public AssessmentScoreRangeLearningStandardLearningStandard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual AssessmentScoreRangeLearningStandard AssessmentScoreRangeLearningStandard { get; set; } + [DomainSignature, IgnoreMember] + public virtual AssessmentItem AssessmentItem { get; set; } - Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard IAssessmentScoreRangeLearningStandardLearningStandard.AssessmentScoreRangeLearningStandard + Entities.Common.EdFi.IAssessmentItem IAssessmentItemLearningStandard.AssessmentItem { - get { return AssessmentScoreRangeLearningStandard; } - set { AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; } + get { return AssessmentItem; } + set { AssessmentItem = (AssessmentItem) value; } } [DomainSignature] + [Key(1)] public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- @@ -10758,14 +15065,27 @@ Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard IAssessmentScoreRange // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentItem", "AssessmentItemLearningStandard")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -10784,18 +15104,59 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentItem", "AssessmentItemLearningStandard")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } /// /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardDiscriminator + string Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardDiscriminator { get { return LearningStandardReferenceData?.Discriminator; } set { } @@ -10804,7 +15165,7 @@ string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandar /// /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardResourceId + Guid? Entities.Common.EdFi.IAssessmentItemLearningStandard.LearningStandardResourceId { get { return LearningStandardReferenceData?.Id; } set { } @@ -10831,7 +15192,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (AssessmentScoreRangeLearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentItem as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningStandardId", LearningStandardId); @@ -10898,86 +15259,70 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItemLearningStandard) target, null); } void IChildEntity.SetParent(object value) { - AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; + AssessmentItem = (AssessmentItem) value; } } -} -// Aggregate: AssignmentLateStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AssignmentLateStatusDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AssignmentLateStatusDescriptor table of the AssignmentLateStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItemPossibleResponse table of the AssessmentItem aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AssignmentLateStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAssignmentLateStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentItemPossibleResponse : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentItemPossibleResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public AssessmentItemPossibleResponse() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int AssignmentLateStatusDescriptorId + [DomainSignature, IgnoreMember] + public virtual AssessmentItem AssessmentItem { get; set; } + + Entities.Common.EdFi.IAssessmentItem IAssessmentItemPossibleResponse.AssessmentItem { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return AssessmentItem; } + set { AssessmentItem = (AssessmentItem) value; } } - + + [DomainSignature] + [Key(1)] + public virtual string ResponseValue { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual bool? CorrectResponse { get; set; } + [Key(3)] + public virtual string ResponseDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -10988,185 +15333,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("AssignmentLateStatusDescriptorId", AssignmentLateStatusDescriptorId); - - return keyValues; - } + private IDictionary _extensions; - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentItem", "AssessmentItemPossibleResponse")] + [Key(4)] + public IDictionary Extensions { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) + foreach (var key in _extensions.Keys) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) { - return false; + collection.ReattachExtension(this, (string) key); } } - else + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } } - } - return true; + _extensions = value; + } } - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + private IDictionary _aggregateExtensions; - foreach (DictionaryEntry entry in keyValues) + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentItem", "AssessmentItemPossibleResponse")] + [Key(5)] + public IDictionary AggregateExtensions + { + get { - if (entry.Value is string) + foreach (var key in _aggregateExtensions.Keys) { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } } - else + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) { - hashCode.Add(entry.Value); + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor) target, null); - } - - } -} -// Aggregate: AttemptStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.AttemptStatusDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.AttemptStatusDescriptor table of the AttemptStatusDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class AttemptStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAttemptStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int AttemptStatusDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + _aggregateExtensions = value; + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -11192,11 +15440,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (AssessmentItem as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AttemptStatusDescriptorId", AttemptStatusDescriptorId); + keyValues.Add("ResponseValue", ResponseValue); return keyValues; } @@ -11260,37 +15508,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IAttemptStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IAttemptStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItemPossibleResponse) target, null); } + void IChildEntity.SetParent(object value) + { + AssessmentItem = (AssessmentItem) value; + } } } -// Aggregate: AttendanceEventCategoryDescriptor +// Aggregate: AssessmentItemCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.AttendanceEventCategoryDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentItemCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.AttendanceEventCategoryDescriptor table of the AttendanceEventCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItemCategoryDescriptor table of the AssessmentItemCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class AttendanceEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IAttendanceEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentItemCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentItemCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int AttendanceEventCategoryDescriptorId + [IgnoreMember] + public virtual int AssessmentItemCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -11375,319 +15629,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AttendanceEventCategoryDescriptorId", AttendanceEventCategoryDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor) target, null); - } - - } -} -// Aggregate: BalanceSheetDimension - -namespace EdFi.Ods.Entities.NHibernate.BalanceSheetDimensionAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class BalanceSheetDimensionReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.BalanceSheetDimension table of the BalanceSheetDimension aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class BalanceSheetDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IBalanceSheetDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public BalanceSheetDimension() - { - BalanceSheetDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual string Code { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CodeName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _balanceSheetDimensionReportingTags; - private ICollection _balanceSheetDimensionReportingTagsCovariant; - public virtual ICollection BalanceSheetDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _balanceSheetDimensionReportingTags) - if (item.BalanceSheetDimension == null) - item.BalanceSheetDimension = this; - // ------------------------------------------------------------- - - return _balanceSheetDimensionReportingTags; - } - set - { - _balanceSheetDimensionReportingTags = value; - _balanceSheetDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBalanceSheetDimension.BalanceSheetDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _balanceSheetDimensionReportingTags) - if (item.BalanceSheetDimension == null) - item.BalanceSheetDimension = this; - // ------------------------------------------------------------- - - return _balanceSheetDimensionReportingTagsCovariant; - } - set - { - BalanceSheetDimensionReportingTags = new HashSet(value.Cast()); - } - } - - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("AssessmentItemCategoryDescriptorId", AssessmentItemCategoryDescriptorId); return keyValues; } @@ -11751,88 +15693,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBalanceSheetDimension) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItemCategoryDescriptor) target, null); } } +} +// Aggregate: AssessmentItemResultDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AssessmentItemResultDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BalanceSheetDimensionReportingTag table of the BalanceSheetDimension aggregate in the ODS database. + /// A class which represents the edfi.AssessmentItemResultDescriptor table of the AssessmentItemResultDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BalanceSheetDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBalanceSheetDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentItemResultDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentItemResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public BalanceSheetDimensionReportingTag() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual BalanceSheetDimension BalanceSheetDimension { get; set; } - - Entities.Common.EdFi.IBalanceSheetDimension IBalanceSheetDimensionReportingTag.BalanceSheetDimension - { - get { return BalanceSheetDimension; } - set { BalanceSheetDimension = (BalanceSheetDimension) value; } - } - [DomainSignature] - public virtual int ReportingTagDescriptorId - { - get - { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - - return _reportingTagDescriptorId; - } - set - { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; - } - } - - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; - - public virtual string ReportingTagDescriptor + [IgnoreMember] + public virtual int AssessmentItemResultDescriptorId { - get - { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - - return _reportingTagDescriptor; - } - set - { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -11848,35 +15781,6 @@ public virtual string ReportingTagDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -11892,7 +15796,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -11903,11 +15806,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (BalanceSheetDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("AssessmentItemResultDescriptorId", AssessmentItemResultDescriptorId); return keyValues; } @@ -11971,41 +15874,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentItemResultDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - BalanceSheetDimension = (BalanceSheetDimension) value; - } } } -// Aggregate: BarrierToInternetAccessInResidenceDescriptor +// Aggregate: AssessmentPeriodDescriptor -namespace EdFi.Ods.Entities.NHibernate.BarrierToInternetAccessInResidenceDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentPeriodDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BarrierToInternetAccessInResidenceDescriptor table of the BarrierToInternetAccessInResidenceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentPeriodDescriptor table of the AssessmentPeriodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BarrierToInternetAccessInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int BarrierToInternetAccessInResidenceDescriptorId + [IgnoreMember] + public virtual int AssessmentPeriodDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -12090,7 +15991,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BarrierToInternetAccessInResidenceDescriptorId", BarrierToInternetAccessInResidenceDescriptorId); + keyValues.Add("AssessmentPeriodDescriptorId", AssessmentPeriodDescriptorId); return keyValues; } @@ -12154,37 +16055,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentPeriodDescriptor) target, null); } } } -// Aggregate: BehaviorDescriptor +// Aggregate: AssessmentReportingMethodDescriptor -namespace EdFi.Ods.Entities.NHibernate.BehaviorDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentReportingMethodDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BehaviorDescriptor table of the BehaviorDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AssessmentReportingMethodDescriptor table of the AssessmentReportingMethodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BehaviorDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IBehaviorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AssessmentReportingMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssessmentReportingMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int BehaviorDescriptorId + [IgnoreMember] + public virtual int AssessmentReportingMethodDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -12269,7 +16172,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); return keyValues; } @@ -12333,41 +16236,48 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBehaviorDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBehaviorDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentReportingMethodDescriptor) target, null); } } } -// Aggregate: BellSchedule +// Aggregate: AssessmentScoreRangeLearningStandard -namespace EdFi.Ods.Entities.NHibernate.BellScheduleAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AssessmentScoreRangeLearningStandardAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class BellScheduleReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class AssessmentScoreRangeLearningStandardReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string BellScheduleName { get; set; } - public virtual long SchoolId { get; set; } + [Key(0)] + public virtual string AssessmentIdentifier { get; set; } + [Key(1)] + public virtual string Namespace { get; set; } + [Key(2)] + public virtual string ScoreRangeId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -12377,8 +16287,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BellScheduleName", BellScheduleName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + keyValues.Add("ScoreRangeId", ScoreRangeId); return keyValues; } @@ -12429,22 +16340,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellSchedule table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AssessmentScoreRangeLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellSchedule : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IBellSchedule, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentScoreRangeLearningStandard : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public BellSchedule() + public AssessmentScoreRangeLearningStandard() { - BellScheduleClassPeriods = new HashSet(); - BellScheduleDates = new HashSet(); - BellScheduleGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -12453,9 +16363,14 @@ public BellSchedule() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string BellScheduleName { get; set; } + [Key(6)] + public virtual string AssessmentIdentifier { get; set; } [DomainSignature] - public virtual long SchoolId { get; set; } + [Key(7)] + public virtual string Namespace { get; set; } + [DomainSignature] + [Key(8)] + public virtual string ScoreRangeId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12466,10 +16381,48 @@ public BellSchedule() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AlternateDayName { get; set; } - public virtual TimeSpan? EndTime { get; set; } - public virtual TimeSpan? StartTime { get; set; } - public virtual int? TotalInstructionalTime { get; set; } + [Key(9)] + public virtual int? AssessmentReportingMethodDescriptorId + { + get + { + if (_assessmentReportingMethodDescriptorId == default(int?)) + _assessmentReportingMethodDescriptorId = string.IsNullOrWhiteSpace(_assessmentReportingMethodDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptor); + + return _assessmentReportingMethodDescriptorId; + } + set + { + _assessmentReportingMethodDescriptorId = value; + _assessmentReportingMethodDescriptor = null; + } + } + + private int? _assessmentReportingMethodDescriptorId; + private string _assessmentReportingMethodDescriptor; + + [IgnoreMember] + public virtual string AssessmentReportingMethodDescriptor + { + get + { + if (_assessmentReportingMethodDescriptor == null) + _assessmentReportingMethodDescriptor = _assessmentReportingMethodDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AssessmentReportingMethodDescriptor", _assessmentReportingMethodDescriptorId.Value); + + return _assessmentReportingMethodDescriptor; + } + set + { + _assessmentReportingMethodDescriptor = value; + _assessmentReportingMethodDescriptorId = default(int?); + } + } + [Key(10)] + public virtual string IdentificationCode { get; set; } + [Key(11)] + public virtual string MaximumScore { get; set; } + [Key(12)] + public virtual string MinimumScore { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12482,14 +16435,27 @@ public BellSchedule() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandard")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -12501,133 +16467,112 @@ public IDictionary Extensions { value[key] = _extensions[key]; } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IBellSchedule.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _bellScheduleClassPeriods; - private ICollection _bellScheduleClassPeriodsCovariant; - public virtual ICollection BellScheduleClassPeriods - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleClassPeriods) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- - - return _bellScheduleClassPeriods; - } - set - { - _bellScheduleClassPeriods = value; - _bellScheduleClassPeriodsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleClassPeriods - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleClassPeriods) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- - - return _bellScheduleClassPeriodsCovariant; - } - set - { - BellScheduleClassPeriods = new HashSet(value.Cast()); + } + } + + _extensions = value; } } + private IDictionary _aggregateExtensions; - private ICollection _bellScheduleDates; - private ICollection _bellScheduleDatesCovariant; - public virtual ICollection BellScheduleDates - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandard")] + [Key(14)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleDates) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _bellScheduleDates; + return _aggregateExtensions; } set { - _bellScheduleDates = value; - _bellScheduleDatesCovariant = new CovariantCollectionAdapter(value); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleDates + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(15)] + public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } + + /// + /// Read-only property that allows the Assessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentDiscriminator { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _bellScheduleDates) - if (item.BellSchedule == null) - item.BellSchedule = this; - // ------------------------------------------------------------- + get { return AssessmentReferenceData?.Discriminator; } + set { } + } - return _bellScheduleDatesCovariant; - } - set - { - BellScheduleDates = new HashSet(value.Cast()); - } + /// + /// Read-only property that allows the Assessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentResourceId + { + get { return AssessmentReferenceData?.Id; } + set { } } + [Key(16)] + public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } - private ICollection _bellScheduleGradeLevels; - private ICollection _bellScheduleGradeLevelsCovariant; - public virtual ICollection BellScheduleGradeLevels + /// + /// Read-only property that allows the ObjectiveAssessment discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentDiscriminator + { + get { return ObjectiveAssessmentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ObjectiveAssessment resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.ObjectiveAssessmentResourceId + { + get { return ObjectiveAssessmentReferenceData?.Id; } + set { } + } + + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _assessmentScoreRangeLearningStandardLearningStandards; + private ICollection _assessmentScoreRangeLearningStandardLearningStandardsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection AssessmentScoreRangeLearningStandardLearningStandards { get { @@ -12636,38 +16581,43 @@ public virtual ICollection set) + { + set.Reattach(this, "AssessmentScoreRangeLearningStandardLearningStandards"); + } + + foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) + if (item.AssessmentScoreRangeLearningStandard == null) + item.AssessmentScoreRangeLearningStandard = this; // ------------------------------------------------------------- - return _bellScheduleGradeLevels; + return _assessmentScoreRangeLearningStandardLearningStandards; } set { - _bellScheduleGradeLevels = value; - _bellScheduleGradeLevelsCovariant = new CovariantCollectionAdapter(value); + _assessmentScoreRangeLearningStandardLearningStandards = value; + _assessmentScoreRangeLearningStandardLearningStandardsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleGradeLevels + ICollection Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard.AssessmentScoreRangeLearningStandardLearningStandards { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _bellScheduleGradeLevels) - if (item.BellSchedule == null) - item.BellSchedule = this; + foreach (var item in _assessmentScoreRangeLearningStandardLearningStandards) + if (item.AssessmentScoreRangeLearningStandard == null) + item.AssessmentScoreRangeLearningStandard = this; // ------------------------------------------------------------- - return _bellScheduleGradeLevelsCovariant; + return _assessmentScoreRangeLearningStandardLearningStandardsCovariant; } set { - BellScheduleGradeLevels = new HashSet(value.Cast()); + AssessmentScoreRangeLearningStandardLearningStandards = new HashSet(value.Cast()); } } @@ -12676,6 +16626,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AssessmentReportingMethodDescriptor", new LookupColumnDetails { PropertyName = "AssessmentReportingMethodDescriptorId", LookupTypeName = "AssessmentReportingMethodDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -12690,8 +16641,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BellScheduleName", BellScheduleName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); + keyValues.Add("Namespace", Namespace); + keyValues.Add("ScoreRangeId", ScoreRangeId); return keyValues; } @@ -12755,12 +16707,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellSchedule)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellSchedule) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard) target, null); } } @@ -12768,19 +16720,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellScheduleClassPeriod table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AssessmentScoreRangeLearningStandardLearningStandard table of the AssessmentScoreRangeLearningStandard aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellScheduleClassPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBellScheduleClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssessmentScoreRangeLearningStandardLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public BellScheduleClassPeriod() + public AssessmentScoreRangeLearningStandardLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -12788,17 +16741,18 @@ public BellScheduleClassPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual BellSchedule BellSchedule { get; set; } + [DomainSignature, IgnoreMember] + public virtual AssessmentScoreRangeLearningStandard AssessmentScoreRangeLearningStandard { get; set; } - Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule + Entities.Common.EdFi.IAssessmentScoreRangeLearningStandard IAssessmentScoreRangeLearningStandardLearningStandard.AssessmentScoreRangeLearningStandard { - get { return BellSchedule; } - set { BellSchedule = (BellSchedule) value; } + get { return AssessmentScoreRangeLearningStandard; } + set { AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; } } [DomainSignature] - public virtual string ClassPeriodName { get; set; } + [Key(1)] + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -12821,14 +16775,27 @@ Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandardLearningStandard")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -12847,29 +16814,70 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "AssessmentScoreRangeLearningStandard", "AssessmentScoreRangeLearningStandardLearningStandard")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } + [Key(4)] + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } /// - /// Read-only property that allows the ClassPeriod discriminator value to be mapped to the resource reference. + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator + string Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardDiscriminator { - get { return ClassPeriodReferenceData?.Discriminator; } + get { return LearningStandardReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the ClassPeriod resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodResourceId + Guid? Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard.LearningStandardResourceId { - get { return ClassPeriodReferenceData?.Id; } + get { return LearningStandardReferenceData?.Id; } set { } } @@ -12894,10 +16902,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (AssessmentScoreRangeLearningStandard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("ClassPeriodName", ClassPeriodName); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -12961,67 +16969,83 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleClassPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellScheduleClassPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IAssessmentScoreRangeLearningStandardLearningStandard) target, null); } void IChildEntity.SetParent(object value) { - BellSchedule = (BellSchedule) value; + AssessmentScoreRangeLearningStandard = (AssessmentScoreRangeLearningStandard) value; } } +} +// Aggregate: AssignmentLateStatusDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AssignmentLateStatusDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellScheduleDate table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AssignmentLateStatusDescriptor table of the AssignmentLateStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellScheduleDate : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBellScheduleDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AssignmentLateStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAssignmentLateStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public BellScheduleDate() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual BellSchedule BellSchedule { get; set; } - - Entities.Common.EdFi.IBellSchedule IBellScheduleDate.BellSchedule - { - get { return BellSchedule; } - set { BellSchedule = (BellSchedule) value; } - } - [DomainSignature] - public virtual DateTime Date + [IgnoreMember] + public virtual int AssignmentLateStatusDescriptorId { - get { return _date; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _date = new DateTime(value.Year, value.Month, value.Day); } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - private DateTime _date; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -13037,35 +17061,6 @@ public virtual DateTime Date // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13091,11 +17086,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Date", Date); + keyValues.Add("AssignmentLateStatusDescriptorId", AssignmentLateStatusDescriptorId); return keyValues; } @@ -13159,92 +17154,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleDate)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellScheduleDate) target, null); + this.MapTo((Entities.Common.EdFi.IAssignmentLateStatusDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - BellSchedule = (BellSchedule) value; - } } +} +// Aggregate: AttemptStatusDescriptor + +namespace EdFi.Ods.Entities.NHibernate.AttemptStatusDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BellScheduleGradeLevel table of the BellSchedule aggregate in the ODS database. + /// A class which represents the edfi.AttemptStatusDescriptor table of the AttemptStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BellScheduleGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IBellScheduleGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class AttemptStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAttemptStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public BellScheduleGradeLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual BellSchedule BellSchedule { get; set; } - - Entities.Common.EdFi.IBellSchedule IBellScheduleGradeLevel.BellSchedule - { - get { return BellSchedule; } - set { BellSchedule = (BellSchedule) value; } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + [IgnoreMember] + public virtual int AttemptStatusDescriptorId { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -13260,35 +17242,6 @@ public virtual string GradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13304,7 +17257,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -13315,11 +17267,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (BellSchedule as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("AttemptStatusDescriptorId", AttemptStatusDescriptorId); return keyValues; } @@ -13383,41 +17335,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAttemptStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBellScheduleGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IAttemptStatusDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - BellSchedule = (BellSchedule) value; - } } } -// Aggregate: BusRouteDescriptor +// Aggregate: AttendanceEventCategoryDescriptor -namespace EdFi.Ods.Entities.NHibernate.BusRouteDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.AttendanceEventCategoryDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.BusRouteDescriptor table of the BusRouteDescriptor aggregate in the ODS database. + /// A class which represents the edfi.AttendanceEventCategoryDescriptor table of the AttendanceEventCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class BusRouteDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IBusRouteDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class AttendanceEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IAttendanceEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int BusRouteDescriptorId + [IgnoreMember] + public virtual int AttendanceEventCategoryDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -13502,7 +17452,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BusRouteDescriptorId", BusRouteDescriptorId); + keyValues.Add("AttendanceEventCategoryDescriptorId", AttendanceEventCategoryDescriptorId); return keyValues; } @@ -13566,42 +17516,46 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IBusRouteDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IBusRouteDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IAttendanceEventCategoryDescriptor) target, null); } } } -// Aggregate: Calendar +// Aggregate: BalanceSheetDimension -namespace EdFi.Ods.Entities.NHibernate.CalendarAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.BalanceSheetDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CalendarReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class BalanceSheetDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CalendarCode { get; set; } - public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } + [Key(0)] + public virtual string Code { get; set; } + [Key(1)] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -13611,9 +17565,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -13664,20 +17617,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Calendar table of the Calendar aggregate in the ODS database. + /// A class which represents the edfi.BalanceSheetDimension table of the BalanceSheetDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Calendar : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICalendar, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class BalanceSheetDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IBalanceSheetDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Calendar() + public BalanceSheetDimension() { - CalendarGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + BalanceSheetDimensionReportingTags = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -13686,11 +17640,11 @@ public Calendar() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CalendarCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } + [Key(6)] + public virtual string Code { get; set; } [DomainSignature] - public virtual short SchoolYear { get; set; } + [Key(7)] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -13701,42 +17655,340 @@ public Calendar() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int CalendarTypeDescriptorId + [Key(8)] + public virtual string CodeName { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "BalanceSheetDimension", "BalanceSheetDimension")] + [Key(9)] + public IDictionary Extensions { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "BalanceSheetDimension", "BalanceSheetDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { get { - if (_calendarTypeDescriptorId == default(int)) - _calendarTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarTypeDescriptor", _calendarTypeDescriptor); + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _calendarTypeDescriptorId; + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _balanceSheetDimensionReportingTags; + private ICollection _balanceSheetDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection BalanceSheetDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_balanceSheetDimensionReportingTags is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "BalanceSheetDimensionReportingTags"); + } + + foreach (var item in _balanceSheetDimensionReportingTags) + if (item.BalanceSheetDimension == null) + item.BalanceSheetDimension = this; + // ------------------------------------------------------------- + + return _balanceSheetDimensionReportingTags; + } + set + { + _balanceSheetDimensionReportingTags = value; + _balanceSheetDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBalanceSheetDimension.BalanceSheetDimensionReportingTags + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _balanceSheetDimensionReportingTags) + if (item.BalanceSheetDimension == null) + item.BalanceSheetDimension = this; + // ------------------------------------------------------------- + + return _balanceSheetDimensionReportingTagsCovariant; + } + set + { + BalanceSheetDimensionReportingTags = new HashSet(value.Cast()); + } + } + + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimension)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IBalanceSheetDimension) target, null); + } + + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.BalanceSheetDimensionReportingTag table of the BalanceSheetDimension aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class BalanceSheetDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBalanceSheetDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public BalanceSheetDimensionReportingTag() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual BalanceSheetDimension BalanceSheetDimension { get; set; } + + Entities.Common.EdFi.IBalanceSheetDimension IBalanceSheetDimensionReportingTag.BalanceSheetDimension + { + get { return BalanceSheetDimension; } + set { BalanceSheetDimension = (BalanceSheetDimension) value; } + } + + [DomainSignature] + [Key(1)] + public virtual int ReportingTagDescriptorId + { + get + { + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + + return _reportingTagDescriptorId; } set { - _calendarTypeDescriptorId = value; - _calendarTypeDescriptor = null; + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; } } - private int _calendarTypeDescriptorId; - private string _calendarTypeDescriptor; + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; - public virtual string CalendarTypeDescriptor + [IgnoreMember] + public virtual string ReportingTagDescriptor { get { - if (_calendarTypeDescriptor == null) - _calendarTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarTypeDescriptor", _calendarTypeDescriptorId); + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - return _calendarTypeDescriptor; + return _reportingTagDescriptor; } set { - _calendarTypeDescriptor = value; - _calendarTypeDescriptorId = default(int); + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -13747,14 +17999,27 @@ public virtual string CalendarTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "BalanceSheetDimension", "BalanceSheetDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -13773,92 +18038,248 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "BalanceSheetDimension", "BalanceSheetDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + // ------------------------------------------------------------- - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICalendar.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + }; - /// - /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICalendar.SchoolYearTypeResourceId + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get { return SchoolYearTypeReferenceData?.Id; } - set { } + get { return _idPropertyByLookupProperty; } } - // ------------------------------------------------------------- + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Get parent key values + var keyValues = (BalanceSheetDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); - //============================================================= - // Collections - // ------------------------------------------------------------- + // Add current key values + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); - private ICollection _calendarGradeLevels; - private ICollection _calendarGradeLevelsCovariant; - public virtual ICollection CalendarGradeLevels + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _calendarGradeLevels) - if (item.Calendar == null) - item.Calendar = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _calendarGradeLevels; - } - set + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _calendarGradeLevels = value; - _calendarGradeLevelsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICalendar.CalendarGradeLevels + public override int GetHashCode() { - get + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _calendarGradeLevels) - if (item.Calendar == null) - item.Calendar = this; - // ------------------------------------------------------------- + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } + } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IBalanceSheetDimensionReportingTag) target, null); + } + + void IChildEntity.SetParent(object value) + { + BalanceSheetDimension = (BalanceSheetDimension) value; + } + } +} +// Aggregate: BarrierToInternetAccessInResidenceDescriptor + +namespace EdFi.Ods.Entities.NHibernate.BarrierToInternetAccessInResidenceDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.BarrierToInternetAccessInResidenceDescriptor table of the BarrierToInternetAccessInResidenceDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class BarrierToInternetAccessInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int BarrierToInternetAccessInResidenceDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _calendarGradeLevelsCovariant; - } - set - { - CalendarGradeLevels = new HashSet(value.Cast()); - } - } + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CalendarTypeDescriptor", new LookupColumnDetails { PropertyName = "CalendarTypeDescriptorId", LookupTypeName = "CalendarTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -13873,9 +18294,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("BarrierToInternetAccessInResidenceDescriptorId", BarrierToInternetAccessInResidenceDescriptorId); return keyValues; } @@ -13939,88 +18358,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendar)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendar) target, null); + this.MapTo((Entities.Common.EdFi.IBarrierToInternetAccessInResidenceDescriptor) target, null); } } +} +// Aggregate: BehaviorDescriptor + +namespace EdFi.Ods.Entities.NHibernate.BehaviorDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarGradeLevel table of the Calendar aggregate in the ODS database. + /// A class which represents the edfi.BehaviorDescriptor table of the BehaviorDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICalendarGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class BehaviorDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IBehaviorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CalendarGradeLevel() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Calendar Calendar { get; set; } - - Entities.Common.EdFi.ICalendar ICalendarGradeLevel.Calendar - { - get { return Calendar; } - set { Calendar = (Calendar) value; } - } - [DomainSignature] - public virtual int GradeLevelDescriptorId - { - get - { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - - return _gradeLevelDescriptorId; - } - set - { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; - } - } - - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; - - public virtual string GradeLevelDescriptor + [IgnoreMember] + public virtual int BehaviorDescriptorId { - get - { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - - return _gradeLevelDescriptor; - } - set - { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -14036,35 +18446,6 @@ public virtual string GradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -14080,7 +18461,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -14091,11 +18471,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Calendar as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); return keyValues; } @@ -14159,47 +18539,46 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBehaviorDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IBehaviorDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Calendar = (Calendar) value; - } } } -// Aggregate: CalendarDate +// Aggregate: BellSchedule -namespace EdFi.Ods.Entities.NHibernate.CalendarDateAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.BellScheduleAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CalendarDateReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class BellScheduleReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CalendarCode { get; set; } - public virtual DateTime Date { get; set; } + [Key(0)] + public virtual string BellScheduleName { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -14209,10 +18588,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("Date", Date); + keyValues.Add("BellScheduleName", BellScheduleName); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -14263,20 +18640,23 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarDate table of the CalendarDate aggregate in the ODS database. + /// A class which represents the edfi.BellSchedule table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarDate : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICalendarDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class BellSchedule : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IBellSchedule, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CalendarDate() + public BellSchedule() { - CalendarDateCalendarEvents = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + BellScheduleClassPeriods = new HashSet(); + BellScheduleDates = new HashSet(); + BellScheduleGradeLevels = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -14285,21 +18665,11 @@ public CalendarDate() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CalendarCode { get; set; } - [DomainSignature] - public virtual DateTime Date - { - get { return _date; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _date = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _date; - + [Key(6)] + public virtual string BellScheduleName { get; set; } [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -14310,6 +18680,14 @@ public virtual DateTime Date // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] + public virtual string AlternateDayName { get; set; } + [Key(9)] + public virtual TimeSpan? EndTime { get; set; } + [Key(10)] + public virtual TimeSpan? StartTime { get; set; } + [Key(11)] + public virtual int? TotalInstructionalTime { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -14322,14 +18700,27 @@ public virtual DateTime Date // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "BellSchedule", "BellSchedule")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -14348,29 +18739,61 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "BellSchedule", "BellSchedule")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.CalendarAggregate.EdFi.CalendarReferenceData CalendarReferenceData { get; set; } - - /// - /// Read-only property that allows the Calendar discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator - { - get { return CalendarReferenceData?.Discriminator; } - set { } - } + [Key(14)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the Calendar resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICalendarDate.CalendarResourceId + Guid? Entities.Common.EdFi.IBellSchedule.SchoolResourceId { - get { return CalendarReferenceData?.Id; } + get { return SchoolReferenceData?.Id; } set { } } @@ -14380,9 +18803,11 @@ string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _calendarDateCalendarEvents; - private ICollection _calendarDateCalendarEventsCovariant; - public virtual ICollection CalendarDateCalendarEvents + private ICollection _bellScheduleClassPeriods; + private ICollection _bellScheduleClassPeriodsCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection BellScheduleClassPeriods { get { @@ -14391,38 +18816,151 @@ public virtual ICollection set) + { + set.Reattach(this, "BellScheduleClassPeriods"); + } + + foreach (var item in _bellScheduleClassPeriods) + if (item.BellSchedule == null) + item.BellSchedule = this; // ------------------------------------------------------------- - return _calendarDateCalendarEvents; + return _bellScheduleClassPeriods; } set { - _calendarDateCalendarEvents = value; - _calendarDateCalendarEventsCovariant = new CovariantCollectionAdapter(value); + _bellScheduleClassPeriods = value; + _bellScheduleClassPeriodsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICalendarDate.CalendarDateCalendarEvents + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleClassPeriods { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _calendarDateCalendarEvents) - if (item.CalendarDate == null) - item.CalendarDate = this; + foreach (var item in _bellScheduleClassPeriods) + if (item.BellSchedule == null) + item.BellSchedule = this; // ------------------------------------------------------------- - return _calendarDateCalendarEventsCovariant; + return _bellScheduleClassPeriodsCovariant; } set { - CalendarDateCalendarEvents = new HashSet(value.Cast()); + BellScheduleClassPeriods = new HashSet(value.Cast()); + } + } + + + private ICollection _bellScheduleDates; + private ICollection _bellScheduleDatesCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection BellScheduleDates + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_bellScheduleDates is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "BellScheduleDates"); + } + + foreach (var item in _bellScheduleDates) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleDates; + } + set + { + _bellScheduleDates = value; + _bellScheduleDatesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleDates + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _bellScheduleDates) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleDatesCovariant; + } + set + { + BellScheduleDates = new HashSet(value.Cast()); + } + } + + + private ICollection _bellScheduleGradeLevels; + private ICollection _bellScheduleGradeLevelsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection BellScheduleGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_bellScheduleGradeLevels is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "BellScheduleGradeLevels"); + } + + foreach (var item in _bellScheduleGradeLevels) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleGradeLevels; + } + set + { + _bellScheduleGradeLevels = value; + _bellScheduleGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IBellSchedule.BellScheduleGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _bellScheduleGradeLevels) + if (item.BellSchedule == null) + item.BellSchedule = this; + // ------------------------------------------------------------- + + return _bellScheduleGradeLevelsCovariant; + } + set + { + BellScheduleGradeLevels = new HashSet(value.Cast()); } } @@ -14445,10 +18983,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarCode", CalendarCode); - keyValues.Add("Date", Date); + keyValues.Add("BellScheduleName", BellScheduleName); keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -14512,12 +19048,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDate)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellSchedule)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarDate) target, null); + this.MapTo((Entities.Common.EdFi.IBellSchedule) target, null); } } @@ -14525,19 +19061,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarDateCalendarEvent table of the CalendarDate aggregate in the ODS database. + /// A class which represents the edfi.BellScheduleClassPeriod table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarDateCalendarEvent : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICalendarDateCalendarEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class BellScheduleClassPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBellScheduleClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CalendarDateCalendarEvent() + public BellScheduleClassPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -14545,50 +19082,18 @@ public CalendarDateCalendarEvent() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CalendarDate CalendarDate { get; set; } + [DomainSignature, IgnoreMember] + public virtual BellSchedule BellSchedule { get; set; } - Entities.Common.EdFi.ICalendarDate ICalendarDateCalendarEvent.CalendarDate + Entities.Common.EdFi.IBellSchedule IBellScheduleClassPeriod.BellSchedule { - get { return CalendarDate; } - set { CalendarDate = (CalendarDate) value; } + get { return BellSchedule; } + set { BellSchedule = (BellSchedule) value; } } [DomainSignature] - public virtual int CalendarEventDescriptorId - { - get - { - if (_calendarEventDescriptorId == default(int)) - _calendarEventDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarEventDescriptor", _calendarEventDescriptor); - - return _calendarEventDescriptorId; - } - set - { - _calendarEventDescriptorId = value; - _calendarEventDescriptor = null; - } - } - - private int _calendarEventDescriptorId; - private string _calendarEventDescriptor; - - public virtual string CalendarEventDescriptor - { - get - { - if (_calendarEventDescriptor == null) - _calendarEventDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarEventDescriptor", _calendarEventDescriptorId); - - return _calendarEventDescriptor; - } - set - { - _calendarEventDescriptor = value; - _calendarEventDescriptorId = default(int); - } - } + [Key(1)] + public virtual string ClassPeriodName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -14611,14 +19116,27 @@ public virtual string CalendarEventDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "BellSchedule", "BellScheduleClassPeriod")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -14637,12 +19155,73 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "BellSchedule", "BellScheduleClassPeriod")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] + public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } + + /// + /// Read-only property that allows the ClassPeriod discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodDiscriminator + { + get { return ClassPeriodReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ClassPeriod resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IBellScheduleClassPeriod.ClassPeriodResourceId + { + get { return ClassPeriodReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -14653,7 +19232,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CalendarEventDescriptor", new LookupColumnDetails { PropertyName = "CalendarEventDescriptorId", LookupTypeName = "CalendarEventDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -14665,10 +19243,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CalendarDate as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (BellSchedule as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); + keyValues.Add("ClassPeriodName", ClassPeriodName); return keyValues; } @@ -14732,81 +19310,69 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDateCalendarEvent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleClassPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarDateCalendarEvent) target, null); + this.MapTo((Entities.Common.EdFi.IBellScheduleClassPeriod) target, null); } void IChildEntity.SetParent(object value) { - CalendarDate = (CalendarDate) value; + BellSchedule = (BellSchedule) value; } } -} -// Aggregate: CalendarEventDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CalendarEventDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarEventDescriptor table of the CalendarEventDescriptor aggregate in the ODS database. + /// A class which represents the edfi.BellScheduleDate table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarEventDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICalendarEventDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class BellScheduleDate : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBellScheduleDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public BellScheduleDate() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual BellSchedule BellSchedule { get; set; } + + Entities.Common.EdFi.IBellSchedule IBellScheduleDate.BellSchedule + { + get { return BellSchedule; } + set { BellSchedule = (BellSchedule) value; } + } + [DomainSignature] - public virtual int CalendarEventDescriptorId + [Key(1)] + public virtual DateTime Date { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _date; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _date = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _date; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -14822,6 +19388,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "BellSchedule", "BellScheduleDate")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "BellSchedule", "BellScheduleDate")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -14847,11 +19495,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (BellSchedule as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); + keyValues.Add("Date", Date); return keyValues; } @@ -14915,79 +19563,97 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarEventDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleDate)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarEventDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IBellScheduleDate) target, null); } + void IChildEntity.SetParent(object value) + { + BellSchedule = (BellSchedule) value; + } } -} -// Aggregate: CalendarTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CalendarTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CalendarTypeDescriptor table of the CalendarTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.BellScheduleGradeLevel table of the BellSchedule aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CalendarTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICalendarTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class BellScheduleGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IBellScheduleGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CalendarTypeDescriptorId + public BellScheduleGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual BellSchedule BellSchedule { get; set; } + + Entities.Common.EdFi.IBellSchedule IBellScheduleGradeLevel.BellSchedule { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return BellSchedule; } + set { BellSchedule = (BellSchedule) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + [IgnoreMember] + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -15001,6 +19667,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "BellSchedule", "BellScheduleGradeLevel")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "BellSchedule", "BellScheduleGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -15016,6 +19764,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -15026,11 +19775,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (BellSchedule as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CalendarTypeDescriptorId", CalendarTypeDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -15094,37 +19843,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICalendarTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBellScheduleGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICalendarTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IBellScheduleGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + BellSchedule = (BellSchedule) value; + } } } -// Aggregate: CareerPathwayDescriptor +// Aggregate: BusRouteDescriptor -namespace EdFi.Ods.Entities.NHibernate.CareerPathwayDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.BusRouteDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CareerPathwayDescriptor table of the CareerPathwayDescriptor aggregate in the ODS database. + /// A class which represents the edfi.BusRouteDescriptor table of the BusRouteDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CareerPathwayDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICareerPathwayDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class BusRouteDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IBusRouteDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CareerPathwayDescriptorId + [IgnoreMember] + public virtual int BusRouteDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -15209,7 +19964,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CareerPathwayDescriptorId", CareerPathwayDescriptorId); + keyValues.Add("BusRouteDescriptorId", BusRouteDescriptorId); return keyValues; } @@ -15273,107 +20028,373 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICareerPathwayDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IBusRouteDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICareerPathwayDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IBusRouteDescriptor) target, null); } } } -// Aggregate: CharterApprovalAgencyTypeDescriptor +// Aggregate: Calendar -namespace EdFi.Ods.Entities.NHibernate.CharterApprovalAgencyTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class CalendarReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual string CalendarCode { get; set; } + [Key(1)] + public virtual long SchoolId { get; set; } + [Key(2)] + public virtual short SchoolYear { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(3)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(4)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CharterApprovalAgencyTypeDescriptor table of the CharterApprovalAgencyTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.Calendar table of the Calendar aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CharterApprovalAgencyTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class Calendar : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICalendar, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public Calendar() + { + CalendarGradeLevels = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CharterApprovalAgencyTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + [Key(6)] + public virtual string CalendarCode { get; set; } + [DomainSignature] + [Key(7)] + public virtual long SchoolId { get; set; } + [DomainSignature] + [Key(8)] + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(9)] + public virtual int CalendarTypeDescriptorId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_calendarTypeDescriptorId == default(int)) + _calendarTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarTypeDescriptor", _calendarTypeDescriptor); + + return _calendarTypeDescriptorId; + } + set + { + _calendarTypeDescriptorId = value; + _calendarTypeDescriptor = null; + } } - string IDescriptor.Namespace + + private int _calendarTypeDescriptorId; + private string _calendarTypeDescriptor; + + [IgnoreMember] + public virtual string CalendarTypeDescriptor { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_calendarTypeDescriptor == null) + _calendarTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarTypeDescriptor", _calendarTypeDescriptorId); + + return _calendarTypeDescriptor; + } + set + { + _calendarTypeDescriptor = value; + _calendarTypeDescriptorId = default(int); + } } - string IDescriptor.ShortDescription + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Calendar", "Calendar")] + [Key(10)] + public IDictionary Extensions { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Calendar", "Calendar")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICalendar.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } + } + + [Key(13)] + public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } + + /// + /// Read-only property that allows the SchoolYearType resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICalendar.SchoolYearTypeResourceId + { + get { return SchoolYearTypeReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _calendarGradeLevels; + private ICollection _calendarGradeLevelsCovariant; + [Key(14)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CalendarGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_calendarGradeLevels is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CalendarGradeLevels"); + } + + foreach (var item in _calendarGradeLevels) + if (item.Calendar == null) + item.Calendar = this; + // ------------------------------------------------------------- + + return _calendarGradeLevels; + } + set + { + _calendarGradeLevels = value; + _calendarGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICalendar.CalendarGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _calendarGradeLevels) + if (item.Calendar == null) + item.Calendar = this; + // ------------------------------------------------------------- + + return _calendarGradeLevelsCovariant; + } + set + { + CalendarGradeLevels = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CalendarTypeDescriptor", new LookupColumnDetails { PropertyName = "CalendarTypeDescriptorId", LookupTypeName = "CalendarTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -15388,7 +20409,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CharterApprovalAgencyTypeDescriptorId", CharterApprovalAgencyTypeDescriptorId); + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -15452,79 +20475,93 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendar)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICalendar) target, null); } } -} -// Aggregate: CharterStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CharterStatusDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CharterStatusDescriptor table of the CharterStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CalendarGradeLevel table of the Calendar aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CharterStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICharterStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CalendarGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICalendarGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CharterStatusDescriptorId + public CalendarGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual Calendar Calendar { get; set; } + + Entities.Common.EdFi.ICalendar ICalendarGradeLevel.Calendar { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Calendar; } + set { Calendar = (Calendar) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + [IgnoreMember] + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -15538,6 +20575,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Calendar", "CalendarGradeLevel")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Calendar", "CalendarGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -15553,6 +20672,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -15563,11 +20683,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Calendar as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CharterStatusDescriptorId", CharterStatusDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -15631,42 +20751,54 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICharterStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICharterStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + Calendar = (Calendar) value; + } } } -// Aggregate: ChartOfAccount +// Aggregate: CalendarDate -namespace EdFi.Ods.Entities.NHibernate.ChartOfAccountAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarDateAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class ChartOfAccountReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class CalendarDateReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string AccountIdentifier { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int FiscalYear { get; set; } + [Key(0)] + public virtual string CalendarCode { get; set; } + [Key(1)] + public virtual DateTime Date { get; set; } + [Key(2)] + public virtual long SchoolId { get; set; } + [Key(3)] + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -15676,9 +20808,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("Date", Date); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -15729,20 +20862,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ChartOfAccount table of the ChartOfAccount aggregate in the ODS database. + /// A class which represents the edfi.CalendarDate table of the CalendarDate aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ChartOfAccount : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IChartOfAccount, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CalendarDate : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICalendarDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ChartOfAccount() + public CalendarDate() { - ChartOfAccountReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CalendarDateCalendarEvents = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -15751,11 +20885,25 @@ public ChartOfAccount() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string AccountIdentifier { get; set; } + [Key(6)] + public virtual string CalendarCode { get; set; } [DomainSignature] - public virtual long EducationOrganizationId { get; set; } + [Key(7)] + public virtual DateTime Date + { + get { return _date; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _date = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _date; + [DomainSignature] - public virtual int FiscalYear { get; set; } + [Key(8)] + public virtual long SchoolId { get; set; } + [DomainSignature] + [Key(9)] + public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15766,49 +20914,6 @@ public ChartOfAccount() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AccountName { get; set; } - public virtual int AccountTypeDescriptorId - { - get - { - if (_accountTypeDescriptorId == default(int)) - _accountTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccountTypeDescriptor", _accountTypeDescriptor); - - return _accountTypeDescriptorId; - } - set - { - _accountTypeDescriptorId = value; - _accountTypeDescriptor = null; - } - } - - private int _accountTypeDescriptorId; - private string _accountTypeDescriptor; - - public virtual string AccountTypeDescriptor - { - get - { - if (_accountTypeDescriptor == null) - _accountTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccountTypeDescriptor", _accountTypeDescriptorId); - - return _accountTypeDescriptor; - } - set - { - _accountTypeDescriptor = value; - _accountTypeDescriptorId = default(int); - } - } - public virtual string BalanceSheetCode { get; set; } - public virtual string FunctionCode { get; set; } - public virtual string FundCode { get; set; } - public virtual string ObjectCode { get; set; } - public virtual string OperationalUnitCode { get; set; } - public virtual string ProgramCode { get; set; } - public virtual string ProjectCode { get; set; } - public virtual string SourceCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -15821,14 +20926,27 @@ public virtual string AccountTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CalendarDate", "CalendarDate")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -15847,189 +20965,70 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.BalanceSheetDimensionAggregate.EdFi.BalanceSheetDimensionReferenceData BalanceSheetDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the BalanceSheetDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionDiscriminator - { - get { return BalanceSheetDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the BalanceSheetDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionResourceId - { - get { return BalanceSheetDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.FunctionDimensionAggregate.EdFi.FunctionDimensionReferenceData FunctionDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the FunctionDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.FunctionDimensionDiscriminator - { - get { return FunctionDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the FunctionDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.FunctionDimensionResourceId - { - get { return FunctionDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.FundDimensionAggregate.EdFi.FundDimensionReferenceData FundDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the FundDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.FundDimensionDiscriminator - { - get { return FundDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the FundDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.FundDimensionResourceId - { - get { return FundDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ObjectDimensionAggregate.EdFi.ObjectDimensionReferenceData ObjectDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the ObjectDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.ObjectDimensionDiscriminator - { - get { return ObjectDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ObjectDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.ObjectDimensionResourceId - { - get { return ObjectDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.OperationalUnitDimensionAggregate.EdFi.OperationalUnitDimensionReferenceData OperationalUnitDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the OperationalUnitDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionDiscriminator - { - get { return OperationalUnitDimensionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the OperationalUnitDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionResourceId - { - get { return OperationalUnitDimensionReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ProgramDimensionAggregate.EdFi.ProgramDimensionReferenceData ProgramDimensionReferenceData { get; set; } - - /// - /// Read-only property that allows the ProgramDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.ProgramDimensionDiscriminator - { - get { return ProgramDimensionReferenceData?.Discriminator; } - set { } - } + private IDictionary _aggregateExtensions; - /// - /// Read-only property that allows the ProgramDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.ProgramDimensionResourceId - { - get { return ProgramDimensionReferenceData?.Id; } - set { } - } + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CalendarDate", "CalendarDate")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - public virtual NHibernate.ProjectDimensionAggregate.EdFi.ProjectDimensionReferenceData ProjectDimensionReferenceData { get; set; } + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - /// - /// Read-only property that allows the ProjectDimension discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IChartOfAccount.ProjectDimensionDiscriminator - { - get { return ProjectDimensionReferenceData?.Discriminator; } - set { } + _aggregateExtensions = value; + } } - /// - /// Read-only property that allows the ProjectDimension resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IChartOfAccount.ProjectDimensionResourceId - { - get { return ProjectDimensionReferenceData?.Id; } - set { } - } + // ------------------------------------------------------------- - public virtual NHibernate.SourceDimensionAggregate.EdFi.SourceDimensionReferenceData SourceDimensionReferenceData { get; set; } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(12)] + public virtual NHibernate.CalendarAggregate.EdFi.CalendarReferenceData CalendarReferenceData { get; set; } /// - /// Read-only property that allows the SourceDimension discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Calendar discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator + string Entities.Common.EdFi.ICalendarDate.CalendarDiscriminator { - get { return SourceDimensionReferenceData?.Discriminator; } + get { return CalendarReferenceData?.Discriminator; } set { } } /// - /// Read-only property that allows the SourceDimension resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Calendar resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IChartOfAccount.SourceDimensionResourceId + Guid? Entities.Common.EdFi.ICalendarDate.CalendarResourceId { - get { return SourceDimensionReferenceData?.Id; } + get { return CalendarReferenceData?.Id; } set { } } @@ -16039,9 +21038,11 @@ string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _chartOfAccountReportingTags; - private ICollection _chartOfAccountReportingTagsCovariant; - public virtual ICollection ChartOfAccountReportingTags + private ICollection _calendarDateCalendarEvents; + private ICollection _calendarDateCalendarEventsCovariant; + [Key(13)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CalendarDateCalendarEvents { get { @@ -16050,38 +21051,43 @@ public virtual ICollection set) + { + set.Reattach(this, "CalendarDateCalendarEvents"); + } + + foreach (var item in _calendarDateCalendarEvents) + if (item.CalendarDate == null) + item.CalendarDate = this; // ------------------------------------------------------------- - return _chartOfAccountReportingTags; + return _calendarDateCalendarEvents; } set { - _chartOfAccountReportingTags = value; - _chartOfAccountReportingTagsCovariant = new CovariantCollectionAdapter(value); + _calendarDateCalendarEvents = value; + _calendarDateCalendarEventsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IChartOfAccount.ChartOfAccountReportingTags + ICollection Entities.Common.EdFi.ICalendarDate.CalendarDateCalendarEvents { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _chartOfAccountReportingTags) - if (item.ChartOfAccount == null) - item.ChartOfAccount = this; + foreach (var item in _calendarDateCalendarEvents) + if (item.CalendarDate == null) + item.CalendarDate = this; // ------------------------------------------------------------- - return _chartOfAccountReportingTagsCovariant; + return _calendarDateCalendarEventsCovariant; } set { - ChartOfAccountReportingTags = new HashSet(value.Cast()); + CalendarDateCalendarEvents = new HashSet(value.Cast()); } } @@ -16090,7 +21096,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AccountTypeDescriptor", new LookupColumnDetails { PropertyName = "AccountTypeDescriptorId", LookupTypeName = "AccountTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -16105,9 +21110,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AccountIdentifier", AccountIdentifier); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("CalendarCode", CalendarCode); + keyValues.Add("Date", Date); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); return keyValues; } @@ -16171,12 +21177,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccount)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDate)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IChartOfAccount) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarDate) target, null); } } @@ -16184,19 +21190,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ChartOfAccountReportingTag table of the ChartOfAccount aggregate in the ODS database. + /// A class which represents the edfi.CalendarDateCalendarEvent table of the CalendarDate aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ChartOfAccountReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IChartOfAccountReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CalendarDateCalendarEvent : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICalendarDateCalendarEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ChartOfAccountReportingTag() + public CalendarDateCalendarEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -16204,48 +21211,50 @@ public ChartOfAccountReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ChartOfAccount ChartOfAccount { get; set; } + [DomainSignature, IgnoreMember] + public virtual CalendarDate CalendarDate { get; set; } - Entities.Common.EdFi.IChartOfAccount IChartOfAccountReportingTag.ChartOfAccount + Entities.Common.EdFi.ICalendarDate ICalendarDateCalendarEvent.CalendarDate { - get { return ChartOfAccount; } - set { ChartOfAccount = (ChartOfAccount) value; } + get { return CalendarDate; } + set { CalendarDate = (CalendarDate) value; } } [DomainSignature] - public virtual int ReportingTagDescriptorId + [Key(1)] + public virtual int CalendarEventDescriptorId { get { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); + if (_calendarEventDescriptorId == default(int)) + _calendarEventDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CalendarEventDescriptor", _calendarEventDescriptor); - return _reportingTagDescriptorId; + return _calendarEventDescriptorId; } set { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; + _calendarEventDescriptorId = value; + _calendarEventDescriptor = null; } } - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; + private int _calendarEventDescriptorId; + private string _calendarEventDescriptor; - public virtual string ReportingTagDescriptor + [IgnoreMember] + public virtual string CalendarEventDescriptor { get { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); + if (_calendarEventDescriptor == null) + _calendarEventDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CalendarEventDescriptor", _calendarEventDescriptorId); - return _reportingTagDescriptor; + return _calendarEventDescriptor; } set { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); + _calendarEventDescriptor = value; + _calendarEventDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -16258,7 +21267,6 @@ public virtual string ReportingTagDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -16271,14 +21279,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CalendarDate", "CalendarDateCalendarEvent")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -16297,7 +21318,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CalendarDate", "CalendarDateCalendarEvent")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -16313,7 +21374,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, + { "CalendarEventDescriptor", new LookupColumnDetails { PropertyName = "CalendarEventDescriptorId", LookupTypeName = "CalendarEventDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -16325,10 +21386,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ChartOfAccount as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CalendarDate as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); return keyValues; } @@ -16392,41 +21453,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccountReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarDateCalendarEvent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IChartOfAccountReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarDateCalendarEvent) target, null); } void IChildEntity.SetParent(object value) { - ChartOfAccount = (ChartOfAccount) value; + CalendarDate = (CalendarDate) value; } } } -// Aggregate: CitizenshipStatusDescriptor +// Aggregate: CalendarEventDescriptor -namespace EdFi.Ods.Entities.NHibernate.CitizenshipStatusDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarEventDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CitizenshipStatusDescriptor table of the CitizenshipStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CalendarEventDescriptor table of the CalendarEventDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CitizenshipStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICitizenshipStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CalendarEventDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICalendarEventDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CitizenshipStatusDescriptorId + [IgnoreMember] + public virtual int CalendarEventDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -16511,7 +21574,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CitizenshipStatusDescriptorId", CitizenshipStatusDescriptorId); + keyValues.Add("CalendarEventDescriptorId", CalendarEventDescriptorId); return keyValues; } @@ -16575,42 +21638,115 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarEventDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICalendarEventDescriptor) target, null); } } } -// Aggregate: ClassPeriod +// Aggregate: CalendarTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.ClassPeriodAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CalendarTypeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.CalendarTypeDescriptor table of the CalendarTypeDescriptor aggregate in the ODS database. /// - public class ClassPeriodReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class CalendarTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICalendarTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string ClassPeriodName { get; set; } - public virtual long SchoolId { get; set; } + [DomainSignature] + [IgnoreMember] + public virtual int CalendarTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -16619,8 +21755,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassPeriodName", ClassPeriodName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("CalendarTypeDescriptorId", CalendarTypeDescriptorId); return keyValues; } @@ -16641,8 +21776,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -16659,54 +21804,99 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICalendarTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICalendarTypeDescriptor) target, null); + } + } +} +// Aggregate: CareerPathwayDescriptor +namespace EdFi.Ods.Entities.NHibernate.CareerPathwayDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ClassPeriod table of the ClassPeriod aggregate in the ODS database. + /// A class which represents the edfi.CareerPathwayDescriptor table of the CareerPathwayDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ClassPeriod : AggregateRootWithCompositeKey, IHasCascadableKeyValues, - Entities.Common.EdFi.IClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CareerPathwayDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICareerPathwayDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ClassPeriod() - { - ClassPeriodMeetingTimes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string ClassPeriodName { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } + [IgnoreMember] + public virtual int CareerPathwayDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool? OfficialAttendancePeriod { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -16717,103 +21907,16 @@ public ClassPeriod() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IClassPeriod.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _classPeriodMeetingTimes; - private ICollection _classPeriodMeetingTimesCovariant; - public virtual ICollection ClassPeriodMeetingTimes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _classPeriodMeetingTimes) - if (item.ClassPeriod == null) - item.ClassPeriod = this; - // ------------------------------------------------------------- - - return _classPeriodMeetingTimes; - } - set - { - _classPeriodMeetingTimes = value; - _classPeriodMeetingTimesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IClassPeriod.ClassPeriodMeetingTimes - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _classPeriodMeetingTimes) - if (item.ClassPeriod == null) - item.ClassPeriod = this; - // ------------------------------------------------------------- - - return _classPeriodMeetingTimesCovariant; - } - set - { - ClassPeriodMeetingTimes = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -16833,18 +21936,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassPeriodName", ClassPeriodName); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("CareerPathwayDescriptorId", CareerPathwayDescriptorId); return keyValues; } - /// - /// Gets or sets the capturing the new key values that have - /// not been modified directly on the entity. - /// - OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } - #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -16904,57 +22000,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICareerPathwayDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IClassPeriod) target, null); + this.MapTo((Entities.Common.EdFi.ICareerPathwayDescriptor) target, null); } } +} +// Aggregate: CharterApprovalAgencyTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CharterApprovalAgencyTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ClassPeriodMeetingTime table of the ClassPeriod aggregate in the ODS database. + /// A class which represents the edfi.CharterApprovalAgencyTypeDescriptor table of the CharterApprovalAgencyTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ClassPeriodMeetingTime : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IClassPeriodMeetingTime, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CharterApprovalAgencyTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ClassPeriodMeetingTime() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ClassPeriod ClassPeriod { get; set; } - - Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod + [DomainSignature] + [IgnoreMember] + public virtual int CharterApprovalAgencyTypeDescriptorId { - get { return ClassPeriod; } - set { ClassPeriod = (ClassPeriod) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual TimeSpan EndTime { get; set; } - [DomainSignature] - public virtual TimeSpan StartTime { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -16970,35 +22088,6 @@ Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -17024,12 +22113,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ClassPeriod as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EndTime", EndTime); - keyValues.Add("StartTime", StartTime); + keyValues.Add("CharterApprovalAgencyTypeDescriptorId", CharterApprovalAgencyTypeDescriptorId); return keyValues; } @@ -17093,41 +22181,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriodMeetingTime)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IClassPeriodMeetingTime) target, null); + this.MapTo((Entities.Common.EdFi.ICharterApprovalAgencyTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - ClassPeriod = (ClassPeriod) value; - } } } -// Aggregate: ClassroomPositionDescriptor +// Aggregate: CharterStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.ClassroomPositionDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CharterStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ClassroomPositionDescriptor table of the ClassroomPositionDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CharterStatusDescriptor table of the CharterStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ClassroomPositionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IClassroomPositionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CharterStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICharterStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int ClassroomPositionDescriptorId + [IgnoreMember] + public virtual int CharterStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -17212,7 +22298,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ClassroomPositionDescriptorId", ClassroomPositionDescriptorId); + keyValues.Add("CharterStatusDescriptorId", CharterStatusDescriptorId); return keyValues; } @@ -17276,41 +22362,48 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IClassroomPositionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICharterStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IClassroomPositionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICharterStatusDescriptor) target, null); } } } -// Aggregate: Cohort +// Aggregate: ChartOfAccount -namespace EdFi.Ods.Entities.NHibernate.CohortAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ChartOfAccountAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CohortReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class ChartOfAccountReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CohortIdentifier { get; set; } + [Key(0)] + public virtual string AccountIdentifier { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -17320,8 +22413,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("AccountIdentifier", AccountIdentifier); keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -17372,20 +22466,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Cohort table of the Cohort aggregate in the ODS database. + /// A class which represents the edfi.ChartOfAccount table of the ChartOfAccount aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Cohort : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICohort, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ChartOfAccount : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IChartOfAccount, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Cohort() + public ChartOfAccount() { - CohortPrograms = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ChartOfAccountReportingTags = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -17394,9 +22489,14 @@ public Cohort() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CohortIdentifier { get; set; } + [Key(6)] + public virtual string AccountIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + [Key(8)] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -17407,109 +22507,60 @@ public Cohort() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual int? AcademicSubjectDescriptorId - { - get - { - if (_academicSubjectDescriptorId == default(int?)) - _academicSubjectDescriptorId = string.IsNullOrWhiteSpace(_academicSubjectDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } - } - - private int? _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor - { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = _academicSubjectDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId.Value); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int?); - } - } - public virtual string CohortDescription { get; set; } - public virtual int? CohortScopeDescriptorId - { - get - { - if (_cohortScopeDescriptorId == default(int?)) - _cohortScopeDescriptorId = string.IsNullOrWhiteSpace(_cohortScopeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortScopeDescriptor", _cohortScopeDescriptor); - - return _cohortScopeDescriptorId; - } - set - { - _cohortScopeDescriptorId = value; - _cohortScopeDescriptor = null; - } - } - - private int? _cohortScopeDescriptorId; - private string _cohortScopeDescriptor; - - public virtual string CohortScopeDescriptor - { - get - { - if (_cohortScopeDescriptor == null) - _cohortScopeDescriptor = _cohortScopeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortScopeDescriptor", _cohortScopeDescriptorId.Value); - - return _cohortScopeDescriptor; - } - set - { - _cohortScopeDescriptor = value; - _cohortScopeDescriptorId = default(int?); - } - } - public virtual int CohortTypeDescriptorId + [Key(9)] + public virtual string AccountName { get; set; } + [Key(10)] + public virtual int AccountTypeDescriptorId { get { - if (_cohortTypeDescriptorId == default(int)) - _cohortTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortTypeDescriptor", _cohortTypeDescriptor); + if (_accountTypeDescriptorId == default(int)) + _accountTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AccountTypeDescriptor", _accountTypeDescriptor); - return _cohortTypeDescriptorId; + return _accountTypeDescriptorId; } set { - _cohortTypeDescriptorId = value; - _cohortTypeDescriptor = null; + _accountTypeDescriptorId = value; + _accountTypeDescriptor = null; } } - private int _cohortTypeDescriptorId; - private string _cohortTypeDescriptor; + private int _accountTypeDescriptorId; + private string _accountTypeDescriptor; - public virtual string CohortTypeDescriptor + [IgnoreMember] + public virtual string AccountTypeDescriptor { get { - if (_cohortTypeDescriptor == null) - _cohortTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortTypeDescriptor", _cohortTypeDescriptorId); + if (_accountTypeDescriptor == null) + _accountTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AccountTypeDescriptor", _accountTypeDescriptorId); - return _cohortTypeDescriptor; + return _accountTypeDescriptor; } set { - _cohortTypeDescriptor = value; - _cohortTypeDescriptorId = default(int); + _accountTypeDescriptor = value; + _accountTypeDescriptorId = default(int); } } + [Key(11)] + public virtual string BalanceSheetCode { get; set; } + [Key(12)] + public virtual string FunctionCode { get; set; } + [Key(13)] + public virtual string FundCode { get; set; } + [Key(14)] + public virtual string ObjectCode { get; set; } + [Key(15)] + public virtual string OperationalUnitCode { get; set; } + [Key(16)] + public virtual string ProgramCode { get; set; } + [Key(17)] + public virtual string ProjectCode { get; set; } + [Key(18)] + public virtual string SourceCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -17522,14 +22573,27 @@ public virtual string CohortTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ChartOfAccount", "ChartOfAccount")] + [Key(19)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -17548,18 +22612,80 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ChartOfAccount", "ChartOfAccount")] + [Key(20)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(21)] + public virtual NHibernate.BalanceSheetDimensionAggregate.EdFi.BalanceSheetDimensionReferenceData BalanceSheetDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the BalanceSheetDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionDiscriminator + { + get { return BalanceSheetDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the BalanceSheetDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.BalanceSheetDimensionResourceId + { + get { return BalanceSheetDimensionReferenceData?.Id; } + set { } + } + + [Key(22)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator + string Entities.Common.EdFi.IChartOfAccount.EducationOrganizationDiscriminator { get { return EducationOrganizationReferenceData?.Discriminator; } set { } @@ -17568,21 +22694,170 @@ string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator /// /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICohort.EducationOrganizationResourceId + Guid? Entities.Common.EdFi.IChartOfAccount.EducationOrganizationResourceId { get { return EducationOrganizationReferenceData?.Id; } set { } } + [Key(23)] + public virtual NHibernate.FunctionDimensionAggregate.EdFi.FunctionDimensionReferenceData FunctionDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the FunctionDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.FunctionDimensionDiscriminator + { + get { return FunctionDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the FunctionDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.FunctionDimensionResourceId + { + get { return FunctionDimensionReferenceData?.Id; } + set { } + } + + [Key(24)] + public virtual NHibernate.FundDimensionAggregate.EdFi.FundDimensionReferenceData FundDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the FundDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.FundDimensionDiscriminator + { + get { return FundDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the FundDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.FundDimensionResourceId + { + get { return FundDimensionReferenceData?.Id; } + set { } + } + + [Key(25)] + public virtual NHibernate.ObjectDimensionAggregate.EdFi.ObjectDimensionReferenceData ObjectDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the ObjectDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.ObjectDimensionDiscriminator + { + get { return ObjectDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ObjectDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.ObjectDimensionResourceId + { + get { return ObjectDimensionReferenceData?.Id; } + set { } + } + + [Key(26)] + public virtual NHibernate.OperationalUnitDimensionAggregate.EdFi.OperationalUnitDimensionReferenceData OperationalUnitDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the OperationalUnitDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionDiscriminator + { + get { return OperationalUnitDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the OperationalUnitDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.OperationalUnitDimensionResourceId + { + get { return OperationalUnitDimensionReferenceData?.Id; } + set { } + } + + [Key(27)] + public virtual NHibernate.ProgramDimensionAggregate.EdFi.ProgramDimensionReferenceData ProgramDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the ProgramDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.ProgramDimensionDiscriminator + { + get { return ProgramDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProgramDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.ProgramDimensionResourceId + { + get { return ProgramDimensionReferenceData?.Id; } + set { } + } + + [Key(28)] + public virtual NHibernate.ProjectDimensionAggregate.EdFi.ProjectDimensionReferenceData ProjectDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the ProjectDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.ProjectDimensionDiscriminator + { + get { return ProjectDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ProjectDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.ProjectDimensionResourceId + { + get { return ProjectDimensionReferenceData?.Id; } + set { } + } + + [Key(29)] + public virtual NHibernate.SourceDimensionAggregate.EdFi.SourceDimensionReferenceData SourceDimensionReferenceData { get; set; } + + /// + /// Read-only property that allows the SourceDimension discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IChartOfAccount.SourceDimensionDiscriminator + { + get { return SourceDimensionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the SourceDimension resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IChartOfAccount.SourceDimensionResourceId + { + get { return SourceDimensionReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _cohortPrograms; - private ICollection _cohortProgramsCovariant; - public virtual ICollection CohortPrograms + private ICollection _chartOfAccountReportingTags; + private ICollection _chartOfAccountReportingTagsCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ChartOfAccountReportingTags { get { @@ -17591,38 +22866,43 @@ public virtual ICollection set) + { + set.Reattach(this, "ChartOfAccountReportingTags"); + } + + foreach (var item in _chartOfAccountReportingTags) + if (item.ChartOfAccount == null) + item.ChartOfAccount = this; // ------------------------------------------------------------- - return _cohortPrograms; + return _chartOfAccountReportingTags; } set { - _cohortPrograms = value; - _cohortProgramsCovariant = new CovariantCollectionAdapter(value); + _chartOfAccountReportingTags = value; + _chartOfAccountReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICohort.CohortPrograms + ICollection Entities.Common.EdFi.IChartOfAccount.ChartOfAccountReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _cohortPrograms) - if (item.Cohort == null) - item.Cohort = this; + foreach (var item in _chartOfAccountReportingTags) + if (item.ChartOfAccount == null) + item.ChartOfAccount = this; // ------------------------------------------------------------- - return _cohortProgramsCovariant; + return _chartOfAccountReportingTagsCovariant; } set { - CohortPrograms = new HashSet(value.Cast()); + ChartOfAccountReportingTags = new HashSet(value.Cast()); } } @@ -17631,9 +22911,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "CohortScopeDescriptor", new LookupColumnDetails { PropertyName = "CohortScopeDescriptorId", LookupTypeName = "CohortScopeDescriptor"} }, - { "CohortTypeDescriptor", new LookupColumnDetails { PropertyName = "CohortTypeDescriptorId", LookupTypeName = "CohortTypeDescriptor"} }, + { "AccountTypeDescriptor", new LookupColumnDetails { PropertyName = "AccountTypeDescriptorId", LookupTypeName = "AccountTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -17648,8 +22926,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("AccountIdentifier", AccountIdentifier); keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -17713,12 +22992,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohort)target); + return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccount)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohort) target, null); + this.MapTo((Entities.Common.EdFi.IChartOfAccount) target, null); } } @@ -17726,19 +23005,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CohortProgram table of the Cohort aggregate in the ODS database. + /// A class which represents the edfi.ChartOfAccountReportingTag table of the ChartOfAccount aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CohortProgram : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICohortProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ChartOfAccountReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IChartOfAccountReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CohortProgram() + public ChartOfAccountReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -17746,52 +23026,50 @@ public CohortProgram() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Cohort Cohort { get; set; } + [DomainSignature, IgnoreMember] + public virtual ChartOfAccount ChartOfAccount { get; set; } - Entities.Common.EdFi.ICohort ICohortProgram.Cohort + Entities.Common.EdFi.IChartOfAccount IChartOfAccountReportingTag.ChartOfAccount { - get { return Cohort; } - set { Cohort = (Cohort) value; } + get { return ChartOfAccount; } + set { ChartOfAccount = (ChartOfAccount) value; } } [DomainSignature] - public virtual long ProgramEducationOrganizationId { get; set; } - [DomainSignature] - public virtual string ProgramName { get; set; } - [DomainSignature] - public virtual int ProgramTypeDescriptorId + [Key(1)] + public virtual int ReportingTagDescriptorId { get { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - return _programTypeDescriptorId; + return _reportingTagDescriptorId; } set { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; } } - private int _programTypeDescriptorId; - private string _programTypeDescriptor; + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; - public virtual string ProgramTypeDescriptor + [IgnoreMember] + public virtual string ReportingTagDescriptor { get { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - return _programTypeDescriptor; + return _reportingTagDescriptor; } set { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -17804,6 +23082,8 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual string TagValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -17816,14 +23096,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ChartOfAccount", "ChartOfAccountReportingTag")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -17842,34 +23135,54 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ChartOfAccount", "ChartOfAccountReportingTag")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICohortProgram.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } + _aggregateExtensions = value; + } } // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= // Collections // ------------------------------------------------------------- @@ -17878,7 +23191,7 @@ string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -17890,12 +23203,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Cohort as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ChartOfAccount as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -17959,41 +23270,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.IChartOfAccountReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohortProgram) target, null); + this.MapTo((Entities.Common.EdFi.IChartOfAccountReportingTag) target, null); } void IChildEntity.SetParent(object value) { - Cohort = (Cohort) value; + ChartOfAccount = (ChartOfAccount) value; } } } -// Aggregate: CohortScopeDescriptor +// Aggregate: CitizenshipStatusDescriptor -namespace EdFi.Ods.Entities.NHibernate.CohortScopeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CitizenshipStatusDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CohortScopeDescriptor table of the CohortScopeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CitizenshipStatusDescriptor table of the CitizenshipStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CohortScopeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICohortScopeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CitizenshipStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICitizenshipStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CohortScopeDescriptorId + [IgnoreMember] + public virtual int CitizenshipStatusDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -18078,7 +23391,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortScopeDescriptorId", CohortScopeDescriptorId); + keyValues.Add("CitizenshipStatusDescriptorId", CitizenshipStatusDescriptorId); return keyValues; } @@ -18142,82 +23455,147 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortScopeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohortScopeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICitizenshipStatusDescriptor) target, null); } } } -// Aggregate: CohortTypeDescriptor +// Aggregate: ClassPeriod -namespace EdFi.Ods.Entities.NHibernate.CohortTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ClassPeriodAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class ClassPeriodReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual string ClassPeriodName { get; set; } + [Key(1)] + public virtual long SchoolId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(2)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(3)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("ClassPeriodName", ClassPeriodName); + keyValues.Add("SchoolId", SchoolId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CohortTypeDescriptor table of the CohortTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ClassPeriod table of the ClassPeriod aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CohortTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICohortTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class ClassPeriod : AggregateRootWithCompositeKey, IHasCascadableKeyValues, + Entities.Common.EdFi.IClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ClassPeriod() + { + ClassPeriodMeetingTimes = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CohortTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + [Key(6)] + public virtual string ClassPeriodName { get; set; } + [DomainSignature] + [Key(7)] + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] + public virtual bool? OfficialAttendancePeriod { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -18228,16 +23606,164 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ClassPeriod", "ClassPeriod")] + [Key(9)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ClassPeriod", "ClassPeriod")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(11)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IClassPeriod.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _classPeriodMeetingTimes; + private ICollection _classPeriodMeetingTimesCovariant; + [Key(12)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ClassPeriodMeetingTimes + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_classPeriodMeetingTimes is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "ClassPeriodMeetingTimes"); + } + + foreach (var item in _classPeriodMeetingTimes) + if (item.ClassPeriod == null) + item.ClassPeriod = this; + // ------------------------------------------------------------- + + return _classPeriodMeetingTimes; + } + set + { + _classPeriodMeetingTimes = value; + _classPeriodMeetingTimesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IClassPeriod.ClassPeriodMeetingTimes + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _classPeriodMeetingTimes) + if (item.ClassPeriod == null) + item.ClassPeriod = this; + // ------------------------------------------------------------- + + return _classPeriodMeetingTimesCovariant; + } + set + { + ClassPeriodMeetingTimes = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map @@ -18257,11 +23783,18 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CohortTypeDescriptorId", CohortTypeDescriptorId); + keyValues.Add("ClassPeriodName", ClassPeriodName); + keyValues.Add("SchoolId", SchoolId); return keyValues; } + /// + /// Gets or sets the capturing the new key values that have + /// not been modified directly on the entity. + /// + OrderedDictionary IHasCascadableKeyValues.NewKeyValues { get; set; } + #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -18321,77 +23854,60 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohortTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IClassPeriod) target, null); } } -} -// Aggregate: CohortYearTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CohortYearTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CohortYearTypeDescriptor table of the CohortYearTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ClassPeriodMeetingTime table of the ClassPeriod aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CohortYearTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICohortYearTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class ClassPeriodMeetingTime : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IClassPeriodMeetingTime, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ClassPeriodMeetingTime() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int CohortYearTypeDescriptorId + [DomainSignature, IgnoreMember] + public virtual ClassPeriod ClassPeriod { get; set; } + + Entities.Common.EdFi.IClassPeriod IClassPeriodMeetingTime.ClassPeriod { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return ClassPeriod; } + set { ClassPeriod = (ClassPeriod) value; } } - + + [DomainSignature] + [Key(1)] + public virtual TimeSpan EndTime { get; set; } + [DomainSignature] + [Key(2)] + public virtual TimeSpan StartTime { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -18407,6 +23923,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ClassPeriod", "ClassPeriodMeetingTime")] + [Key(3)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ClassPeriod", "ClassPeriodMeetingTime")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -18432,11 +24030,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ClassPeriod as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CohortYearTypeDescriptorId", CohortYearTypeDescriptorId); + keyValues.Add("EndTime", EndTime); + keyValues.Add("StartTime", StartTime); return keyValues; } @@ -18500,47 +24099,46 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICohortYearTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IClassPeriodMeetingTime)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICohortYearTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IClassPeriodMeetingTime) target, null); } + void IChildEntity.SetParent(object value) + { + ClassPeriod = (ClassPeriod) value; + } } } -// Aggregate: CommunityOrganization +// Aggregate: ClassroomPositionDescriptor -namespace EdFi.Ods.Entities.NHibernate.CommunityOrganizationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.ClassroomPositionDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CommunityOrganization table of the CommunityOrganization aggregate in the ODS database. + /// A class which represents the edfi.ClassroomPositionDescriptor table of the ClassroomPositionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CommunityOrganization : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.ICommunityOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ClassroomPositionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IClassroomPositionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public CommunityOrganization() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long CommunityOrganizationId + [IgnoreMember] + public virtual int ClassroomPositionDescriptorId { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } // ------------------------------------------------------------- @@ -18548,25 +24146,35 @@ public virtual long CommunityOrganizationId // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution + string IDescriptor.CodeValue { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } + get { return CodeValue; } + set { CodeValue = value; } } - string IEducationOrganization.OperationalStatusDescriptor + string IDescriptor.Description { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } + get { return Description; } + set { Description = value; } } - string IEducationOrganization.ShortNameOfInstitution + DateTime? IDescriptor.EffectiveBeginDate { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - string IEducationOrganization.WebSite + DateTime? IDescriptor.EffectiveEndDate { - get { return WebSite; } - set { WebSite = value; } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } // ------------------------------------------------------------- @@ -18583,35 +24191,6 @@ string IEducationOrganization.WebSite // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -18627,7 +24206,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -18642,7 +24220,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CommunityOrganizationId", CommunityOrganizationId); + keyValues.Add("ClassroomPositionDescriptorId", ClassroomPositionDescriptorId); return keyValues; } @@ -18706,35 +24284,122 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICommunityOrganization)target); + return this.SynchronizeTo((Entities.Common.EdFi.IClassroomPositionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICommunityOrganization) target, null); + this.MapTo((Entities.Common.EdFi.IClassroomPositionDescriptor) target, null); } } } -// Aggregate: CommunityProvider +// Aggregate: Cohort -namespace EdFi.Ods.Entities.NHibernate.CommunityProviderAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CohortAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class CohortReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual string CohortIdentifier { get; set; } + [Key(1)] + public virtual long EducationOrganizationId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(2)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(3)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CommunityProvider table of the CommunityProvider aggregate in the ODS database. + /// A class which represents the edfi.Cohort table of the Cohort aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CommunityProvider : EducationOrganizationAggregate.EdFi.EducationOrganization, - Entities.Common.EdFi.ICommunityProvider, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class Cohort : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICohort, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public CommunityProvider() + public virtual void SuspendReferenceAssignmentCheck() { } + + public Cohort() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CohortPrograms = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -18743,147 +24408,131 @@ public CommunityProvider() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long CommunityProviderId - { - get { return base.EducationOrganizationId; } - set { base.EducationOrganizationId = value; } - } - + [Key(6)] + public virtual string CohortIdentifier { get; set; } + [DomainSignature] + [Key(7)] + public virtual long EducationOrganizationId { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IEducationOrganization.NameOfInstitution - { - get { return NameOfInstitution; } - set { NameOfInstitution = value; } - } - string IEducationOrganization.OperationalStatusDescriptor - { - get { return OperationalStatusDescriptor; } - set { OperationalStatusDescriptor = value; } - } - string IEducationOrganization.ShortNameOfInstitution - { - get { return ShortNameOfInstitution; } - set { ShortNameOfInstitution = value; } - } - string IEducationOrganization.WebSite - { - get { return WebSite; } - set { WebSite = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual long? CommunityOrganizationId { get; set; } - public virtual bool? LicenseExemptIndicator { get; set; } - public virtual int ProviderCategoryDescriptorId + [Key(8)] + public virtual int? AcademicSubjectDescriptorId { get { - if (_providerCategoryDescriptorId == default(int)) - _providerCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderCategoryDescriptor", _providerCategoryDescriptor); + if (_academicSubjectDescriptorId == default(int?)) + _academicSubjectDescriptorId = string.IsNullOrWhiteSpace(_academicSubjectDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - return _providerCategoryDescriptorId; + return _academicSubjectDescriptorId; } set { - _providerCategoryDescriptorId = value; - _providerCategoryDescriptor = null; + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; } } - private int _providerCategoryDescriptorId; - private string _providerCategoryDescriptor; + private int? _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; - public virtual string ProviderCategoryDescriptor + [IgnoreMember] + public virtual string AcademicSubjectDescriptor { get { - if (_providerCategoryDescriptor == null) - _providerCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderCategoryDescriptor", _providerCategoryDescriptorId); + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = _academicSubjectDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId.Value); - return _providerCategoryDescriptor; + return _academicSubjectDescriptor; } set { - _providerCategoryDescriptor = value; - _providerCategoryDescriptorId = default(int); + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int?); } } - public virtual int? ProviderProfitabilityDescriptorId + [Key(9)] + public virtual string CohortDescription { get; set; } + [Key(10)] + public virtual int? CohortScopeDescriptorId { get { - if (_providerProfitabilityDescriptorId == default(int?)) - _providerProfitabilityDescriptorId = string.IsNullOrWhiteSpace(_providerProfitabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptor); + if (_cohortScopeDescriptorId == default(int?)) + _cohortScopeDescriptorId = string.IsNullOrWhiteSpace(_cohortScopeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortScopeDescriptor", _cohortScopeDescriptor); - return _providerProfitabilityDescriptorId; + return _cohortScopeDescriptorId; } set { - _providerProfitabilityDescriptorId = value; - _providerProfitabilityDescriptor = null; + _cohortScopeDescriptorId = value; + _cohortScopeDescriptor = null; } } - private int? _providerProfitabilityDescriptorId; - private string _providerProfitabilityDescriptor; + private int? _cohortScopeDescriptorId; + private string _cohortScopeDescriptor; - public virtual string ProviderProfitabilityDescriptor + [IgnoreMember] + public virtual string CohortScopeDescriptor { get { - if (_providerProfitabilityDescriptor == null) - _providerProfitabilityDescriptor = _providerProfitabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptorId.Value); + if (_cohortScopeDescriptor == null) + _cohortScopeDescriptor = _cohortScopeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortScopeDescriptor", _cohortScopeDescriptorId.Value); - return _providerProfitabilityDescriptor; + return _cohortScopeDescriptor; } set { - _providerProfitabilityDescriptor = value; - _providerProfitabilityDescriptorId = default(int?); + _cohortScopeDescriptor = value; + _cohortScopeDescriptorId = default(int?); } } - public virtual int ProviderStatusDescriptorId + [Key(11)] + public virtual int CohortTypeDescriptorId { get { - if (_providerStatusDescriptorId == default(int)) - _providerStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderStatusDescriptor", _providerStatusDescriptor); + if (_cohortTypeDescriptorId == default(int)) + _cohortTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CohortTypeDescriptor", _cohortTypeDescriptor); - return _providerStatusDescriptorId; + return _cohortTypeDescriptorId; } set { - _providerStatusDescriptorId = value; - _providerStatusDescriptor = null; + _cohortTypeDescriptorId = value; + _cohortTypeDescriptor = null; } } - private int _providerStatusDescriptorId; - private string _providerStatusDescriptor; + private int _cohortTypeDescriptorId; + private string _cohortTypeDescriptor; - public virtual string ProviderStatusDescriptor + [IgnoreMember] + public virtual string CohortTypeDescriptor { get { - if (_providerStatusDescriptor == null) - _providerStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderStatusDescriptor", _providerStatusDescriptorId); + if (_cohortTypeDescriptor == null) + _cohortTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CohortTypeDescriptor", _cohortTypeDescriptorId); - return _providerStatusDescriptor; + return _cohortTypeDescriptor; } set { - _providerStatusDescriptor = value; - _providerStatusDescriptorId = default(int); + _cohortTypeDescriptor = value; + _cohortTypeDescriptorId = default(int); } } - public virtual bool? SchoolIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -18896,14 +24545,27 @@ public virtual string ProviderStatusDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Cohort", "Cohort")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -18922,20 +24584,70 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Cohort", "Cohort")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityOrganizationReferenceData { get; set; } + [Key(14)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// - /// Read-only property that allows the CommunityOrganization resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICommunityProvider.CommunityOrganizationResourceId + string Entities.Common.EdFi.ICohort.EducationOrganizationDiscriminator { - get { return CommunityOrganizationReferenceData?.Id; } + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICohort.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } set { } } @@ -18944,15 +24656,68 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _cohortPrograms; + private ICollection _cohortProgramsCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CohortPrograms + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_cohortPrograms is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CohortPrograms"); + } + + foreach (var item in _cohortPrograms) + if (item.Cohort == null) + item.Cohort = this; + // ------------------------------------------------------------- + + return _cohortPrograms; + } + set + { + _cohortPrograms = value; + _cohortProgramsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICohort.CohortPrograms + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _cohortPrograms) + if (item.Cohort == null) + item.Cohort = this; + // ------------------------------------------------------------- + + return _cohortProgramsCovariant; + } + set + { + CohortPrograms = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, - { "ProviderCategoryDescriptor", new LookupColumnDetails { PropertyName = "ProviderCategoryDescriptorId", LookupTypeName = "ProviderCategoryDescriptor"} }, - { "ProviderProfitabilityDescriptor", new LookupColumnDetails { PropertyName = "ProviderProfitabilityDescriptorId", LookupTypeName = "ProviderProfitabilityDescriptor"} }, - { "ProviderStatusDescriptor", new LookupColumnDetails { PropertyName = "ProviderStatusDescriptorId", LookupTypeName = "ProviderStatusDescriptor"} }, + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, + { "CohortScopeDescriptor", new LookupColumnDetails { PropertyName = "CohortScopeDescriptorId", LookupTypeName = "CohortScopeDescriptor"} }, + { "CohortTypeDescriptor", new LookupColumnDetails { PropertyName = "CohortTypeDescriptorId", LookupTypeName = "CohortTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -18967,7 +24732,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CommunityProviderId", CommunityProviderId); + keyValues.Add("CohortIdentifier", CohortIdentifier); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -19031,117 +24797,33 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProvider)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICohort)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICommunityProvider) target, null); - } - - } -} -// Aggregate: CommunityProviderLicense - -namespace EdFi.Ods.Entities.NHibernate.CommunityProviderLicenseAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class CommunityProviderLicenseReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long CommunityProviderId { get; set; } - public virtual string LicenseIdentifier { get; set; } - public virtual string LicensingOrganization { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CommunityProviderId", CommunityProviderId); - keyValues.Add("LicenseIdentifier", LicenseIdentifier); - keyValues.Add("LicensingOrganization", LicensingOrganization); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.ICohort) target, null); } - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CommunityProviderLicense table of the CommunityProviderLicense aggregate in the ODS database. + /// A class which represents the edfi.CohortProgram table of the Cohort aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CommunityProviderLicense : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICommunityProviderLicense, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CohortProgram : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICohortProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CommunityProviderLicense() + public CohortProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -19149,140 +24831,68 @@ public CommunityProviderLicense() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual long CommunityProviderId { get; set; } - [DomainSignature] - public virtual string LicenseIdentifier { get; set; } - [DomainSignature] - public virtual string LicensingOrganization { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? AuthorizedFacilityCapacity { get; set; } - public virtual DateTime LicenseEffectiveDate - { - get { return _licenseEffectiveDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _licenseEffectiveDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _licenseEffectiveDate; - - public virtual DateTime? LicenseExpirationDate - { - get { return _licenseExpirationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _licenseExpirationDate = null; - } else - { - var given = (DateTime) value; - _licenseExpirationDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } + [DomainSignature, IgnoreMember] + public virtual Cohort Cohort { get; set; } - private DateTime? _licenseExpirationDate; - - public virtual DateTime? LicenseIssueDate + Entities.Common.EdFi.ICohort ICohortProgram.Cohort { - get { return _licenseIssueDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _licenseIssueDate = null; - } else - { - var given = (DateTime) value; - _licenseIssueDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return Cohort; } + set { Cohort = (Cohort) value; } } - private DateTime? _licenseIssueDate; - - public virtual int? LicenseStatusDescriptorId + [DomainSignature] + [Key(1)] + public virtual long ProgramEducationOrganizationId { get; set; } + [DomainSignature] + [Key(2)] + public virtual string ProgramName { get; set; } + [DomainSignature] + [Key(3)] + public virtual int ProgramTypeDescriptorId { get { - if (_licenseStatusDescriptorId == default(int?)) - _licenseStatusDescriptorId = string.IsNullOrWhiteSpace(_licenseStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseStatusDescriptor", _licenseStatusDescriptor); + if (_programTypeDescriptorId == default(int)) + _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); - return _licenseStatusDescriptorId; + return _programTypeDescriptorId; } set { - _licenseStatusDescriptorId = value; - _licenseStatusDescriptor = null; + _programTypeDescriptorId = value; + _programTypeDescriptor = null; } } - private int? _licenseStatusDescriptorId; - private string _licenseStatusDescriptor; + private int _programTypeDescriptorId; + private string _programTypeDescriptor; - public virtual string LicenseStatusDescriptor + [IgnoreMember] + public virtual string ProgramTypeDescriptor { get { - if (_licenseStatusDescriptor == null) - _licenseStatusDescriptor = _licenseStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseStatusDescriptor", _licenseStatusDescriptorId.Value); + if (_programTypeDescriptor == null) + _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - return _licenseStatusDescriptor; - } - set - { - _licenseStatusDescriptor = value; - _licenseStatusDescriptorId = default(int?); + return _programTypeDescriptor; } - } - public virtual int LicenseTypeDescriptorId - { - get - { - if (_licenseTypeDescriptorId == default(int)) - _licenseTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseTypeDescriptor", _licenseTypeDescriptor); - - return _licenseTypeDescriptorId; - } set { - _licenseTypeDescriptorId = value; - _licenseTypeDescriptor = null; + _programTypeDescriptor = value; + _programTypeDescriptorId = default(int); } } + // ------------------------------------------------------------- - private int _licenseTypeDescriptorId; - private string _licenseTypeDescriptor; + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public virtual string LicenseTypeDescriptor - { - get - { - if (_licenseTypeDescriptor == null) - _licenseTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseTypeDescriptor", _licenseTypeDescriptorId); - - return _licenseTypeDescriptor; - } - set - { - _licenseTypeDescriptor = value; - _licenseTypeDescriptorId = default(int); - } - } - public virtual int? OldestAgeAuthorizedToServe { get; set; } - public virtual int? YoungestAgeAuthorizedToServe { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -19295,14 +24905,27 @@ public virtual string LicenseTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Cohort", "CohortProgram")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -19321,20 +24944,70 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Cohort", "CohortProgram")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityProviderReferenceData { get; set; } + [Key(6)] + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// - /// Read-only property that allows the CommunityProvider resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderResourceId + string Entities.Common.EdFi.ICohortProgram.ProgramDiscriminator { - get { return CommunityProviderReferenceData?.Id; } + get { return ProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICohortProgram.ProgramResourceId + { + get { return ProgramReferenceData?.Id; } set { } } @@ -19348,8 +25021,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LicenseStatusDescriptor", new LookupColumnDetails { PropertyName = "LicenseStatusDescriptorId", LookupTypeName = "LicenseStatusDescriptor"} }, - { "LicenseTypeDescriptor", new LookupColumnDetails { PropertyName = "LicenseTypeDescriptorId", LookupTypeName = "LicenseTypeDescriptor"} }, + { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -19360,13 +25032,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Cohort as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CommunityProviderId", CommunityProviderId); - keyValues.Add("LicenseIdentifier", LicenseIdentifier); - keyValues.Add("LicensingOrganization", LicensingOrganization); + keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); + keyValues.Add("ProgramName", ProgramName); + keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); return keyValues; } @@ -19430,37 +25102,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProviderLicense)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICohortProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICommunityProviderLicense) target, null); + this.MapTo((Entities.Common.EdFi.ICohortProgram) target, null); } + void IChildEntity.SetParent(object value) + { + Cohort = (Cohort) value; + } } } -// Aggregate: CompetencyLevelDescriptor +// Aggregate: CohortScopeDescriptor -namespace EdFi.Ods.Entities.NHibernate.CompetencyLevelDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CohortScopeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CompetencyLevelDescriptor table of the CompetencyLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CohortScopeDescriptor table of the CohortScopeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CompetencyLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICompetencyLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CohortScopeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICohortScopeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CompetencyLevelDescriptorId + [IgnoreMember] + public virtual int CohortScopeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -19545,7 +25223,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); + keyValues.Add("CohortScopeDescriptorId", CohortScopeDescriptorId); return keyValues; } @@ -19609,176 +25287,84 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICohortScopeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICompetencyLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICohortScopeDescriptor) target, null); } } } -// Aggregate: CompetencyObjective +// Aggregate: CohortTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.CompetencyObjectiveAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CohortTypeDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class CompetencyObjectiveReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } - public virtual string Objective { get; set; } - public virtual int ObjectiveGradeLevelDescriptorId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("Objective", Objective); - keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CompetencyObjective table of the CompetencyObjective aggregate in the ODS database. + /// A class which represents the edfi.CohortTypeDescriptor table of the CohortTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CompetencyObjective : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CohortTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICohortTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CompetencyObjective() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual string Objective { get; set; } - [DomainSignature] - public virtual int ObjectiveGradeLevelDescriptorId - { - get - { - if (_objectiveGradeLevelDescriptorId == default(int)) - _objectiveGradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _objectiveGradeLevelDescriptor); - - return _objectiveGradeLevelDescriptorId; - } - set - { - _objectiveGradeLevelDescriptorId = value; - _objectiveGradeLevelDescriptor = null; - } - } - - private int _objectiveGradeLevelDescriptorId; - private string _objectiveGradeLevelDescriptor; - - public virtual string ObjectiveGradeLevelDescriptor + [IgnoreMember] + public virtual int CohortTypeDescriptorId { - get - { - if (_objectiveGradeLevelDescriptor == null) - _objectiveGradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _objectiveGradeLevelDescriptorId); - - return _objectiveGradeLevelDescriptor; - } - set - { - _objectiveGradeLevelDescriptor = value; - _objectiveGradeLevelDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CompetencyObjectiveId { get; set; } - public virtual string Description { get; set; } - public virtual string SuccessCriteria { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -19789,60 +25375,11 @@ public virtual string ObjectiveGradeLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -19853,7 +25390,6 @@ string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscrimina // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ObjectiveGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "ObjectiveGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -19868,9 +25404,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("Objective", Objective); - keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); + keyValues.Add("CohortTypeDescriptorId", CohortTypeDescriptorId); return keyValues; } @@ -19934,41 +25468,115 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyObjective)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICohortTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICompetencyObjective) target, null); + this.MapTo((Entities.Common.EdFi.ICohortTypeDescriptor) target, null); } } } -// Aggregate: Contact +// Aggregate: CohortYearTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.ContactAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CohortYearTypeDescriptorAggregate.EdFi { +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// - /// Represents a read-only reference to the entity. + /// A class which represents the edfi.CohortYearTypeDescriptor table of the CohortYearTypeDescriptor aggregate in the ODS database. /// - public class ContactReferenceData : IHasPrimaryKeyValues + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class CohortYearTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICohortYearTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { + // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int ContactUSI { get; set; } + [DomainSignature] + [IgnoreMember] + public virtual int CohortYearTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } + } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() @@ -19977,7 +25585,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ContactUSI", ContactUSI); + keyValues.Add("CohortYearTypeDescriptorId", CohortYearTypeDescriptorId); return keyValues; } @@ -19998,8 +25606,18 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } return true; @@ -20016,38 +25634,51 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - hashCode.Add(entry.Value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } return hashCode.ToHashCode(); } #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.ICohortYearTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.ICohortYearTypeDescriptor) target, null); + } + } +} +// Aggregate: CommunityOrganization +namespace EdFi.Ods.Entities.NHibernate.CommunityOrganizationAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Contact table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CommunityOrganization table of the CommunityOrganization aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Contact : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IContact, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IPersonUsiMutator, IHasExtensions + [MessagePackObject] + public class CommunityOrganization : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.ICommunityOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public virtual void SuspendReferenceAssignmentCheck() { } - - public Contact() + public CommunityOrganization() { - ContactAddresses = new HashSet(); - ContactElectronicMails = new HashSet(); - ContactInternationalAddresses = new HashSet(); - ContactLanguages = new HashSet(); - ContactOtherNames = new HashSet(); - ContactPersonalIdentificationDocuments = new HashSet(); - ContactTelephones = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -20055,180 +25686,44 @@ public Contact() // ============================================================= // Primary Key // ------------------------------------------------------------- - [Display(Name="ContactUniqueId")][DomainSignature] - public virtual int ContactUSI + [DomainSignature] + [IgnoreMember] + public virtual long CommunityOrganizationId { - get - { - if (_contactUSI == default(int) && _contactUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Contact", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_contactUniqueId, out var usi)) - { - _contactUSI = usi; - } - } - - return _contactUSI; - } - set - { - _contactUSI = value; - } + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } } - - private int _contactUSI; - string IIdentifiablePerson.UniqueId { get { return ContactUniqueId; } } - // Supports deserialization of entities that don't have surrogate id available after creation - void IPersonUsiMutator.SetUsi(int newValue) => _contactUSI = newValue; - int IPersonUsiMutator.GetUsi() => _contactUSI; - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string ContactUniqueId - { - get - { - if (_contactUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Contact", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_contactUSI, out var uniqueId)) - { - _contactUniqueId = uniqueId; - } - } - - return _contactUniqueId; - } - set - { - _contactUniqueId = value; - } - } - private string _contactUniqueId; - - public virtual string FirstName { get; set; } - public virtual string GenderIdentity { get; set; } - public virtual string GenerationCodeSuffix { get; set; } - public virtual int? HighestCompletedLevelOfEducationDescriptorId - { - get - { - if (_highestCompletedLevelOfEducationDescriptorId == default(int?)) - _highestCompletedLevelOfEducationDescriptorId = string.IsNullOrWhiteSpace(_highestCompletedLevelOfEducationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptor); - - return _highestCompletedLevelOfEducationDescriptorId; - } - set - { - _highestCompletedLevelOfEducationDescriptorId = value; - _highestCompletedLevelOfEducationDescriptor = null; - } - } - - private int? _highestCompletedLevelOfEducationDescriptorId; - private string _highestCompletedLevelOfEducationDescriptor; - - public virtual string HighestCompletedLevelOfEducationDescriptor + string IEducationOrganization.NameOfInstitution { - get - { - if (_highestCompletedLevelOfEducationDescriptor == null) - _highestCompletedLevelOfEducationDescriptor = _highestCompletedLevelOfEducationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptorId.Value); - - return _highestCompletedLevelOfEducationDescriptor; - } - set - { - _highestCompletedLevelOfEducationDescriptor = value; - _highestCompletedLevelOfEducationDescriptorId = default(int?); - } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } } - public virtual string LastSurname { get; set; } - public virtual string LoginId { get; set; } - public virtual string MaidenName { get; set; } - public virtual string MiddleName { get; set; } - public virtual string PersonalTitlePrefix { get; set; } - public virtual string PersonId { get; set; } - public virtual string PreferredFirstName { get; set; } - public virtual string PreferredLastSurname { get; set; } - public virtual int? SexDescriptorId + string IEducationOrganization.OperationalStatusDescriptor { - get - { - if (_sexDescriptorId == default(int?)) - _sexDescriptorId = string.IsNullOrWhiteSpace(_sexDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); - - return _sexDescriptorId; - } - set - { - _sexDescriptorId = value; - _sexDescriptor = null; - } + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } } - - private int? _sexDescriptorId; - private string _sexDescriptor; - - public virtual string SexDescriptor + string IEducationOrganization.ShortNameOfInstitution { - get - { - if (_sexDescriptor == null) - _sexDescriptor = _sexDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId.Value); - - return _sexDescriptor; - } - set - { - _sexDescriptor = value; - _sexDescriptorId = default(int?); - } + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } } - public virtual int? SourceSystemDescriptorId + string IEducationOrganization.WebSite { - get - { - if (_sourceSystemDescriptorId == default(int?)) - _sourceSystemDescriptorId = string.IsNullOrWhiteSpace(_sourceSystemDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SourceSystemDescriptor", _sourceSystemDescriptor); - - return _sourceSystemDescriptorId; - } - set - { - _sourceSystemDescriptorId = value; - _sourceSystemDescriptor = null; - } + get { return WebSite; } + set { WebSite = value; } } + // ------------------------------------------------------------- - private int? _sourceSystemDescriptorId; - private string _sourceSystemDescriptor; - - public virtual string SourceSystemDescriptor - { - get - { - if (_sourceSystemDescriptor == null) - _sourceSystemDescriptor = _sourceSystemDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SourceSystemDescriptor", _sourceSystemDescriptorId.Value); - - return _sourceSystemDescriptor; - } - set - { - _sourceSystemDescriptor = value; - _sourceSystemDescriptorId = default(int?); - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -20241,14 +25736,27 @@ public virtual string SourceSystemDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CommunityOrganization", "CommunityOrganization")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -20267,374 +25775,63 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.PersonAggregate.EdFi.PersonReferenceData PersonReferenceData { get; set; } - - /// - /// Read-only property that allows the Person discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IContact.PersonDiscriminator - { - get { return PersonReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Person resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IContact.PersonResourceId - { - get { return PersonReferenceData?.Id; } - set { } - } - - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _contactAddresses; - private ICollection _contactAddressesCovariant; - public virtual ICollection ContactAddresses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactAddresses; - } - set - { - _contactAddresses = value; - _contactAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactAddresses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactAddressesCovariant; - } - set - { - ContactAddresses = new HashSet(value.Cast()); - } - } - - - private ICollection _contactElectronicMails; - private ICollection _contactElectronicMailsCovariant; - public virtual ICollection ContactElectronicMails - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactElectronicMails) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactElectronicMails; - } - set - { - _contactElectronicMails = value; - _contactElectronicMailsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactElectronicMails - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactElectronicMails) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactElectronicMailsCovariant; - } - set - { - ContactElectronicMails = new HashSet(value.Cast()); - } - } - - - private ICollection _contactInternationalAddresses; - private ICollection _contactInternationalAddressesCovariant; - public virtual ICollection ContactInternationalAddresses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactInternationalAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactInternationalAddresses; - } - set - { - _contactInternationalAddresses = value; - _contactInternationalAddressesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactInternationalAddresses - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactInternationalAddresses) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactInternationalAddressesCovariant; - } - set - { - ContactInternationalAddresses = new HashSet(value.Cast()); - } - } - - - private ICollection _contactLanguages; - private ICollection _contactLanguagesCovariant; - public virtual ICollection ContactLanguages - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguages) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactLanguages; - } - set - { - _contactLanguages = value; - _contactLanguagesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactLanguages - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguages) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactLanguagesCovariant; - } - set - { - ContactLanguages = new HashSet(value.Cast()); - } - } - - - private ICollection _contactOtherNames; - private ICollection _contactOtherNamesCovariant; - public virtual ICollection ContactOtherNames - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactOtherNames) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactOtherNames; - } - set - { - _contactOtherNames = value; - _contactOtherNamesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactOtherNames - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactOtherNames) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactOtherNamesCovariant; - } - set - { - ContactOtherNames = new HashSet(value.Cast()); - } - } - - - private ICollection _contactPersonalIdentificationDocuments; - private ICollection _contactPersonalIdentificationDocumentsCovariant; - public virtual ICollection ContactPersonalIdentificationDocuments - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactPersonalIdentificationDocuments) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- - - return _contactPersonalIdentificationDocuments; - } - set - { - _contactPersonalIdentificationDocuments = value; - _contactPersonalIdentificationDocumentsCovariant = new CovariantCollectionAdapter(value); - } - } + private IDictionary _aggregateExtensions; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactPersonalIdentificationDocuments - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CommunityOrganization", "CommunityOrganization")] + [Key(18)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactPersonalIdentificationDocuments) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _contactPersonalIdentificationDocumentsCovariant; + return _aggregateExtensions; } set { - ContactPersonalIdentificationDocuments = new HashSet(value.Cast()); - } - } - - - private ICollection _contactTelephones; - private ICollection _contactTelephonesCovariant; - public virtual ICollection ContactTelephones - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactTelephones) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - return _contactTelephones; - } - set - { - _contactTelephones = value; - _contactTelephonesCovariant = new CovariantCollectionAdapter(value); + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContact.ContactTelephones - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactTelephones) - if (item.Contact == null) - item.Contact = this; - // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _contactTelephonesCovariant; - } - set - { - ContactTelephones = new HashSet(value.Cast()); - } - } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "HighestCompletedLevelOfEducationDescriptor", new LookupColumnDetails { PropertyName = "HighestCompletedLevelOfEducationDescriptorId", LookupTypeName = "LevelOfEducationDescriptor"} }, - { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, - { "SourceSystemDescriptor", new LookupColumnDetails { PropertyName = "SourceSystemDescriptorId", LookupTypeName = "SourceSystemDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -20649,7 +25846,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ContactUSI", ContactUSI); + keyValues.Add("CommunityOrganizationId", CommunityOrganizationId); return keyValues; } @@ -20713,33 +25910,36 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContact)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICommunityOrganization)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContact) target, null); + this.MapTo((Entities.Common.EdFi.ICommunityOrganization) target, null); } } +} +// Aggregate: CommunityProvider + +namespace EdFi.Ods.Entities.NHibernate.CommunityProviderAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactAddress table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CommunityProvider table of the CommunityProvider aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CommunityProvider : EducationOrganizationAggregate.EdFi.EducationOrganization, + Entities.Common.EdFi.ICommunityProvider, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ContactAddress() + public CommunityProvider() { - ContactAddressPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -20747,143 +25947,158 @@ public ContactAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } + [DomainSignature] + [IgnoreMember] + public virtual long CommunityProviderId + { + get { return base.EducationOrganizationId; } + set { base.EducationOrganizationId = value; } + } + + // ------------------------------------------------------------- - Entities.Common.EdFi.IContact IContactAddress.Contact + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IEducationOrganization.NameOfInstitution { - get { return Contact; } - set { Contact = (Contact) value; } + get { return NameOfInstitution; } + set { NameOfInstitution = value; } + } + string IEducationOrganization.OperationalStatusDescriptor + { + get { return OperationalStatusDescriptor; } + set { OperationalStatusDescriptor = value; } + } + string IEducationOrganization.ShortNameOfInstitution + { + get { return ShortNameOfInstitution; } + set { ShortNameOfInstitution = value; } + } + string IEducationOrganization.WebSite + { + get { return WebSite; } + set { WebSite = value; } } + // ------------------------------------------------------------- - [DomainSignature] - public virtual int AddressTypeDescriptorId + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(17)] + public virtual long? CommunityOrganizationId { get; set; } + [Key(18)] + public virtual bool? LicenseExemptIndicator { get; set; } + [Key(19)] + public virtual int ProviderCategoryDescriptorId { get { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + if (_providerCategoryDescriptorId == default(int)) + _providerCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderCategoryDescriptor", _providerCategoryDescriptor); - return _addressTypeDescriptorId; + return _providerCategoryDescriptorId; } set { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; + _providerCategoryDescriptorId = value; + _providerCategoryDescriptor = null; } } - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; + private int _providerCategoryDescriptorId; + private string _providerCategoryDescriptor; - public virtual string AddressTypeDescriptor + [IgnoreMember] + public virtual string ProviderCategoryDescriptor { get { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + if (_providerCategoryDescriptor == null) + _providerCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderCategoryDescriptor", _providerCategoryDescriptorId); - return _addressTypeDescriptor; + return _providerCategoryDescriptor; } set { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); + _providerCategoryDescriptor = value; + _providerCategoryDescriptorId = default(int); } } - [DomainSignature] - public virtual string City { get; set; } - [DomainSignature] - public virtual string PostalCode { get; set; } - [DomainSignature] - public virtual int StateAbbreviationDescriptorId + [Key(20)] + public virtual int? ProviderProfitabilityDescriptorId { get { - if (_stateAbbreviationDescriptorId == default(int)) - _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); + if (_providerProfitabilityDescriptorId == default(int?)) + _providerProfitabilityDescriptorId = string.IsNullOrWhiteSpace(_providerProfitabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptor); - return _stateAbbreviationDescriptorId; + return _providerProfitabilityDescriptorId; } set { - _stateAbbreviationDescriptorId = value; - _stateAbbreviationDescriptor = null; + _providerProfitabilityDescriptorId = value; + _providerProfitabilityDescriptor = null; } } - private int _stateAbbreviationDescriptorId; - private string _stateAbbreviationDescriptor; + private int? _providerProfitabilityDescriptorId; + private string _providerProfitabilityDescriptor; - public virtual string StateAbbreviationDescriptor + [IgnoreMember] + public virtual string ProviderProfitabilityDescriptor { get { - if (_stateAbbreviationDescriptor == null) - _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); + if (_providerProfitabilityDescriptor == null) + _providerProfitabilityDescriptor = _providerProfitabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderProfitabilityDescriptor", _providerProfitabilityDescriptorId.Value); - return _stateAbbreviationDescriptor; + return _providerProfitabilityDescriptor; } set { - _stateAbbreviationDescriptor = value; - _stateAbbreviationDescriptorId = default(int); + _providerProfitabilityDescriptor = value; + _providerProfitabilityDescriptorId = default(int?); } } - [DomainSignature] - public virtual string StreetNumberName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string ApartmentRoomSuiteNumber { get; set; } - public virtual string BuildingSiteNumber { get; set; } - public virtual string CongressionalDistrict { get; set; } - public virtual string CountyFIPSCode { get; set; } - public virtual bool? DoNotPublishIndicator { get; set; } - public virtual string Latitude { get; set; } - public virtual int? LocaleDescriptorId + [Key(21)] + public virtual int ProviderStatusDescriptorId { get { - if (_localeDescriptorId == default(int?)) - _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); + if (_providerStatusDescriptorId == default(int)) + _providerStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProviderStatusDescriptor", _providerStatusDescriptor); - return _localeDescriptorId; + return _providerStatusDescriptorId; } set { - _localeDescriptorId = value; - _localeDescriptor = null; + _providerStatusDescriptorId = value; + _providerStatusDescriptor = null; } } - private int? _localeDescriptorId; - private string _localeDescriptor; + private int _providerStatusDescriptorId; + private string _providerStatusDescriptor; - public virtual string LocaleDescriptor + [IgnoreMember] + public virtual string ProviderStatusDescriptor { get { - if (_localeDescriptor == null) - _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); + if (_providerStatusDescriptor == null) + _providerStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProviderStatusDescriptor", _providerStatusDescriptorId); - return _localeDescriptor; + return _providerStatusDescriptor; } set { - _localeDescriptor = value; - _localeDescriptorId = default(int?); + _providerStatusDescriptor = value; + _providerStatusDescriptorId = default(int); } } - public virtual string Longitude { get; set; } - public virtual string NameOfCounty { get; set; } + [Key(22)] + public virtual bool? SchoolIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -20896,14 +26111,27 @@ public virtual string LocaleDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CommunityProvider", "CommunityProvider")] + [Key(23)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -20922,72 +26150,78 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - private ICollection _contactAddressPeriods; - private ICollection _contactAddressPeriodsCovariant; - public virtual ICollection ContactAddressPeriods - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CommunityProvider", "CommunityProvider")] + [Key(24)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddressPeriods) - if (item.ContactAddress == null) - item.ContactAddress = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _contactAddressPeriods; + return _aggregateExtensions; } set { - _contactAddressPeriods = value; - _contactAddressPeriodsCovariant = new CovariantCollectionAdapter(value); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContactAddress.ContactAddressPeriods - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactAddressPeriods) - if (item.ContactAddress == null) - item.ContactAddress = this; - // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _contactAddressPeriodsCovariant; - } - set - { - ContactAddressPeriods = new HashSet(value.Cast()); - } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(25)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the CommunityOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICommunityProvider.CommunityOrganizationResourceId + { + get { return CommunityOrganizationReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, + { "ProviderCategoryDescriptor", new LookupColumnDetails { PropertyName = "ProviderCategoryDescriptorId", LookupTypeName = "ProviderCategoryDescriptor"} }, + { "ProviderProfitabilityDescriptor", new LookupColumnDetails { PropertyName = "ProviderProfitabilityDescriptorId", LookupTypeName = "ProviderProfitabilityDescriptor"} }, + { "ProviderStatusDescriptor", new LookupColumnDetails { PropertyName = "ProviderStatusDescriptorId", LookupTypeName = "ProviderStatusDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -20998,15 +26232,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); - keyValues.Add("City", City); - keyValues.Add("PostalCode", PostalCode); - keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); - keyValues.Add("StreetNumberName", StreetNumberName); + keyValues.Add("CommunityProviderId", CommunityProviderId); return keyValues; } @@ -21070,162 +26300,60 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactAddress)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProvider)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactAddress) target, null); + this.MapTo((Entities.Common.EdFi.ICommunityProvider) target, null); } - void IChildEntity.SetParent(object value) - { - Contact = (Contact) value; - } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 +} +// Aggregate: CommunityProviderLicense +namespace EdFi.Ods.Entities.NHibernate.CommunityProviderLicenseAggregate.EdFi +{ /// - /// A class which represents the edfi.ContactAddressPeriod table of the Contact aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ContactAddressPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ContactAddressPeriod() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ContactAddress ContactAddress { get; set; } - - Entities.Common.EdFi.IContactAddress IContactAddressPeriod.ContactAddress - { - get { return ContactAddress; } - set { ContactAddress = (ContactAddress) value; } - } - - [DomainSignature] - public virtual DateTime BeginDate - { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _beginDate; - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections + [MessagePackObject] + public class CommunityProviderLicenseReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key // ------------------------------------------------------------- + [Key(0)] + public virtual long CommunityProviderId { get; set; } + [Key(1)] + public virtual string LicenseIdentifier { get; set; } + [Key(2)] + public virtual string LicensingOrganization { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(3)] + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(4)] + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (ContactAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); + keyValues.Add("CommunityProviderId", CommunityProviderId); + keyValues.Add("LicenseIdentifier", LicenseIdentifier); + keyValues.Add("LicensingOrganization", LicensingOrganization); return keyValues; } @@ -21246,18 +26374,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -21274,51 +26392,32 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IContactAddressPeriod)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IContactAddressPeriod) target, null); - } - - void IChildEntity.SetParent(object value) - { - ContactAddress = (ContactAddress) value; - } } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactElectronicMail table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CommunityProviderLicense table of the CommunityProviderLicense aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactElectronicMail : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactElectronicMail, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CommunityProviderLicense : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICommunityProviderLicense, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactElectronicMail() + public CommunityProviderLicense() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -21326,64 +26425,153 @@ public ContactElectronicMail() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } + [DomainSignature] + [Key(6)] + public virtual long CommunityProviderId { get; set; } + [DomainSignature] + [Key(7)] + public virtual string LicenseIdentifier { get; set; } + [DomainSignature] + [Key(8)] + public virtual string LicensingOrganization { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.IContact IContactElectronicMail.Contact + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(9)] + public virtual int? AuthorizedFacilityCapacity { get; set; } + [Key(10)] + public virtual DateTime LicenseEffectiveDate { - get { return Contact; } - set { Contact = (Contact) value; } + get { return _licenseEffectiveDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _licenseEffectiveDate = new DateTime(value.Year, value.Month, value.Day); } } - [DomainSignature] - public virtual string ElectronicMailAddress { get; set; } - [DomainSignature] - public virtual int ElectronicMailTypeDescriptorId + private DateTime _licenseEffectiveDate; + + [Key(11)] + public virtual DateTime? LicenseExpirationDate + { + get { return _licenseExpirationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _licenseExpirationDate = null; + } else + { + var given = (DateTime) value; + _licenseExpirationDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _licenseExpirationDate; + + [Key(12)] + public virtual DateTime? LicenseIssueDate + { + get { return _licenseIssueDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _licenseIssueDate = null; + } else + { + var given = (DateTime) value; + _licenseIssueDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _licenseIssueDate; + + [Key(13)] + public virtual int? LicenseStatusDescriptorId { get { - if (_electronicMailTypeDescriptorId == default(int)) - _electronicMailTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptor); + if (_licenseStatusDescriptorId == default(int?)) + _licenseStatusDescriptorId = string.IsNullOrWhiteSpace(_licenseStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseStatusDescriptor", _licenseStatusDescriptor); - return _electronicMailTypeDescriptorId; + return _licenseStatusDescriptorId; } set { - _electronicMailTypeDescriptorId = value; - _electronicMailTypeDescriptor = null; + _licenseStatusDescriptorId = value; + _licenseStatusDescriptor = null; } } - private int _electronicMailTypeDescriptorId; - private string _electronicMailTypeDescriptor; + private int? _licenseStatusDescriptorId; + private string _licenseStatusDescriptor; - public virtual string ElectronicMailTypeDescriptor + [IgnoreMember] + public virtual string LicenseStatusDescriptor { get { - if (_electronicMailTypeDescriptor == null) - _electronicMailTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptorId); + if (_licenseStatusDescriptor == null) + _licenseStatusDescriptor = _licenseStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseStatusDescriptor", _licenseStatusDescriptorId.Value); - return _electronicMailTypeDescriptor; + return _licenseStatusDescriptor; } set { - _electronicMailTypeDescriptor = value; - _electronicMailTypeDescriptorId = default(int); + _licenseStatusDescriptor = value; + _licenseStatusDescriptorId = default(int?); } } - // ------------------------------------------------------------- + [Key(14)] + public virtual int LicenseTypeDescriptorId + { + get + { + if (_licenseTypeDescriptorId == default(int)) + _licenseTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LicenseTypeDescriptor", _licenseTypeDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _licenseTypeDescriptorId; + } + set + { + _licenseTypeDescriptorId = value; + _licenseTypeDescriptor = null; + } + } - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual bool? DoNotPublishIndicator { get; set; } - public virtual bool? PrimaryEmailAddressIndicator { get; set; } + private int _licenseTypeDescriptorId; + private string _licenseTypeDescriptor; + + [IgnoreMember] + public virtual string LicenseTypeDescriptor + { + get + { + if (_licenseTypeDescriptor == null) + _licenseTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LicenseTypeDescriptor", _licenseTypeDescriptorId); + + return _licenseTypeDescriptor; + } + set + { + _licenseTypeDescriptor = value; + _licenseTypeDescriptorId = default(int); + } + } + [Key(15)] + public virtual int? OldestAgeAuthorizedToServe { get; set; } + [Key(16)] + public virtual int? YoungestAgeAuthorizedToServe { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21396,14 +26584,27 @@ public virtual string ElectronicMailTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CommunityProviderLicense", "CommunityProviderLicense")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -21422,12 +26623,64 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CommunityProviderLicense", "CommunityProviderLicense")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(19)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData CommunityProviderReferenceData { get; set; } + + /// + /// Read-only property that allows the CommunityProvider resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICommunityProviderLicense.CommunityProviderResourceId + { + get { return CommunityProviderReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -21438,7 +26691,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ElectronicMailTypeDescriptor", new LookupColumnDetails { PropertyName = "ElectronicMailTypeDescriptorId", LookupTypeName = "ElectronicMailTypeDescriptor"} }, + { "LicenseStatusDescriptor", new LookupColumnDetails { PropertyName = "LicenseStatusDescriptorId", LookupTypeName = "LicenseStatusDescriptor"} }, + { "LicenseTypeDescriptor", new LookupColumnDetails { PropertyName = "LicenseTypeDescriptorId", LookupTypeName = "LicenseTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21449,12 +26703,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); - keyValues.Add("ElectronicMailTypeDescriptorId", ElectronicMailTypeDescriptorId); + keyValues.Add("CommunityProviderId", CommunityProviderId); + keyValues.Add("LicenseIdentifier", LicenseIdentifier); + keyValues.Add("LicensingOrganization", LicensingOrganization); return keyValues; } @@ -21518,175 +26773,84 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactElectronicMail)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICommunityProviderLicense)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactElectronicMail) target, null); + this.MapTo((Entities.Common.EdFi.ICommunityProviderLicense) target, null); } - void IChildEntity.SetParent(object value) - { - Contact = (Contact) value; - } } +} +// Aggregate: CompetencyLevelDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CompetencyLevelDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactInternationalAddress table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CompetencyLevelDescriptor table of the CompetencyLevelDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactInternationalAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CompetencyLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICompetencyLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public ContactInternationalAddress() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } - - Entities.Common.EdFi.IContact IContactInternationalAddress.Contact - { - get { return Contact; } - set { Contact = (Contact) value; } - } - [DomainSignature] - public virtual int AddressTypeDescriptorId - { - get - { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); - - return _addressTypeDescriptorId; - } - set - { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; - } - } - - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; - - public virtual string AddressTypeDescriptor + [IgnoreMember] + public virtual int CompetencyLevelDescriptorId { - get - { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); - - return _addressTypeDescriptor; - } - set - { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string AddressLine1 { get; set; } - public virtual string AddressLine2 { get; set; } - public virtual string AddressLine3 { get; set; } - public virtual string AddressLine4 { get; set; } - public virtual DateTime? BeginDate + string IDescriptor.CodeValue { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return CodeValue; } + set { CodeValue = value; } } - - private DateTime? _beginDate; - - public virtual int CountryDescriptorId + string IDescriptor.Description { - get - { - if (_countryDescriptorId == default(int)) - _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); - - return _countryDescriptorId; - } - set - { - _countryDescriptorId = value; - _countryDescriptor = null; - } + get { return Description; } + set { Description = value; } } - - private int _countryDescriptorId; - private string _countryDescriptor; - - public virtual string CountryDescriptor + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_countryDescriptor == null) - _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); - - return _countryDescriptor; - } - set - { - _countryDescriptor = value; - _countryDescriptorId = default(int); - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - public virtual DateTime? EndDate + DateTime? IDescriptor.EffectiveEndDate { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- - private DateTime? _endDate; - - public virtual string Latitude { get; set; } - public virtual string Longitude { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -21697,35 +26861,6 @@ public virtual DateTime? EndDate // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21741,8 +26876,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -21753,11 +26886,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); return keyValues; } @@ -21821,37 +26954,124 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactInternationalAddress)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyLevelDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactInternationalAddress) target, null); + this.MapTo((Entities.Common.EdFi.ICompetencyLevelDescriptor) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: CompetencyObjective + +namespace EdFi.Ods.Entities.NHibernate.CompetencyObjectiveAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class CompetencyObjectiveReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual long EducationOrganizationId { get; set; } + [Key(1)] + public virtual string Objective { get; set; } + [Key(2)] + public virtual int ObjectiveGradeLevelDescriptorId { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(3)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(4)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - Contact = (Contact) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Objective", Objective); + keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactLanguage table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.CompetencyObjective table of the CompetencyObjective aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactLanguage : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CompetencyObjective : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactLanguage() + public CompetencyObjective() { - ContactLanguageUses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -21859,48 +27079,47 @@ public ContactLanguage() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } - - Entities.Common.EdFi.IContact IContactLanguage.Contact - { - get { return Contact; } - set { Contact = (Contact) value; } - } - [DomainSignature] - public virtual int LanguageDescriptorId + [Key(6)] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + [Key(7)] + public virtual string Objective { get; set; } + [DomainSignature] + [Key(8)] + public virtual int ObjectiveGradeLevelDescriptorId { get { - if (_languageDescriptorId == default(int)) - _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); + if (_objectiveGradeLevelDescriptorId == default(int)) + _objectiveGradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _objectiveGradeLevelDescriptor); - return _languageDescriptorId; + return _objectiveGradeLevelDescriptorId; } set { - _languageDescriptorId = value; - _languageDescriptor = null; + _objectiveGradeLevelDescriptorId = value; + _objectiveGradeLevelDescriptor = null; } } - private int _languageDescriptorId; - private string _languageDescriptor; + private int _objectiveGradeLevelDescriptorId; + private string _objectiveGradeLevelDescriptor; - public virtual string LanguageDescriptor + [IgnoreMember] + public virtual string ObjectiveGradeLevelDescriptor { get { - if (_languageDescriptor == null) - _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); + if (_objectiveGradeLevelDescriptor == null) + _objectiveGradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _objectiveGradeLevelDescriptorId); - return _languageDescriptor; + return _objectiveGradeLevelDescriptor; } set { - _languageDescriptor = value; - _languageDescriptorId = default(int); + _objectiveGradeLevelDescriptor = value; + _objectiveGradeLevelDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -21913,6 +27132,12 @@ public virtual string LanguageDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] + public virtual string CompetencyObjectiveId { get; set; } + [Key(10)] + public virtual string Description { get; set; } + [Key(11)] + public virtual string SuccessCriteria { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -21925,14 +27150,27 @@ public virtual string LanguageDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CompetencyObjective", "CompetencyObjective")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -21951,70 +27189,84 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - private ICollection _contactLanguageUses; - private ICollection _contactLanguageUsesCovariant; - public virtual ICollection ContactLanguageUses - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CompetencyObjective", "CompetencyObjective")] + [Key(13)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguageUses) - if (item.ContactLanguage == null) - item.ContactLanguage = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _contactLanguageUses; + return _aggregateExtensions; } set { - _contactLanguageUses = value; - _contactLanguageUsesCovariant = new CovariantCollectionAdapter(value); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IContactLanguage.ContactLanguageUses + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(14)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationDiscriminator { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _contactLanguageUses) - if (item.ContactLanguage == null) - item.ContactLanguage = this; - // ------------------------------------------------------------- + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } - return _contactLanguageUsesCovariant; - } - set - { - ContactLanguageUses = new HashSet(value.Cast()); - } + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICompetencyObjective.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, + { "ObjectiveGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "ObjectiveGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -22025,11 +27277,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("Objective", Objective); + keyValues.Add("ObjectiveGradeLevelDescriptorId", ObjectiveGradeLevelDescriptorId); return keyValues; } @@ -22093,36 +27347,125 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguage)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICompetencyObjective)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactLanguage) target, null); + this.MapTo((Entities.Common.EdFi.ICompetencyObjective) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: Contact + +namespace EdFi.Ods.Entities.NHibernate.ContactAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class ContactReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual int ContactUSI { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(1)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(2)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - Contact = (Contact) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("ContactUSI", ContactUSI); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactLanguageUse table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.Contact table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactLanguageUse : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactLanguageUse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class Contact : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IContact, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IPersonUsiMutator, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactLanguageUse() + public Contact() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ContactAddresses = new HashSet(); + ContactElectronicMails = new HashSet(); + ContactInternationalAddresses = new HashSet(); + ContactLanguages = new HashSet(); + ContactOtherNames = new HashSet(); + ContactPersonalIdentificationDocuments = new HashSet(); + ContactTelephones = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -22130,60 +27473,199 @@ public ContactLanguageUse() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual ContactLanguage ContactLanguage { get; set; } + [Display(Name="ContactUniqueId")][DomainSignature] + [Key(6)] + public virtual int ContactUSI + { + get + { + if (_contactUSI == default(int) && _contactUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Contact", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_contactUniqueId, out var usi)) + { + _contactUSI = usi; + } + } - Entities.Common.EdFi.IContactLanguage IContactLanguageUse.ContactLanguage + return _contactUSI; + } + set + { + _contactUSI = value; + } + } + + private int _contactUSI; + string IIdentifiablePerson.UniqueId { get { return ContactUniqueId; } } + + // Supports deserialization of entities that don't have surrogate id available after creation + void IPersonUsiMutator.SetUsi(int newValue) => _contactUSI = newValue; + int IPersonUsiMutator.GetUsi() => _contactUSI; + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(7)] + public virtual string ContactUniqueId { - get { return ContactLanguage; } - set { ContactLanguage = (ContactLanguage) value; } + get + { + if (_contactUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Contact", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_contactUSI, out var uniqueId)) + { + _contactUniqueId = uniqueId; + } + } + + return _contactUniqueId; + } + set + { + _contactUniqueId = value; + } + } + private string _contactUniqueId; + + [Key(8)] + public virtual string FirstName { get; set; } + [Key(9)] + public virtual string GenderIdentity { get; set; } + [Key(10)] + public virtual string GenerationCodeSuffix { get; set; } + [Key(11)] + public virtual int? HighestCompletedLevelOfEducationDescriptorId + { + get + { + if (_highestCompletedLevelOfEducationDescriptorId == default(int?)) + _highestCompletedLevelOfEducationDescriptorId = string.IsNullOrWhiteSpace(_highestCompletedLevelOfEducationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptor); + + return _highestCompletedLevelOfEducationDescriptorId; + } + set + { + _highestCompletedLevelOfEducationDescriptorId = value; + _highestCompletedLevelOfEducationDescriptor = null; + } } - [DomainSignature] - public virtual int LanguageUseDescriptorId + private int? _highestCompletedLevelOfEducationDescriptorId; + private string _highestCompletedLevelOfEducationDescriptor; + + [IgnoreMember] + public virtual string HighestCompletedLevelOfEducationDescriptor { get { - if (_languageUseDescriptorId == default(int)) - _languageUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageUseDescriptor", _languageUseDescriptor); + if (_highestCompletedLevelOfEducationDescriptor == null) + _highestCompletedLevelOfEducationDescriptor = _highestCompletedLevelOfEducationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LevelOfEducationDescriptor", _highestCompletedLevelOfEducationDescriptorId.Value); + + return _highestCompletedLevelOfEducationDescriptor; + } + set + { + _highestCompletedLevelOfEducationDescriptor = value; + _highestCompletedLevelOfEducationDescriptorId = default(int?); + } + } + [Key(12)] + public virtual string LastSurname { get; set; } + [Key(13)] + public virtual string LoginId { get; set; } + [Key(14)] + public virtual string MaidenName { get; set; } + [Key(15)] + public virtual string MiddleName { get; set; } + [Key(16)] + public virtual string PersonalTitlePrefix { get; set; } + [Key(17)] + public virtual string PersonId { get; set; } + [Key(18)] + public virtual string PreferredFirstName { get; set; } + [Key(19)] + public virtual string PreferredLastSurname { get; set; } + [Key(20)] + public virtual int? SexDescriptorId + { + get + { + if (_sexDescriptorId == default(int?)) + _sexDescriptorId = string.IsNullOrWhiteSpace(_sexDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); - return _languageUseDescriptorId; + return _sexDescriptorId; } set { - _languageUseDescriptorId = value; - _languageUseDescriptor = null; + _sexDescriptorId = value; + _sexDescriptor = null; } } - private int _languageUseDescriptorId; - private string _languageUseDescriptor; + private int? _sexDescriptorId; + private string _sexDescriptor; - public virtual string LanguageUseDescriptor + [IgnoreMember] + public virtual string SexDescriptor { get { - if (_languageUseDescriptor == null) - _languageUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageUseDescriptor", _languageUseDescriptorId); + if (_sexDescriptor == null) + _sexDescriptor = _sexDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId.Value); - return _languageUseDescriptor; + return _sexDescriptor; } set { - _languageUseDescriptor = value; - _languageUseDescriptorId = default(int); + _sexDescriptor = value; + _sexDescriptorId = default(int?); } } - // ------------------------------------------------------------- + [Key(21)] + public virtual int? SourceSystemDescriptorId + { + get + { + if (_sourceSystemDescriptorId == default(int?)) + _sourceSystemDescriptorId = string.IsNullOrWhiteSpace(_sourceSystemDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SourceSystemDescriptor", _sourceSystemDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _sourceSystemDescriptorId; + } + set + { + _sourceSystemDescriptorId = value; + _sourceSystemDescriptor = null; + } + } - // ============================================================= - // Properties - // ------------------------------------------------------------- + private int? _sourceSystemDescriptorId; + private string _sourceSystemDescriptor; + + [IgnoreMember] + public virtual string SourceSystemDescriptor + { + get + { + if (_sourceSystemDescriptor == null) + _sourceSystemDescriptor = _sourceSystemDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SourceSystemDescriptor", _sourceSystemDescriptorId.Value); + + return _sourceSystemDescriptor; + } + set + { + _sourceSystemDescriptor = value; + _sourceSystemDescriptorId = default(int?); + } + } // ------------------------------------------------------------- // ============================================================= @@ -22196,279 +27678,503 @@ public virtual string LanguageUseDescriptor // ------------------------------------------------------------- private IDictionary _extensions; - public IDictionary Extensions - { - get => _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "Contact")] + [Key(22)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "Contact")] + [Key(23)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } set { - // If the _extensions is null, this is being assigned from the constructor + // If the _aggregateExtensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_aggregateExtensions != null && value != null) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) + foreach (var key in _aggregateExtensions.Keys) { if (!value.Contains(key)) { - value[key] = _extensions[key]; + value[key] = _aggregateExtensions[key]; } } } - _extensions = value; + _aggregateExtensions = value; } } - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(24)] + public virtual NHibernate.PersonAggregate.EdFi.PersonReferenceData PersonReferenceData { get; set; } + + /// + /// Read-only property that allows the Person discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IContact.PersonDiscriminator + { + get { return PersonReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Person resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IContact.PersonResourceId + { + get { return PersonReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + private ICollection _contactAddresses; + private ICollection _contactAddressesCovariant; + [Key(25)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactAddresses + { + get { - { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, - { "LanguageUseDescriptor", new LookupColumnDetails { PropertyName = "LanguageUseDescriptorId", LookupTypeName = "LanguageUseDescriptor"} }, - }; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactAddresses is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "ContactAddresses"); + } + + foreach (var item in _contactAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _contactAddresses; + } + set + { + _contactAddresses = value; + _contactAddressesCovariant = new CovariantCollectionAdapter(value); + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactAddresses { - // Get parent key values - var keyValues = (ContactLanguage as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - return keyValues; + return _contactAddressesCovariant; + } + set + { + ContactAddresses = new HashSet(value.Cast()); + } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - foreach (DictionaryEntry entry in theseKeys) + private ICollection _contactElectronicMails; + private ICollection _contactElectronicMailsCovariant; + [Key(26)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactElectronicMails + { + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactElectronicMails is DeserializedPersistentGenericSet set) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + set.Reattach(this, "ContactElectronicMails"); } - } + + foreach (var item in _contactElectronicMails) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - return true; + return _contactElectronicMails; + } + set + { + _contactElectronicMails = value; + _contactElectronicMailsCovariant = new CovariantCollectionAdapter(value); + } } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactElectronicMails { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactElectronicMails) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - if (keyValues.Count == 0) - return base.GetHashCode(); + return _contactElectronicMailsCovariant; + } + set + { + ContactElectronicMails = new HashSet(value.Cast()); + } + } - var hashCode = new HashCode(); - foreach (DictionaryEntry entry in keyValues) + private ICollection _contactInternationalAddresses; + private ICollection _contactInternationalAddressesCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactInternationalAddresses + { + get { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactInternationalAddresses is DeserializedPersistentGenericSet set) { - hashCode.Add(entry.Value); + set.Reattach(this, "ContactInternationalAddresses"); } - } + + foreach (var item in _contactInternationalAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguageUse)target); + return _contactInternationalAddresses; + } + set + { + _contactInternationalAddresses = value; + _contactInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + } } - void IMappable.Map(object target) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactInternationalAddresses { - this.MapTo((Entities.Common.EdFi.IContactLanguageUse) target, null); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactInternationalAddresses) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactInternationalAddressesCovariant; + } + set + { + ContactInternationalAddresses = new HashSet(value.Cast()); + } } - void IChildEntity.SetParent(object value) + + private ICollection _contactLanguages; + private ICollection _contactLanguagesCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactLanguages { - ContactLanguage = (ContactLanguage) value; - } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactLanguages is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "ContactLanguages"); + } + + foreach (var item in _contactLanguages) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - /// - /// A class which represents the edfi.ContactOtherName table of the Contact aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ContactOtherName : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } + return _contactLanguages; + } + set + { + _contactLanguages = value; + _contactLanguagesCovariant = new CovariantCollectionAdapter(value); + } + } - public ContactOtherName() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactLanguages { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactLanguages) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactLanguagesCovariant; + } + set + { + ContactLanguages = new HashSet(value.Cast()); + } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } - Entities.Common.EdFi.IContact IContactOtherName.Contact + private ICollection _contactOtherNames; + private ICollection _contactOtherNamesCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactOtherNames { - get { return Contact; } - set { Contact = (Contact) value; } + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactOtherNames is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "ContactOtherNames"); + } + + foreach (var item in _contactOtherNames) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactOtherNames; + } + set + { + _contactOtherNames = value; + _contactOtherNamesCovariant = new CovariantCollectionAdapter(value); + } } - [DomainSignature] - public virtual int OtherNameTypeDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactOtherNames { get { - if (_otherNameTypeDescriptorId == default(int)) - _otherNameTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OtherNameTypeDescriptor", _otherNameTypeDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactOtherNames) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - return _otherNameTypeDescriptorId; - } + return _contactOtherNamesCovariant; + } set { - _otherNameTypeDescriptorId = value; - _otherNameTypeDescriptor = null; + ContactOtherNames = new HashSet(value.Cast()); } } - private int _otherNameTypeDescriptorId; - private string _otherNameTypeDescriptor; - public virtual string OtherNameTypeDescriptor + private ICollection _contactPersonalIdentificationDocuments; + private ICollection _contactPersonalIdentificationDocumentsCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactPersonalIdentificationDocuments { get { - if (_otherNameTypeDescriptor == null) - _otherNameTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OtherNameTypeDescriptor", _otherNameTypeDescriptorId); - - return _otherNameTypeDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactPersonalIdentificationDocuments is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "ContactPersonalIdentificationDocuments"); + } + + foreach (var item in _contactPersonalIdentificationDocuments) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- + + return _contactPersonalIdentificationDocuments; } set { - _otherNameTypeDescriptor = value; - _otherNameTypeDescriptorId = default(int); + _contactPersonalIdentificationDocuments = value; + _contactPersonalIdentificationDocumentsCovariant = new CovariantCollectionAdapter(value); } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string FirstName { get; set; } - public virtual string GenerationCodeSuffix { get; set; } - public virtual string LastSurname { get; set; } - public virtual string MiddleName { get; set; } - public virtual string PersonalTitlePrefix { get; set; } - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactPersonalIdentificationDocuments + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactPersonalIdentificationDocuments) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _contactPersonalIdentificationDocumentsCovariant; + } + set + { + ContactPersonalIdentificationDocuments = new HashSet(value.Cast()); + } + } - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - public IDictionary Extensions + private ICollection _contactTelephones; + private ICollection _contactTelephonesCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactTelephones { - get => _extensions; - set + get { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactTelephones is DeserializedPersistentGenericSet set) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } + set.Reattach(this, "ContactTelephones"); } + + foreach (var item in _contactTelephones) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - _extensions = value; + return _contactTelephones; + } + set + { + _contactTelephones = value; + _contactTelephonesCovariant = new CovariantCollectionAdapter(value); } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContact.ContactTelephones + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactTelephones) + if (item.Contact == null) + item.Contact = this; + // ------------------------------------------------------------- - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _contactTelephonesCovariant; + } + set + { + ContactTelephones = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "OtherNameTypeDescriptor", new LookupColumnDetails { PropertyName = "OtherNameTypeDescriptorId", LookupTypeName = "OtherNameTypeDescriptor"} }, + { "HighestCompletedLevelOfEducationDescriptor", new LookupColumnDetails { PropertyName = "HighestCompletedLevelOfEducationDescriptorId", LookupTypeName = "LevelOfEducationDescriptor"} }, + { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, + { "SourceSystemDescriptor", new LookupColumnDetails { PropertyName = "SourceSystemDescriptorId", LookupTypeName = "SourceSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -22479,11 +28185,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); + keyValues.Add("ContactUSI", ContactUSI); return keyValues; } @@ -22547,36 +28253,34 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactOtherName)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContact)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactOtherName) target, null); + this.MapTo((Entities.Common.EdFi.IContact) target, null); } - void IChildEntity.SetParent(object value) - { - Contact = (Contact) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactPersonalIdentificationDocument table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.ContactAddress table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ContactAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactPersonalIdentificationDocument() + public ContactAddress() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + ContactAddressPeriods = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -22584,85 +28288,98 @@ public ContactPersonalIdentificationDocument() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Contact Contact { get; set; } - Entities.Common.EdFi.IContact IContactPersonalIdentificationDocument.Contact + Entities.Common.EdFi.IContact IContactAddress.Contact { get { return Contact; } set { Contact = (Contact) value; } } [DomainSignature] - public virtual int IdentificationDocumentUseDescriptorId + [Key(1)] + public virtual int AddressTypeDescriptorId { get { - if (_identificationDocumentUseDescriptorId == default(int)) - _identificationDocumentUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptor); + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); - return _identificationDocumentUseDescriptorId; + return _addressTypeDescriptorId; } set { - _identificationDocumentUseDescriptorId = value; - _identificationDocumentUseDescriptor = null; + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; } } - private int _identificationDocumentUseDescriptorId; - private string _identificationDocumentUseDescriptor; + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; - public virtual string IdentificationDocumentUseDescriptor + [IgnoreMember] + public virtual string AddressTypeDescriptor { get { - if (_identificationDocumentUseDescriptor == null) - _identificationDocumentUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptorId); + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); - return _identificationDocumentUseDescriptor; + return _addressTypeDescriptor; } set { - _identificationDocumentUseDescriptor = value; - _identificationDocumentUseDescriptorId = default(int); + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); } } [DomainSignature] - public virtual int PersonalInformationVerificationDescriptorId + [Key(2)] + public virtual string City { get; set; } + [DomainSignature] + [Key(3)] + public virtual string PostalCode { get; set; } + [DomainSignature] + [Key(4)] + public virtual int StateAbbreviationDescriptorId { get { - if (_personalInformationVerificationDescriptorId == default(int)) - _personalInformationVerificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptor); + if (_stateAbbreviationDescriptorId == default(int)) + _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); - return _personalInformationVerificationDescriptorId; + return _stateAbbreviationDescriptorId; } set { - _personalInformationVerificationDescriptorId = value; - _personalInformationVerificationDescriptor = null; + _stateAbbreviationDescriptorId = value; + _stateAbbreviationDescriptor = null; } } - private int _personalInformationVerificationDescriptorId; - private string _personalInformationVerificationDescriptor; + private int _stateAbbreviationDescriptorId; + private string _stateAbbreviationDescriptor; - public virtual string PersonalInformationVerificationDescriptor + [IgnoreMember] + public virtual string StateAbbreviationDescriptor { get { - if (_personalInformationVerificationDescriptor == null) - _personalInformationVerificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptorId); + if (_stateAbbreviationDescriptor == null) + _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); - return _personalInformationVerificationDescriptor; + return _stateAbbreviationDescriptor; } set { - _personalInformationVerificationDescriptor = value; - _personalInformationVerificationDescriptorId = default(int); + _stateAbbreviationDescriptor = value; + _stateAbbreviationDescriptorId = default(int); } } + [DomainSignature] + [Key(5)] + public virtual string StreetNumberName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -22673,62 +28390,58 @@ public virtual string PersonalInformationVerificationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? DocumentExpirationDate - { - get { return _documentExpirationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _documentExpirationDate = null; - } else - { - var given = (DateTime) value; - _documentExpirationDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _documentExpirationDate; - - public virtual string DocumentTitle { get; set; } - public virtual int? IssuerCountryDescriptorId + [Key(6)] + public virtual string ApartmentRoomSuiteNumber { get; set; } + [Key(7)] + public virtual string BuildingSiteNumber { get; set; } + [Key(8)] + public virtual string CongressionalDistrict { get; set; } + [Key(9)] + public virtual string CountyFIPSCode { get; set; } + [Key(10)] + public virtual bool? DoNotPublishIndicator { get; set; } + [Key(11)] + public virtual string Latitude { get; set; } + [Key(12)] + public virtual int? LocaleDescriptorId { get { - if (_issuerCountryDescriptorId == default(int?)) - _issuerCountryDescriptorId = string.IsNullOrWhiteSpace(_issuerCountryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _issuerCountryDescriptor); + if (_localeDescriptorId == default(int?)) + _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); - return _issuerCountryDescriptorId; + return _localeDescriptorId; } set { - _issuerCountryDescriptorId = value; - _issuerCountryDescriptor = null; + _localeDescriptorId = value; + _localeDescriptor = null; } } - private int? _issuerCountryDescriptorId; - private string _issuerCountryDescriptor; + private int? _localeDescriptorId; + private string _localeDescriptor; - public virtual string IssuerCountryDescriptor + [IgnoreMember] + public virtual string LocaleDescriptor { get { - if (_issuerCountryDescriptor == null) - _issuerCountryDescriptor = _issuerCountryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _issuerCountryDescriptorId.Value); + if (_localeDescriptor == null) + _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); - return _issuerCountryDescriptor; + return _localeDescriptor; } set { - _issuerCountryDescriptor = value; - _issuerCountryDescriptorId = default(int?); + _localeDescriptor = value; + _localeDescriptorId = default(int?); } } - public virtual string IssuerDocumentIdentificationCode { get; set; } - public virtual string IssuerName { get; set; } + [Key(13)] + public virtual string Longitude { get; set; } + [Key(14)] + public virtual string NameOfCounty { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -22741,14 +28454,27 @@ public virtual string IssuerCountryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactAddress")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -22767,7 +28493,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactAddress")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -22778,14 +28544,68 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _contactAddressPeriods; + private ICollection _contactAddressPeriodsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactAddressPeriods + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactAddressPeriods is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "ContactAddressPeriods"); + } + + foreach (var item in _contactAddressPeriods) + if (item.ContactAddress == null) + item.ContactAddress = this; + // ------------------------------------------------------------- + + return _contactAddressPeriods; + } + set + { + _contactAddressPeriods = value; + _contactAddressPeriodsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContactAddress.ContactAddressPeriods + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactAddressPeriods) + if (item.ContactAddress == null) + item.ContactAddress = this; + // ------------------------------------------------------------- + + return _contactAddressPeriodsCovariant; + } + set + { + ContactAddressPeriods = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IdentificationDocumentUseDescriptor", new LookupColumnDetails { PropertyName = "IdentificationDocumentUseDescriptorId", LookupTypeName = "IdentificationDocumentUseDescriptor"} }, - { "IssuerCountryDescriptor", new LookupColumnDetails { PropertyName = "IssuerCountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, - { "PersonalInformationVerificationDescriptor", new LookupColumnDetails { PropertyName = "PersonalInformationVerificationDescriptorId", LookupTypeName = "PersonalInformationVerificationDescriptor"} }, + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -22797,11 +28617,14 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Contact as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); - keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("City", City); + keyValues.Add("PostalCode", PostalCode); + keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); + keyValues.Add("StreetNumberName", StreetNumberName); return keyValues; } @@ -22865,12 +28688,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument) target, null); + this.MapTo((Entities.Common.EdFi.IContactAddress) target, null); } void IChildEntity.SetParent(object value) @@ -22882,19 +28705,20 @@ void IChildEntity.SetParent(object value) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactTelephone table of the Contact aggregate in the ODS database. + /// A class which represents the edfi.ContactAddressPeriod table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactTelephone : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IContactTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ContactAddressPeriod : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public ContactTelephone() + public ContactAddressPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -22902,52 +28726,26 @@ public ContactTelephone() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Contact Contact { get; set; } + [DomainSignature, IgnoreMember] + public virtual ContactAddress ContactAddress { get; set; } - Entities.Common.EdFi.IContact IContactTelephone.Contact + Entities.Common.EdFi.IContactAddress IContactAddressPeriod.ContactAddress { - get { return Contact; } - set { Contact = (Contact) value; } + get { return ContactAddress; } + set { ContactAddress = (ContactAddress) value; } } [DomainSignature] - public virtual string TelephoneNumber { get; set; } - [DomainSignature] - public virtual int TelephoneNumberTypeDescriptorId + [Key(1)] + public virtual DateTime BeginDate { - get - { - if (_telephoneNumberTypeDescriptorId == default(int)) - _telephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptor); - - return _telephoneNumberTypeDescriptorId; - } - set - { - _telephoneNumberTypeDescriptorId = value; - _telephoneNumberTypeDescriptor = null; - } + get { return _beginDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } } - private int _telephoneNumberTypeDescriptorId; - private string _telephoneNumberTypeDescriptor; - - public virtual string TelephoneNumberTypeDescriptor - { - get - { - if (_telephoneNumberTypeDescriptor == null) - _telephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptorId); - - return _telephoneNumberTypeDescriptor; - } - set - { - _telephoneNumberTypeDescriptor = value; - _telephoneNumberTypeDescriptorId = default(int); - } - } + private DateTime _beginDate; + // ------------------------------------------------------------- // ============================================================= @@ -22958,9 +28756,26 @@ public virtual string TelephoneNumberTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool? DoNotPublishIndicator { get; set; } - public virtual int? OrderOfPriority { get; set; } - public virtual bool? TextMessageCapabilityIndicator { get; set; } + [Key(2)] + public virtual DateTime? EndDate + { + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _endDate; + // ------------------------------------------------------------- // ============================================================= @@ -22973,14 +28788,27 @@ public virtual string TelephoneNumberTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactAddressPeriod")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -22999,7 +28827,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactAddressPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -23015,7 +28883,8 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "TelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "TelephoneNumberTypeDescriptorId", LookupTypeName = "TelephoneNumberTypeDescriptor"} }, + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23027,11 +28896,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Contact as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ContactAddress as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("TelephoneNumber", TelephoneNumber); - keyValues.Add("TelephoneNumberTypeDescriptorId", TelephoneNumberTypeDescriptorId); + keyValues.Add("BeginDate", BeginDate); return keyValues; } @@ -23095,265 +28963,107 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContactTelephone)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactAddressPeriod)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContactTelephone) target, null); + this.MapTo((Entities.Common.EdFi.IContactAddressPeriod) target, null); } void IChildEntity.SetParent(object value) { - Contact = (Contact) value; + ContactAddress = (ContactAddress) value; } } -} -// Aggregate: ContactTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ContactTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContactTypeDescriptor table of the ContactTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactElectronicMail table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContactTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IContactTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class ContactElectronicMail : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactElectronicMail, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ContactTypeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + public ContactElectronicMail() { - get { return ShortDescription; } - set { ShortDescription = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual Contact Contact { get; set; } - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + Entities.Common.EdFi.IContact IContactElectronicMail.Contact { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("ContactTypeDescriptorId", ContactTypeDescriptorId); - - return keyValues; + get { return Contact; } + set { Contact = (Contact) value; } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [DomainSignature] + [Key(1)] + public virtual string ElectronicMailAddress { get; set; } + [DomainSignature] + [Key(2)] + public virtual int ElectronicMailTypeDescriptorId { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + if (_electronicMailTypeDescriptorId == default(int)) + _electronicMailTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptor); - foreach (DictionaryEntry entry in keyValues) + return _electronicMailTypeDescriptorId; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + _electronicMailTypeDescriptorId = value; + _electronicMailTypeDescriptor = null; } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IContactTypeDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IContactTypeDescriptor) target, null); } - } -} -// Aggregate: ContentClassDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ContentClassDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.ContentClassDescriptor table of the ContentClassDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class ContentClassDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IContentClassDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int ContentClassDescriptorId + private int _electronicMailTypeDescriptorId; + private string _electronicMailTypeDescriptor; + + [IgnoreMember] + public virtual string ElectronicMailTypeDescriptor { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get + { + if (_electronicMailTypeDescriptor == null) + _electronicMailTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ElectronicMailTypeDescriptor", _electronicMailTypeDescriptorId); + + return _electronicMailTypeDescriptor; + } + set + { + _electronicMailTypeDescriptor = value; + _electronicMailTypeDescriptorId = default(int); + } } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] + public virtual bool? DoNotPublishIndicator { get; set; } + [Key(4)] + public virtual bool? PrimaryEmailAddressIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23364,6 +29074,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactElectronicMail")] + [Key(5)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactElectronicMail")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -23379,6 +29171,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "ElectronicMailTypeDescriptor", new LookupColumnDetails { PropertyName = "ElectronicMailTypeDescriptorId", LookupTypeName = "ElectronicMailTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23389,11 +29182,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("ContentClassDescriptorId", ContentClassDescriptorId); + keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); + keyValues.Add("ElectronicMailTypeDescriptorId", ElectronicMailTypeDescriptorId); return keyValues; } @@ -23457,82 +29251,188 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContentClassDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactElectronicMail)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContentClassDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IContactElectronicMail) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } -} -// Aggregate: ContinuationOfServicesReasonDescriptor - -namespace EdFi.Ods.Entities.NHibernate.ContinuationOfServicesReasonDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.ContinuationOfServicesReasonDescriptor table of the ContinuationOfServicesReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactInternationalAddress table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class ContinuationOfServicesReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class ContactInternationalAddress : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ContactInternationalAddress() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactInternationalAddress.Contact + { + get { return Contact; } + set { Contact = (Contact) value; } + } + [DomainSignature] - public virtual int ContinuationOfServicesReasonDescriptorId + [Key(1)] + public virtual int AddressTypeDescriptorId { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get + { + if (_addressTypeDescriptorId == default(int)) + _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + + return _addressTypeDescriptorId; + } + set + { + _addressTypeDescriptorId = value; + _addressTypeDescriptor = null; + } + } + + private int _addressTypeDescriptorId; + private string _addressTypeDescriptor; + + [IgnoreMember] + public virtual string AddressTypeDescriptor + { + get + { + if (_addressTypeDescriptor == null) + _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + + return _addressTypeDescriptor; + } + set + { + _addressTypeDescriptor = value; + _addressTypeDescriptorId = default(int); + } } - // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual string AddressLine1 { get; set; } + [Key(3)] + public virtual string AddressLine2 { get; set; } + [Key(4)] + public virtual string AddressLine3 { get; set; } + [Key(5)] + public virtual string AddressLine4 { get; set; } + [Key(6)] + public virtual DateTime? BeginDate { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return _beginDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _beginDate = null; + } else + { + var given = (DateTime) value; + _beginDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - DateTime? IDescriptor.EffectiveEndDate + + private DateTime? _beginDate; + + [Key(7)] + public virtual int CountryDescriptorId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_countryDescriptorId == default(int)) + _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); + + return _countryDescriptorId; + } + set + { + _countryDescriptorId = value; + _countryDescriptor = null; + } } - string IDescriptor.Namespace + + private int _countryDescriptorId; + private string _countryDescriptor; + + [IgnoreMember] + public virtual string CountryDescriptor { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_countryDescriptor == null) + _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); + + return _countryDescriptor; + } + set + { + _countryDescriptor = value; + _countryDescriptorId = default(int); + } } - string IDescriptor.ShortDescription + [Key(8)] + public virtual DateTime? EndDate { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return _endDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _endDate = null; + } else + { + var given = (DateTime) value; + _endDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- + private DateTime? _endDate; + + [Key(9)] + public virtual string Latitude { get; set; } + [Key(10)] + public virtual string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -23543,6 +29443,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactInternationalAddress")] + [Key(11)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactInternationalAddress")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -23558,6 +29540,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, + { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23568,11 +29552,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("ContinuationOfServicesReasonDescriptorId", ContinuationOfServicesReasonDescriptorId); + keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); return keyValues; } @@ -23636,79 +29620,98 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactInternationalAddress)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IContactInternationalAddress) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } -} -// Aggregate: CostRateDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CostRateDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CostRateDescriptor table of the CostRateDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactLanguage table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CostRateDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICostRateDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class ContactLanguage : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CostRateDescriptorId + public ContactLanguage() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + ContactLanguageUses = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactLanguage.Contact { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Contact; } + set { Contact = (Contact) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int LanguageDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_languageDescriptorId == default(int)) + _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); + + return _languageDescriptorId; + } + set + { + _languageDescriptorId = value; + _languageDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _languageDescriptorId; + private string _languageDescriptor; + + [IgnoreMember] + public virtual string LanguageDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_languageDescriptor == null) + _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); + + return _languageDescriptor; + } + set + { + _languageDescriptor = value; + _languageDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -23722,6 +29725,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactLanguage")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactLanguage")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -23732,11 +29817,66 @@ string IDescriptor.ShortDescription //============================================================= // Collections // ------------------------------------------------------------- + + private ICollection _contactLanguageUses; + private ICollection _contactLanguageUsesCovariant; + [Key(4)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection ContactLanguageUses + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_contactLanguageUses is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "ContactLanguageUses"); + } + + foreach (var item in _contactLanguageUses) + if (item.ContactLanguage == null) + item.ContactLanguage = this; + // ------------------------------------------------------------- + + return _contactLanguageUses; + } + set + { + _contactLanguageUses = value; + _contactLanguageUsesCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IContactLanguage.ContactLanguageUses + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _contactLanguageUses) + if (item.ContactLanguage == null) + item.ContactLanguage = this; + // ------------------------------------------------------------- + + return _contactLanguageUsesCovariant; + } + set + { + ContactLanguageUses = new HashSet(value.Cast()); + } + } + // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23747,11 +29887,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CostRateDescriptorId", CostRateDescriptorId); + keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); return keyValues; } @@ -23815,79 +29955,97 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICostRateDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguage)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICostRateDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IContactLanguage) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } -} -// Aggregate: CountryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CountryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CountryDescriptor table of the CountryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.ContactLanguageUse table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CountryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICountryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class ContactLanguageUse : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactLanguageUse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CountryDescriptorId + public ContactLanguageUse() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual ContactLanguage ContactLanguage { get; set; } + + Entities.Common.EdFi.IContactLanguage IContactLanguageUse.ContactLanguage { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return ContactLanguage; } + set { ContactLanguage = (ContactLanguage) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int LanguageUseDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_languageUseDescriptorId == default(int)) + _languageUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageUseDescriptor", _languageUseDescriptor); + + return _languageUseDescriptorId; + } + set + { + _languageUseDescriptorId = value; + _languageUseDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _languageUseDescriptorId; + private string _languageUseDescriptor; + + [IgnoreMember] + public virtual string LanguageUseDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_languageUseDescriptor == null) + _languageUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageUseDescriptor", _languageUseDescriptorId); + + return _languageUseDescriptor; + } + set + { + _languageUseDescriptor = value; + _languageUseDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -23901,6 +30059,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactLanguageUse")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactLanguageUse")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -23916,6 +30156,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, + { "LanguageUseDescriptor", new LookupColumnDetails { PropertyName = "LanguageUseDescriptorId", LookupTypeName = "LanguageUseDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -23926,11 +30168,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (ContactLanguage as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CountryDescriptorId", CountryDescriptorId); + keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); return keyValues; } @@ -23994,121 +30236,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICountryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactLanguageUse)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICountryDescriptor) target, null); - } - - } -} -// Aggregate: Course - -namespace EdFi.Ods.Entities.NHibernate.CourseAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class CourseReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string CourseCode { get; set; } - public virtual long EducationOrganizationId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.IContactLanguageUse) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + ContactLanguage = (ContactLanguage) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Course table of the Course aggregate in the ODS database. + /// A class which represents the edfi.ContactOtherName table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Course : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ContactOtherName : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Course() + public ContactOtherName() { - CourseAcademicSubjects = new HashSet(); - CourseCompetencyLevels = new HashSet(); - CourseIdentificationCodes = new HashSet(); - CourseLearningStandards = new HashSet(); - CourseLevelCharacteristics = new HashSet(); - CourseOfferedGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -24116,219 +30274,72 @@ public Course() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual string CourseCode { get; set; } - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? CareerPathwayDescriptorId - { - get - { - if (_careerPathwayDescriptorId == default(int?)) - _careerPathwayDescriptorId = string.IsNullOrWhiteSpace(_careerPathwayDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CareerPathwayDescriptor", _careerPathwayDescriptor); - - return _careerPathwayDescriptorId; - } - set - { - _careerPathwayDescriptorId = value; - _careerPathwayDescriptor = null; - } - } - - private int? _careerPathwayDescriptorId; - private string _careerPathwayDescriptor; - - public virtual string CareerPathwayDescriptor - { - get - { - if (_careerPathwayDescriptor == null) - _careerPathwayDescriptor = _careerPathwayDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CareerPathwayDescriptor", _careerPathwayDescriptorId.Value); - - return _careerPathwayDescriptor; - } - set - { - _careerPathwayDescriptor = value; - _careerPathwayDescriptorId = default(int?); - } - } - public virtual int? CourseDefinedByDescriptorId - { - get - { - if (_courseDefinedByDescriptorId == default(int?)) - _courseDefinedByDescriptorId = string.IsNullOrWhiteSpace(_courseDefinedByDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseDefinedByDescriptor", _courseDefinedByDescriptor); - - return _courseDefinedByDescriptorId; - } - set - { - _courseDefinedByDescriptorId = value; - _courseDefinedByDescriptor = null; - } - } - - private int? _courseDefinedByDescriptorId; - private string _courseDefinedByDescriptor; - - public virtual string CourseDefinedByDescriptor - { - get - { - if (_courseDefinedByDescriptor == null) - _courseDefinedByDescriptor = _courseDefinedByDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseDefinedByDescriptor", _courseDefinedByDescriptorId.Value); - - return _courseDefinedByDescriptor; - } - set - { - _courseDefinedByDescriptor = value; - _courseDefinedByDescriptorId = default(int?); - } - } - public virtual string CourseDescription { get; set; } - public virtual int? CourseGPAApplicabilityDescriptorId - { - get - { - if (_courseGPAApplicabilityDescriptorId == default(int?)) - _courseGPAApplicabilityDescriptorId = string.IsNullOrWhiteSpace(_courseGPAApplicabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptor); - - return _courseGPAApplicabilityDescriptorId; - } - set - { - _courseGPAApplicabilityDescriptorId = value; - _courseGPAApplicabilityDescriptor = null; - } - } - - private int? _courseGPAApplicabilityDescriptorId; - private string _courseGPAApplicabilityDescriptor; - - public virtual string CourseGPAApplicabilityDescriptor - { - get - { - if (_courseGPAApplicabilityDescriptor == null) - _courseGPAApplicabilityDescriptor = _courseGPAApplicabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptorId.Value); - - return _courseGPAApplicabilityDescriptor; - } - set - { - _courseGPAApplicabilityDescriptor = value; - _courseGPAApplicabilityDescriptorId = default(int?); - } - } - public virtual string CourseTitle { get; set; } - public virtual DateTime? DateCourseAdopted - { - get { return _dateCourseAdopted; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _dateCourseAdopted = null; - } else - { - var given = (DateTime) value; - _dateCourseAdopted = new DateTime(given.Year, given.Month, given.Day); - } - } - } + [DomainSignature, IgnoreMember] + public virtual Contact Contact { get; set; } - private DateTime? _dateCourseAdopted; - - public virtual bool? HighSchoolCourseRequirement { get; set; } - public virtual int? MaxCompletionsForCredit { get; set; } - public virtual decimal? MaximumAvailableCreditConversion { get; set; } - public virtual decimal? MaximumAvailableCredits { get; set; } - public virtual int? MaximumAvailableCreditTypeDescriptorId + Entities.Common.EdFi.IContact IContactOtherName.Contact { - get - { - if (_maximumAvailableCreditTypeDescriptorId == default(int?)) - _maximumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_maximumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptor); - - return _maximumAvailableCreditTypeDescriptorId; - } - set - { - _maximumAvailableCreditTypeDescriptorId = value; - _maximumAvailableCreditTypeDescriptor = null; - } + get { return Contact; } + set { Contact = (Contact) value; } } - private int? _maximumAvailableCreditTypeDescriptorId; - private string _maximumAvailableCreditTypeDescriptor; - - public virtual string MaximumAvailableCreditTypeDescriptor - { - get - { - if (_maximumAvailableCreditTypeDescriptor == null) - _maximumAvailableCreditTypeDescriptor = _maximumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptorId.Value); - - return _maximumAvailableCreditTypeDescriptor; - } - set - { - _maximumAvailableCreditTypeDescriptor = value; - _maximumAvailableCreditTypeDescriptorId = default(int?); - } - } - public virtual decimal? MinimumAvailableCreditConversion { get; set; } - public virtual decimal? MinimumAvailableCredits { get; set; } - public virtual int? MinimumAvailableCreditTypeDescriptorId + [DomainSignature] + [Key(1)] + public virtual int OtherNameTypeDescriptorId { get { - if (_minimumAvailableCreditTypeDescriptorId == default(int?)) - _minimumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_minimumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptor); + if (_otherNameTypeDescriptorId == default(int)) + _otherNameTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OtherNameTypeDescriptor", _otherNameTypeDescriptor); - return _minimumAvailableCreditTypeDescriptorId; + return _otherNameTypeDescriptorId; } set { - _minimumAvailableCreditTypeDescriptorId = value; - _minimumAvailableCreditTypeDescriptor = null; + _otherNameTypeDescriptorId = value; + _otherNameTypeDescriptor = null; } } - private int? _minimumAvailableCreditTypeDescriptorId; - private string _minimumAvailableCreditTypeDescriptor; + private int _otherNameTypeDescriptorId; + private string _otherNameTypeDescriptor; - public virtual string MinimumAvailableCreditTypeDescriptor + [IgnoreMember] + public virtual string OtherNameTypeDescriptor { get { - if (_minimumAvailableCreditTypeDescriptor == null) - _minimumAvailableCreditTypeDescriptor = _minimumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptorId.Value); + if (_otherNameTypeDescriptor == null) + _otherNameTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OtherNameTypeDescriptor", _otherNameTypeDescriptorId); - return _minimumAvailableCreditTypeDescriptor; + return _otherNameTypeDescriptor; } set { - _minimumAvailableCreditTypeDescriptor = value; - _minimumAvailableCreditTypeDescriptorId = default(int?); + _otherNameTypeDescriptor = value; + _otherNameTypeDescriptorId = default(int); } } - public virtual int NumberOfParts { get; set; } - public virtual int? TimeRequiredForCompletion { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual string FirstName { get; set; } + [Key(3)] + public virtual string GenerationCodeSuffix { get; set; } + [Key(4)] + public virtual string LastSurname { get; set; } + [Key(5)] + public virtual string MiddleName { get; set; } + [Key(6)] + public virtual string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24341,14 +30352,27 @@ public virtual string MinimumAvailableCreditTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactOtherName")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -24367,329 +30391,444 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactOtherName")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + // ------------------------------------------------------------- - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "OtherNameTypeDescriptor", new LookupColumnDetails { PropertyName = "OtherNameTypeDescriptorId", LookupTypeName = "OtherNameTypeDescriptor"} }, + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } + get { return _idPropertyByLookupProperty; } } - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourse.EducationOrganizationResourceId + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); - // ------------------------------------------------------------- + // Add current key values + keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); - //============================================================= - // Collections - // ------------------------------------------------------------- + return keyValues; + } - private ICollection _courseAcademicSubjects; - private ICollection _courseAcademicSubjectsCovariant; - public virtual ICollection CourseAcademicSubjects + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseAcademicSubjects) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _courseAcademicSubjects; - } - set + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _courseAcademicSubjects = value; - _courseAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseAcademicSubjects + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseAcademicSubjects) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _courseAcademicSubjectsCovariant; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - CourseAcademicSubjects = new HashSet(value.Cast()); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IContactOtherName)target); } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IContactOtherName) target, null); + } - private ICollection _courseCompetencyLevels; - private ICollection _courseCompetencyLevelsCovariant; - public virtual ICollection CourseCompetencyLevels + void IChildEntity.SetParent(object value) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseCompetencyLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + Contact = (Contact) value; + } + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 - return _courseCompetencyLevels; - } - set - { - _courseCompetencyLevels = value; - _courseCompetencyLevelsCovariant = new CovariantCollectionAdapter(value); - } + /// + /// A class which represents the edfi.ContactPersonalIdentificationDocument table of the Contact aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class ContactPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public ContactPersonalIdentificationDocument() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual Contact Contact { get; set; } + + Entities.Common.EdFi.IContact IContactPersonalIdentificationDocument.Contact + { + get { return Contact; } + set { Contact = (Contact) value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseCompetencyLevels + [DomainSignature] + [Key(1)] + public virtual int IdentificationDocumentUseDescriptorId { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseCompetencyLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + if (_identificationDocumentUseDescriptorId == default(int)) + _identificationDocumentUseDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptor); - return _courseCompetencyLevelsCovariant; - } + return _identificationDocumentUseDescriptorId; + } set { - CourseCompetencyLevels = new HashSet(value.Cast()); + _identificationDocumentUseDescriptorId = value; + _identificationDocumentUseDescriptor = null; } } + private int _identificationDocumentUseDescriptorId; + private string _identificationDocumentUseDescriptor; - private ICollection _courseIdentificationCodes; - private ICollection _courseIdentificationCodesCovariant; - public virtual ICollection CourseIdentificationCodes + [IgnoreMember] + public virtual string IdentificationDocumentUseDescriptor { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseIdentificationCodes) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseIdentificationCodes; + if (_identificationDocumentUseDescriptor == null) + _identificationDocumentUseDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IdentificationDocumentUseDescriptor", _identificationDocumentUseDescriptorId); + + return _identificationDocumentUseDescriptor; } set { - _courseIdentificationCodes = value; - _courseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + _identificationDocumentUseDescriptor = value; + _identificationDocumentUseDescriptorId = default(int); } } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseIdentificationCodes + [DomainSignature] + [Key(2)] + public virtual int PersonalInformationVerificationDescriptorId { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseIdentificationCodes) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + if (_personalInformationVerificationDescriptorId == default(int)) + _personalInformationVerificationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptor); - return _courseIdentificationCodesCovariant; - } + return _personalInformationVerificationDescriptorId; + } set { - CourseIdentificationCodes = new HashSet(value.Cast()); + _personalInformationVerificationDescriptorId = value; + _personalInformationVerificationDescriptor = null; } } + private int _personalInformationVerificationDescriptorId; + private string _personalInformationVerificationDescriptor; - private ICollection _courseLearningStandards; - private ICollection _courseLearningStandardsCovariant; - public virtual ICollection CourseLearningStandards + [IgnoreMember] + public virtual string PersonalInformationVerificationDescriptor { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLearningStandards) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseLearningStandards; + if (_personalInformationVerificationDescriptor == null) + _personalInformationVerificationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("PersonalInformationVerificationDescriptor", _personalInformationVerificationDescriptorId); + + return _personalInformationVerificationDescriptor; } set { - _courseLearningStandards = value; - _courseLearningStandardsCovariant = new CovariantCollectionAdapter(value); + _personalInformationVerificationDescriptor = value; + _personalInformationVerificationDescriptorId = default(int); } } + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseLearningStandards - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLearningStandards) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _courseLearningStandardsCovariant; - } - set - { - CourseLearningStandards = new HashSet(value.Cast()); + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(3)] + public virtual DateTime? DocumentExpirationDate + { + get { return _documentExpirationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _documentExpirationDate = null; + } else + { + var given = (DateTime) value; + _documentExpirationDate = new DateTime(given.Year, given.Month, given.Day); + } } } - - private ICollection _courseLevelCharacteristics; - private ICollection _courseLevelCharacteristicsCovariant; - public virtual ICollection CourseLevelCharacteristics + private DateTime? _documentExpirationDate; + + [Key(4)] + public virtual string DocumentTitle { get; set; } + [Key(5)] + public virtual int? IssuerCountryDescriptorId { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLevelCharacteristics) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + if (_issuerCountryDescriptorId == default(int?)) + _issuerCountryDescriptorId = string.IsNullOrWhiteSpace(_issuerCountryDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _issuerCountryDescriptor); - return _courseLevelCharacteristics; - } + return _issuerCountryDescriptorId; + } set { - _courseLevelCharacteristics = value; - _courseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); + _issuerCountryDescriptorId = value; + _issuerCountryDescriptor = null; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseLevelCharacteristics + private int? _issuerCountryDescriptorId; + private string _issuerCountryDescriptor; + + [IgnoreMember] + public virtual string IssuerCountryDescriptor { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseLevelCharacteristics) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- - - return _courseLevelCharacteristicsCovariant; + if (_issuerCountryDescriptor == null) + _issuerCountryDescriptor = _issuerCountryDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _issuerCountryDescriptorId.Value); + + return _issuerCountryDescriptor; } set { - CourseLevelCharacteristics = new HashSet(value.Cast()); + _issuerCountryDescriptor = value; + _issuerCountryDescriptorId = default(int?); } } + [Key(6)] + public virtual string IssuerDocumentIdentificationCode { get; set; } + [Key(7)] + public virtual string IssuerName { get; set; } + // ------------------------------------------------------------- + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - private ICollection _courseOfferedGradeLevels; - private ICollection _courseOfferedGradeLevelsCovariant; - public virtual ICollection CourseOfferedGradeLevels + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactPersonalIdentificationDocument")] + [Key(8)] + public IDictionary Extensions { - get + get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferedGradeLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } - return _courseOfferedGradeLevels; + return _extensions; } set { - _courseOfferedGradeLevels = value; - _courseOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourse.CourseOfferedGradeLevels - { + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactPersonalIdentificationDocument")] + [Key(9)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferedGradeLevels) - if (item.Course == null) - item.Course = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _courseOfferedGradeLevelsCovariant; + return _aggregateExtensions; } set { - CourseOfferedGradeLevels = new HashSet(value.Cast()); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CareerPathwayDescriptor", new LookupColumnDetails { PropertyName = "CareerPathwayDescriptorId", LookupTypeName = "CareerPathwayDescriptor"} }, - { "CourseDefinedByDescriptor", new LookupColumnDetails { PropertyName = "CourseDefinedByDescriptorId", LookupTypeName = "CourseDefinedByDescriptor"} }, - { "CourseGPAApplicabilityDescriptor", new LookupColumnDetails { PropertyName = "CourseGPAApplicabilityDescriptorId", LookupTypeName = "CourseGPAApplicabilityDescriptor"} }, - { "MaximumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MaximumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "MinimumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MinimumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "IdentificationDocumentUseDescriptor", new LookupColumnDetails { PropertyName = "IdentificationDocumentUseDescriptorId", LookupTypeName = "IdentificationDocumentUseDescriptor"} }, + { "IssuerCountryDescriptor", new LookupColumnDetails { PropertyName = "IssuerCountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, + { "PersonalInformationVerificationDescriptor", new LookupColumnDetails { PropertyName = "PersonalInformationVerificationDescriptorId", LookupTypeName = "PersonalInformationVerificationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -24700,12 +30839,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Contact as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); + keyValues.Add("PersonalInformationVerificationDescriptorId", PersonalInformationVerificationDescriptorId); return keyValues; } @@ -24769,32 +30908,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourse)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourse) target, null); + this.MapTo((Entities.Common.EdFi.IContactPersonalIdentificationDocument) target, null); } + void IChildEntity.SetParent(object value) + { + Contact = (Contact) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseAcademicSubject table of the Course aggregate in the ODS database. + /// A class which represents the edfi.ContactTelephone table of the Contact aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ContactTelephone : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IContactTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseAcademicSubject() + public ContactTelephone() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -24802,48 +30946,53 @@ public CourseAcademicSubject() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } + [DomainSignature, IgnoreMember] + public virtual Contact Contact { get; set; } - Entities.Common.EdFi.ICourse ICourseAcademicSubject.Course + Entities.Common.EdFi.IContact IContactTelephone.Contact { - get { return Course; } - set { Course = (Course) value; } + get { return Contact; } + set { Contact = (Contact) value; } } [DomainSignature] - public virtual int AcademicSubjectDescriptorId + [Key(1)] + public virtual string TelephoneNumber { get; set; } + [DomainSignature] + [Key(2)] + public virtual int TelephoneNumberTypeDescriptorId { get { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + if (_telephoneNumberTypeDescriptorId == default(int)) + _telephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptor); - return _academicSubjectDescriptorId; + return _telephoneNumberTypeDescriptorId; } set { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; + _telephoneNumberTypeDescriptorId = value; + _telephoneNumberTypeDescriptor = null; } } - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; + private int _telephoneNumberTypeDescriptorId; + private string _telephoneNumberTypeDescriptor; - public virtual string AcademicSubjectDescriptor + [IgnoreMember] + public virtual string TelephoneNumberTypeDescriptor { get { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + if (_telephoneNumberTypeDescriptor == null) + _telephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TelephoneNumberTypeDescriptor", _telephoneNumberTypeDescriptorId); - return _academicSubjectDescriptor; + return _telephoneNumberTypeDescriptor; } set { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); + _telephoneNumberTypeDescriptor = value; + _telephoneNumberTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -24856,6 +31005,12 @@ public virtual string AcademicSubjectDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] + public virtual bool? DoNotPublishIndicator { get; set; } + [Key(4)] + public virtual int? OrderOfPriority { get; set; } + [Key(5)] + public virtual bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -24868,14 +31023,27 @@ public virtual string AcademicSubjectDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Contact", "ContactTelephone")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -24894,7 +31062,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Contact", "ContactTelephone")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -24910,7 +31118,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, + { "TelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "TelephoneNumberTypeDescriptorId", LookupTypeName = "TelephoneNumberTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -24922,10 +31130,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Contact as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("TelephoneNumber", TelephoneNumber); + keyValues.Add("TelephoneNumberTypeDescriptorId", TelephoneNumberTypeDescriptorId); return keyValues; } @@ -24989,92 +31198,264 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContactTelephone)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.IContactTelephone) target, null); } void IChildEntity.SetParent(object value) { - Course = (Course) value; + Contact = (Contact) value; } } +} +// Aggregate: ContactTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ContactTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseCompetencyLevel table of the Course aggregate in the ODS database. + /// A class which represents the edfi.ContactTypeDescriptor table of the ContactTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseCompetencyLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseCompetencyLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class ContactTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IContactTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public CourseCompetencyLevel() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int ContactTypeDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseCompetencyLevel.Course + string IDescriptor.CodeValue { - get { return Course; } - set { Course = (Course) value; } + get { return CodeValue; } + set { CodeValue = value; } } - - [DomainSignature] - public virtual int CompetencyLevelDescriptorId + string IDescriptor.Description { - get - { - if (_competencyLevelDescriptorId == default(int)) - _competencyLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CompetencyLevelDescriptor", _competencyLevelDescriptor); + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- - return _competencyLevelDescriptorId; - } - set + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - _competencyLevelDescriptorId = value; - _competencyLevelDescriptor = null; - } + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } } - private int _competencyLevelDescriptorId; - private string _competencyLevelDescriptor; + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - public virtual string CompetencyLevelDescriptor + // Add current key values + keyValues.Add("ContactTypeDescriptorId", ContactTypeDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - if (_competencyLevelDescriptor == null) - _competencyLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CompetencyLevelDescriptor", _competencyLevelDescriptorId); - - return _competencyLevelDescriptor; + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } - set + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - _competencyLevelDescriptor = value; - _competencyLevelDescriptorId = default(int); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IContactTypeDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IContactTypeDescriptor) target, null); + } + + } +} +// Aggregate: ContentClassDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ContentClassDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.ContentClassDescriptor table of the ContentClassDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class ContentClassDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IContentClassDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int ContentClassDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -25090,35 +31471,187 @@ public virtual string CompetencyLevelDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; + // ------------------------------------------------------------- - public IDictionary Extensions + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get => _extensions; - set + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("ContentClassDescriptorId", ContentClassDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + if (entry.Value is string) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } + return false; } } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } - _extensions = value; + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IContentClassDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IContentClassDescriptor) target, null); + } + + } +} +// Aggregate: ContinuationOfServicesReasonDescriptor + +namespace EdFi.Ods.Entities.NHibernate.ContinuationOfServicesReasonDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.ContinuationOfServicesReasonDescriptor table of the ContinuationOfServicesReasonDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class ContinuationOfServicesReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int ContinuationOfServicesReasonDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public IDictionary AggregateExtensions { get; set; } + // ============================================================= + // Extensions + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -25134,7 +31667,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CompetencyLevelDescriptor", new LookupColumnDetails { PropertyName = "CompetencyLevelDescriptorId", LookupTypeName = "CompetencyLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -25145,11 +31677,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); + keyValues.Add("ContinuationOfServicesReasonDescriptorId", ContinuationOfServicesReasonDescriptorId); return keyValues; } @@ -25213,100 +31745,84 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseCompetencyLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseCompetencyLevel) target, null); + this.MapTo((Entities.Common.EdFi.IContinuationOfServicesReasonDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } +} +// Aggregate: CostRateDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CostRateDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseIdentificationCode table of the Course aggregate in the ODS database. + /// A class which represents the edfi.CostRateDescriptor table of the CostRateDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CostRateDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICostRateDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseIdentificationCode() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseIdentificationCode.Course - { - get { return Course; } - set { Course = (Course) value; } - } - [DomainSignature] - public virtual int CourseIdentificationSystemDescriptorId - { - get - { - if (_courseIdentificationSystemDescriptorId == default(int)) - _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); - - return _courseIdentificationSystemDescriptorId; - } - set - { - _courseIdentificationSystemDescriptorId = value; - _courseIdentificationSystemDescriptor = null; - } - } - - private int _courseIdentificationSystemDescriptorId; - private string _courseIdentificationSystemDescriptor; - - public virtual string CourseIdentificationSystemDescriptor + [IgnoreMember] + public virtual int CostRateDescriptorId { - get - { - if (_courseIdentificationSystemDescriptor == null) - _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); - - return _courseIdentificationSystemDescriptor; - } - set - { - _courseIdentificationSystemDescriptor = value; - _courseIdentificationSystemDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AssigningOrganizationIdentificationCode { get; set; } - public virtual string CourseCatalogURL { get; set; } - public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -25317,35 +31833,6 @@ public virtual string CourseIdentificationSystemDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -25361,7 +31848,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -25372,11 +31858,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); + keyValues.Add("CostRateDescriptorId", CostRateDescriptorId); return keyValues; } @@ -25440,59 +31926,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICostRateDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.ICostRateDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } +} +// Aggregate: CountryDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CountryDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseLearningStandard table of the Course aggregate in the ODS database. + /// A class which represents the edfi.CountryDescriptor table of the CountryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseLearningStandard : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CountryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICountryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseLearningStandard() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseLearningStandard.Course + [DomainSignature] + [IgnoreMember] + public virtual int CountryDescriptorId { - get { return Course; } - set { Course = (Course) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string LearningStandardId { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -25508,60 +32014,11 @@ Entities.Common.EdFi.ICourse ICourseLearningStandard.Course // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseLearningStandard.LearningStandardResourceId - { - get { return LearningStandardReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -25582,11 +32039,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LearningStandardId", LearningStandardId); + keyValues.Add("CountryDescriptorId", CountryDescriptorId); return keyValues; } @@ -25650,167 +32107,57 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseLearningStandard)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICountryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseLearningStandard) target, null); + this.MapTo((Entities.Common.EdFi.ICountryDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 +} +// Aggregate: Course +namespace EdFi.Ods.Entities.NHibernate.CourseAggregate.EdFi +{ /// - /// A class which represents the edfi.CourseLevelCharacteristic table of the Course aggregate in the ODS database. + /// Represents a read-only reference to the entity. /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseReferenceData : IHasPrimaryKeyValues { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseLevelCharacteristic() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } - - Entities.Common.EdFi.ICourse ICourseLevelCharacteristic.Course - { - get { return Course; } - set { Course = (Course) value; } - } - - [DomainSignature] - public virtual int CourseLevelCharacteristicDescriptorId - { - get - { - if (_courseLevelCharacteristicDescriptorId == default(int)) - _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); - - return _courseLevelCharacteristicDescriptorId; - } - set - { - _courseLevelCharacteristicDescriptorId = value; - _courseLevelCharacteristicDescriptor = null; - } - } - - private int _courseLevelCharacteristicDescriptorId; - private string _courseLevelCharacteristicDescriptor; - - public virtual string CourseLevelCharacteristicDescriptor - { - get - { - if (_courseLevelCharacteristicDescriptor == null) - _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); - - return _courseLevelCharacteristicDescriptor; - } - set - { - _courseLevelCharacteristicDescriptor = value; - _courseLevelCharacteristicDescriptorId = default(int); - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + [Key(0)] + public virtual string CourseCode { get; set; } + [Key(1)] + public virtual long EducationOrganizationId { get; set; } // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, - }; + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(2)] + public virtual Guid? Id { get; set; } - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(3)] + public virtual string Discriminator { get; set; } // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -25831,18 +32178,8 @@ public override bool Equals(object obj) foreach (DictionaryEntry entry in theseKeys) { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; } return true; @@ -25859,51 +32196,38 @@ public override int GetHashCode() foreach (DictionaryEntry entry in keyValues) { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + hashCode.Add(entry.Value); } return hashCode.ToHashCode(); } #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristic)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristic) target, null); - } - - void IChildEntity.SetParent(object value) - { - Course = (Course) value; - } } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferedGradeLevel table of the Course aggregate in the ODS database. + /// A class which represents the edfi.Course table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class Course : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOfferedGradeLevel() + public Course() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CourseAcademicSubjects = new HashSet(); + CourseCompetencyLevels = new HashSet(); + CourseIdentificationCodes = new HashSet(); + CourseLearningStandards = new HashSet(); + CourseLevelCharacteristics = new HashSet(); + CourseOfferedGradeLevels = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -25911,60 +32235,242 @@ public CourseOfferedGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Course Course { get; set; } + [DomainSignature] + [Key(6)] + public virtual string CourseCode { get; set; } + [DomainSignature] + [Key(7)] + public virtual long EducationOrganizationId { get; set; } + // ------------------------------------------------------------- - Entities.Common.EdFi.ICourse ICourseOfferedGradeLevel.Course + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(8)] + public virtual int? CareerPathwayDescriptorId { - get { return Course; } - set { Course = (Course) value; } + get + { + if (_careerPathwayDescriptorId == default(int?)) + _careerPathwayDescriptorId = string.IsNullOrWhiteSpace(_careerPathwayDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CareerPathwayDescriptor", _careerPathwayDescriptor); + + return _careerPathwayDescriptorId; + } + set + { + _careerPathwayDescriptorId = value; + _careerPathwayDescriptor = null; + } } - [DomainSignature] - public virtual int GradeLevelDescriptorId + private int? _careerPathwayDescriptorId; + private string _careerPathwayDescriptor; + + [IgnoreMember] + public virtual string CareerPathwayDescriptor { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_careerPathwayDescriptor == null) + _careerPathwayDescriptor = _careerPathwayDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CareerPathwayDescriptor", _careerPathwayDescriptorId.Value); + + return _careerPathwayDescriptor; + } + set + { + _careerPathwayDescriptor = value; + _careerPathwayDescriptorId = default(int?); + } + } + [Key(9)] + public virtual int? CourseDefinedByDescriptorId + { + get + { + if (_courseDefinedByDescriptorId == default(int?)) + _courseDefinedByDescriptorId = string.IsNullOrWhiteSpace(_courseDefinedByDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseDefinedByDescriptor", _courseDefinedByDescriptor); - return _gradeLevelDescriptorId; + return _courseDefinedByDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _courseDefinedByDescriptorId = value; + _courseDefinedByDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int? _courseDefinedByDescriptorId; + private string _courseDefinedByDescriptor; - public virtual string GradeLevelDescriptor + [IgnoreMember] + public virtual string CourseDefinedByDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_courseDefinedByDescriptor == null) + _courseDefinedByDescriptor = _courseDefinedByDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseDefinedByDescriptor", _courseDefinedByDescriptorId.Value); - return _gradeLevelDescriptor; + return _courseDefinedByDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _courseDefinedByDescriptor = value; + _courseDefinedByDescriptorId = default(int?); } } - // ------------------------------------------------------------- + [Key(10)] + public virtual string CourseDescription { get; set; } + [Key(11)] + public virtual int? CourseGPAApplicabilityDescriptorId + { + get + { + if (_courseGPAApplicabilityDescriptorId == default(int?)) + _courseGPAApplicabilityDescriptorId = string.IsNullOrWhiteSpace(_courseGPAApplicabilityDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptor); - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _courseGPAApplicabilityDescriptorId; + } + set + { + _courseGPAApplicabilityDescriptorId = value; + _courseGPAApplicabilityDescriptor = null; + } + } - // ============================================================= - // Properties - // ------------------------------------------------------------- + private int? _courseGPAApplicabilityDescriptorId; + private string _courseGPAApplicabilityDescriptor; + + [IgnoreMember] + public virtual string CourseGPAApplicabilityDescriptor + { + get + { + if (_courseGPAApplicabilityDescriptor == null) + _courseGPAApplicabilityDescriptor = _courseGPAApplicabilityDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseGPAApplicabilityDescriptor", _courseGPAApplicabilityDescriptorId.Value); + + return _courseGPAApplicabilityDescriptor; + } + set + { + _courseGPAApplicabilityDescriptor = value; + _courseGPAApplicabilityDescriptorId = default(int?); + } + } + [Key(12)] + public virtual string CourseTitle { get; set; } + [Key(13)] + public virtual DateTime? DateCourseAdopted + { + get { return _dateCourseAdopted; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _dateCourseAdopted = null; + } else + { + var given = (DateTime) value; + _dateCourseAdopted = new DateTime(given.Year, given.Month, given.Day); + } + } + } + + private DateTime? _dateCourseAdopted; + + [Key(14)] + public virtual bool? HighSchoolCourseRequirement { get; set; } + [Key(15)] + public virtual int? MaxCompletionsForCredit { get; set; } + [Key(16)] + public virtual decimal? MaximumAvailableCreditConversion { get; set; } + [Key(17)] + public virtual decimal? MaximumAvailableCredits { get; set; } + [Key(18)] + public virtual int? MaximumAvailableCreditTypeDescriptorId + { + get + { + if (_maximumAvailableCreditTypeDescriptorId == default(int?)) + _maximumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_maximumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptor); + + return _maximumAvailableCreditTypeDescriptorId; + } + set + { + _maximumAvailableCreditTypeDescriptorId = value; + _maximumAvailableCreditTypeDescriptor = null; + } + } + + private int? _maximumAvailableCreditTypeDescriptorId; + private string _maximumAvailableCreditTypeDescriptor; + + [IgnoreMember] + public virtual string MaximumAvailableCreditTypeDescriptor + { + get + { + if (_maximumAvailableCreditTypeDescriptor == null) + _maximumAvailableCreditTypeDescriptor = _maximumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _maximumAvailableCreditTypeDescriptorId.Value); + + return _maximumAvailableCreditTypeDescriptor; + } + set + { + _maximumAvailableCreditTypeDescriptor = value; + _maximumAvailableCreditTypeDescriptorId = default(int?); + } + } + [Key(19)] + public virtual decimal? MinimumAvailableCreditConversion { get; set; } + [Key(20)] + public virtual decimal? MinimumAvailableCredits { get; set; } + [Key(21)] + public virtual int? MinimumAvailableCreditTypeDescriptorId + { + get + { + if (_minimumAvailableCreditTypeDescriptorId == default(int?)) + _minimumAvailableCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_minimumAvailableCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptor); + + return _minimumAvailableCreditTypeDescriptorId; + } + set + { + _minimumAvailableCreditTypeDescriptorId = value; + _minimumAvailableCreditTypeDescriptor = null; + } + } + + private int? _minimumAvailableCreditTypeDescriptorId; + private string _minimumAvailableCreditTypeDescriptor; + + [IgnoreMember] + public virtual string MinimumAvailableCreditTypeDescriptor + { + get + { + if (_minimumAvailableCreditTypeDescriptor == null) + _minimumAvailableCreditTypeDescriptor = _minimumAvailableCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _minimumAvailableCreditTypeDescriptorId.Value); + + return _minimumAvailableCreditTypeDescriptor; + } + set + { + _minimumAvailableCreditTypeDescriptor = value; + _minimumAvailableCreditTypeDescriptorId = default(int?); + } + } + [Key(22)] + public virtual int NumberOfParts { get; set; } + [Key(23)] + public virtual int? TimeRequiredForCompletion { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -25977,14 +32483,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Course", "Course")] + [Key(24)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -26003,206 +32522,412 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Course", "Course")] + [Key(25)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(26)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourse.EducationOrganizationDiscriminator + { + get { return EducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourse.EducationOrganizationResourceId + { + get { return EducationOrganizationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + private ICollection _courseAcademicSubjects; + private ICollection _courseAcademicSubjectsCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseAcademicSubjects + { + get { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, - }; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseAcademicSubjects is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseAcademicSubjects"); + } + + foreach (var item in _courseAcademicSubjects) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _courseAcademicSubjects; + } + set + { + _courseAcademicSubjects = value; + _courseAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseAcademicSubjects { - // Get parent key values - var keyValues = (Course as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseAcademicSubjects) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - return keyValues; + return _courseAcademicSubjectsCovariant; + } + set + { + CourseAcademicSubjects = new HashSet(value.Cast()); + } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - foreach (DictionaryEntry entry in theseKeys) + private ICollection _courseCompetencyLevels; + private ICollection _courseCompetencyLevelsCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseCompetencyLevels + { + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseCompetencyLevels is DeserializedPersistentGenericSet set) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + set.Reattach(this, "CourseCompetencyLevels"); } - } + + foreach (var item in _courseCompetencyLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - return true; + return _courseCompetencyLevels; + } + set + { + _courseCompetencyLevels = value; + _courseCompetencyLevelsCovariant = new CovariantCollectionAdapter(value); + } } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseCompetencyLevels { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseCompetencyLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - if (keyValues.Count == 0) - return base.GetHashCode(); + return _courseCompetencyLevelsCovariant; + } + set + { + CourseCompetencyLevels = new HashSet(value.Cast()); + } + } - var hashCode = new HashCode(); - foreach (DictionaryEntry entry in keyValues) + private ICollection _courseIdentificationCodes; + private ICollection _courseIdentificationCodesCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseIdentificationCodes + { + get { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseIdentificationCodes is DeserializedPersistentGenericSet set) { - hashCode.Add(entry.Value); + set.Reattach(this, "CourseIdentificationCodes"); } - } + + foreach (var item in _courseIdentificationCodes) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferedGradeLevel)target); + return _courseIdentificationCodes; + } + set + { + _courseIdentificationCodes = value; + _courseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + } } - void IMappable.Map(object target) + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseIdentificationCodes { - this.MapTo((Entities.Common.EdFi.ICourseOfferedGradeLevel) target, null); - } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseIdentificationCodes) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - void IChildEntity.SetParent(object value) - { - Course = (Course) value; + return _courseIdentificationCodesCovariant; + } + set + { + CourseIdentificationCodes = new HashSet(value.Cast()); + } } - } -} -// Aggregate: CourseAttemptResultDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseAttemptResultDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.CourseAttemptResultDescriptor table of the CourseAttemptResultDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseAttemptResultDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseAttemptResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseAttemptResultDescriptorId + private ICollection _courseLearningStandards; + private ICollection _courseLearningStandardsCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseLearningStandards { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseLearningStandards is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseLearningStandards"); + } + + foreach (var item in _courseLearningStandards) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + return _courseLearningStandards; + } + set + { + _courseLearningStandards = value; + _courseLearningStandardsCovariant = new CovariantCollectionAdapter(value); + } } - DateTime? IDescriptor.EffectiveEndDate + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseLearningStandards { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseLearningStandards) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseLearningStandardsCovariant; + } + set + { + CourseLearningStandards = new HashSet(value.Cast()); + } } - string IDescriptor.Namespace + + + private ICollection _courseLevelCharacteristics; + private ICollection _courseLevelCharacteristicsCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseLevelCharacteristics { - get { return Namespace; } - set { Namespace = value; } + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseLevelCharacteristics is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseLevelCharacteristics"); + } + + foreach (var item in _courseLevelCharacteristics) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseLevelCharacteristics; + } + set + { + _courseLevelCharacteristics = value; + _courseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); + } } - string IDescriptor.ShortDescription + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseLevelCharacteristics { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseLevelCharacteristics) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseLevelCharacteristicsCovariant; + } + set + { + CourseLevelCharacteristics = new HashSet(value.Cast()); + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private ICollection _courseOfferedGradeLevels; + private ICollection _courseOfferedGradeLevelsCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseOfferedGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseOfferedGradeLevels is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseOfferedGradeLevels"); + } + + foreach (var item in _courseOfferedGradeLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _courseOfferedGradeLevels; + } + set + { + _courseOfferedGradeLevels = value; + _courseOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourse.CourseOfferedGradeLevels + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseOfferedGradeLevels) + if (item.Course == null) + item.Course = this; + // ------------------------------------------------------------- + + return _courseOfferedGradeLevelsCovariant; + } + set + { + CourseOfferedGradeLevels = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CareerPathwayDescriptor", new LookupColumnDetails { PropertyName = "CareerPathwayDescriptorId", LookupTypeName = "CareerPathwayDescriptor"} }, + { "CourseDefinedByDescriptor", new LookupColumnDetails { PropertyName = "CourseDefinedByDescriptorId", LookupTypeName = "CourseDefinedByDescriptor"} }, + { "CourseGPAApplicabilityDescriptor", new LookupColumnDetails { PropertyName = "CourseGPAApplicabilityDescriptorId", LookupTypeName = "CourseGPAApplicabilityDescriptor"} }, + { "MaximumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MaximumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "MinimumAvailableCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "MinimumAvailableCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -26217,7 +32942,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); return keyValues; } @@ -26281,271 +33007,188 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourse)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourse) target, null); } } -} -// Aggregate: CourseDefinedByDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseDefinedByDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseDefinedByDescriptor table of the CourseDefinedByDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseAcademicSubject table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseDefinedByDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseDefinedByDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CourseAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseDefinedByDescriptorId + public CourseAcademicSubject() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual Course Course { get; set; } + + Entities.Common.EdFi.ICourse ICourseAcademicSubject.Course { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Course; } + set { Course = (Course) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int AcademicSubjectDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + [IgnoreMember] + public virtual string AcademicSubjectDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); + } } // ------------------------------------------------------------- // ============================================================= - // Properties + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Extensions + // One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CourseDefinedByDescriptorId", CourseDefinedByDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Course", "CourseAcademicSubject")] + [Key(2)] + public IDictionary Extensions { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) + foreach (var key in _extensions.Keys) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) { - return false; + collection.ReattachExtension(this, (string) key); } } - else + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } } - } - return true; + _extensions = value; + } } - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + private IDictionary _aggregateExtensions; - foreach (DictionaryEntry entry in keyValues) + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Course", "CourseAcademicSubject")] + [Key(3)] + public IDictionary AggregateExtensions + { + get { - if (entry.Value is string) + foreach (var key in _aggregateExtensions.Keys) { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } } - else + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) { - hashCode.Add(entry.Value); + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } } - } - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseDefinedByDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICourseDefinedByDescriptor) target, null); - } - - } -} -// Aggregate: CourseGPAApplicabilityDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseGPAApplicabilityDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.CourseGPAApplicabilityDescriptor table of the CourseGPAApplicabilityDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseGPAApplicabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseGPAApplicabilityDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + _aggregateExtensions = value; + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -26561,6 +33204,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -26571,11 +33215,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Course as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CourseGPAApplicabilityDescriptorId", CourseGPAApplicabilityDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -26639,271 +33283,192 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseAcademicSubject) target, null); } + void IChildEntity.SetParent(object value) + { + Course = (Course) value; + } } -} -// Aggregate: CourseIdentificationSystemDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseIdentificationSystemDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseIdentificationSystemDescriptor table of the CourseIdentificationSystemDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseCompetencyLevel table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CourseCompetencyLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseCompetencyLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseIdentificationSystemDescriptorId + public CourseCompetencyLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual Course Course { get; set; } + + Entities.Common.EdFi.ICourse ICourseCompetencyLevel.Course { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Course; } + set { Course = (Course) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int CompetencyLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_competencyLevelDescriptorId == default(int)) + _competencyLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CompetencyLevelDescriptor", _competencyLevelDescriptor); + + return _competencyLevelDescriptorId; + } + set + { + _competencyLevelDescriptorId = value; + _competencyLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _competencyLevelDescriptorId; + private string _competencyLevelDescriptor; + + [IgnoreMember] + public virtual string CompetencyLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_competencyLevelDescriptor == null) + _competencyLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CompetencyLevelDescriptor", _competencyLevelDescriptorId); + + return _competencyLevelDescriptor; + } + set + { + _competencyLevelDescriptor = value; + _competencyLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- // ============================================================= - // Properties + // Inherited Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Extensions + // One-to-one relationships // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Course", "CourseCompetencyLevel")] + [Key(2)] + public IDictionary Extensions { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) + foreach (var key in _extensions.Keys) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) { - return false; + collection.ReattachExtension(this, (string) key); } } - else + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } } - } - return true; + _extensions = value; + } } - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + private IDictionary _aggregateExtensions; - foreach (DictionaryEntry entry in keyValues) + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Course", "CourseCompetencyLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get { - if (entry.Value is string) + foreach (var key in _aggregateExtensions.Keys) { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } } - else + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) { - hashCode.Add(entry.Value); + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor) target, null); - } - - } -} -// Aggregate: CourseLevelCharacteristicDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CourseLevelCharacteristicDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - /// - /// A class which represents the edfi.CourseLevelCharacteristicDescriptor table of the CourseLevelCharacteristicDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CourseLevelCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CourseLevelCharacteristicDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + _aggregateExtensions = value; + } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -26919,6 +33484,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CompetencyLevelDescriptor", new LookupColumnDetails { PropertyName = "CompetencyLevelDescriptorId", LookupTypeName = "CompetencyLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -26929,11 +33495,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Course as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); + keyValues.Add("CompetencyLevelDescriptorId", CompetencyLevelDescriptorId); return keyValues; } @@ -26997,122 +33563,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseCompetencyLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor) target, null); - } - - } -} -// Aggregate: CourseOffering - -namespace EdFi.Ods.Entities.NHibernate.CourseOfferingAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class CourseOfferingReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string LocalCourseCode { get; set; } - public virtual long SchoolId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual string SessionName { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SessionName", SessionName); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.ICourseCompetencyLevel) target, null); } - public override int GetHashCode() + void IChildEntity.SetParent(object value) { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); + Course = (Course) value; } - #endregion } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOffering table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseIdentificationCode table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOffering : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICourseOffering, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOffering() + public CourseIdentificationCode() { - CourseOfferingCourseLevelCharacteristics = new HashSet(); - CourseOfferingCurriculumUseds = new HashSet(); - CourseOfferingOfferedGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -27120,274 +33601,176 @@ public CourseOffering() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CourseCode { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual int? InstructionalTimePlanned { get; set; } - public virtual string LocalCourseTitle { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } - - /// - /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseOffering.CourseDiscriminator - { - get { return CourseReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseOffering.CourseResourceId - { - get { return CourseReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseOffering.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.SessionAggregate.EdFi.SessionReferenceData SessionReferenceData { get; set; } - - /// - /// Read-only property that allows the Session discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator - { - get { return SessionReferenceData?.Discriminator; } - set { } - } + [DomainSignature, IgnoreMember] + public virtual Course Course { get; set; } - /// - /// Read-only property that allows the Session resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseOffering.SessionResourceId + Entities.Common.EdFi.ICourse ICourseIdentificationCode.Course { - get { return SessionReferenceData?.Id; } - set { } + get { return Course; } + set { Course = (Course) value; } } - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _courseOfferingCourseLevelCharacteristics; - private ICollection _courseOfferingCourseLevelCharacteristicsCovariant; - public virtual ICollection CourseOfferingCourseLevelCharacteristics + [DomainSignature] + [Key(1)] + public virtual int CourseIdentificationSystemDescriptorId { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCourseLevelCharacteristics) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- + if (_courseIdentificationSystemDescriptorId == default(int)) + _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); - return _courseOfferingCourseLevelCharacteristics; - } + return _courseIdentificationSystemDescriptorId; + } set { - _courseOfferingCourseLevelCharacteristics = value; - _courseOfferingCourseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); + _courseIdentificationSystemDescriptorId = value; + _courseIdentificationSystemDescriptor = null; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCourseLevelCharacteristics + private int _courseIdentificationSystemDescriptorId; + private string _courseIdentificationSystemDescriptor; + + [IgnoreMember] + public virtual string CourseIdentificationSystemDescriptor { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCourseLevelCharacteristics) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- - - return _courseOfferingCourseLevelCharacteristicsCovariant; + if (_courseIdentificationSystemDescriptor == null) + _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); + + return _courseIdentificationSystemDescriptor; } set { - CourseOfferingCourseLevelCharacteristics = new HashSet(value.Cast()); + _courseIdentificationSystemDescriptor = value; + _courseIdentificationSystemDescriptorId = default(int); } } + // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - private ICollection _courseOfferingCurriculumUseds; - private ICollection _courseOfferingCurriculumUsedsCovariant; - public virtual ICollection CourseOfferingCurriculumUseds - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCurriculumUseds) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual string AssigningOrganizationIdentificationCode { get; set; } + [Key(3)] + public virtual string CourseCatalogURL { get; set; } + [Key(4)] + public virtual string IdentificationCode { get; set; } + // ------------------------------------------------------------- - return _courseOfferingCurriculumUseds; - } - set - { - _courseOfferingCurriculumUseds = value; - _courseOfferingCurriculumUsedsCovariant = new CovariantCollectionAdapter(value); - } - } + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCurriculumUseds + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Course", "CourseIdentificationCode")] + [Key(5)] + public IDictionary Extensions { - get + get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingCurriculumUseds) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } - return _courseOfferingCurriculumUsedsCovariant; + return _extensions; } set { - CourseOfferingCurriculumUseds = new HashSet(value.Cast()); + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; } } + private IDictionary _aggregateExtensions; - private ICollection _courseOfferingOfferedGradeLevels; - private ICollection _courseOfferingOfferedGradeLevelsCovariant; - public virtual ICollection CourseOfferingOfferedGradeLevels - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Course", "CourseIdentificationCode")] + [Key(6)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingOfferedGradeLevels) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _courseOfferingOfferedGradeLevels; + return _aggregateExtensions; } set { - _courseOfferingOfferedGradeLevels = value; - _courseOfferingOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingOfferedGradeLevels - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseOfferingOfferedGradeLevels) - if (item.CourseOffering == null) - item.CourseOffering = this; - // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _courseOfferingOfferedGradeLevelsCovariant; - } - set - { - CourseOfferingOfferedGradeLevels = new HashSet(value.Cast()); - } - } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -27398,14 +33781,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Course as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("SessionName", SessionName); + keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); return keyValues; } @@ -27469,32 +33849,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOffering)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOffering) target, null); + this.MapTo((Entities.Common.EdFi.ICourseIdentificationCode) target, null); } + void IChildEntity.SetParent(object value) + { + Course = (Course) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferingCourseLevelCharacteristic table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseLearningStandard table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferingCourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseLearningStandard : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOfferingCourseLevelCharacteristic() + public CourseLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -27502,50 +33887,18 @@ public CourseOfferingCourseLevelCharacteristic() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseOffering CourseOffering { get; set; } + [DomainSignature, IgnoreMember] + public virtual Course Course { get; set; } - Entities.Common.EdFi.ICourseOffering ICourseOfferingCourseLevelCharacteristic.CourseOffering + Entities.Common.EdFi.ICourse ICourseLearningStandard.Course { - get { return CourseOffering; } - set { CourseOffering = (CourseOffering) value; } + get { return Course; } + set { Course = (Course) value; } } [DomainSignature] - public virtual int CourseLevelCharacteristicDescriptorId - { - get - { - if (_courseLevelCharacteristicDescriptorId == default(int)) - _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); - - return _courseLevelCharacteristicDescriptorId; - } - set - { - _courseLevelCharacteristicDescriptorId = value; - _courseLevelCharacteristicDescriptor = null; - } - } - - private int _courseLevelCharacteristicDescriptorId; - private string _courseLevelCharacteristicDescriptor; - - public virtual string CourseLevelCharacteristicDescriptor - { - get - { - if (_courseLevelCharacteristicDescriptor == null) - _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); - - return _courseLevelCharacteristicDescriptor; - } - set - { - _courseLevelCharacteristicDescriptor = value; - _courseLevelCharacteristicDescriptorId = default(int); - } - } + [Key(1)] + public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -27568,14 +33921,27 @@ public virtual string CourseLevelCharacteristicDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Course", "CourseLearningStandard")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -27594,12 +33960,73 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Course", "CourseLearningStandard")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseLearningStandard.LearningStandardDiscriminator + { + get { return LearningStandardReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseLearningStandard.LearningStandardResourceId + { + get { return LearningStandardReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -27610,7 +34037,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -27622,10 +34048,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Course as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); + keyValues.Add("LearningStandardId", LearningStandardId); return keyValues; } @@ -27689,36 +34115,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseLearningStandard)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic) target, null); + this.MapTo((Entities.Common.EdFi.ICourseLearningStandard) target, null); } void IChildEntity.SetParent(object value) { - CourseOffering = (CourseOffering) value; + Course = (Course) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferingCurriculumUsed table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseLevelCharacteristic table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferingCurriculumUsed : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferingCurriculumUsed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOfferingCurriculumUsed() + public CourseLevelCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -27726,48 +34153,50 @@ public CourseOfferingCurriculumUsed() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseOffering CourseOffering { get; set; } + [DomainSignature, IgnoreMember] + public virtual Course Course { get; set; } - Entities.Common.EdFi.ICourseOffering ICourseOfferingCurriculumUsed.CourseOffering + Entities.Common.EdFi.ICourse ICourseLevelCharacteristic.Course { - get { return CourseOffering; } - set { CourseOffering = (CourseOffering) value; } + get { return Course; } + set { Course = (Course) value; } } [DomainSignature] - public virtual int CurriculumUsedDescriptorId + [Key(1)] + public virtual int CourseLevelCharacteristicDescriptorId { get { - if (_curriculumUsedDescriptorId == default(int)) - _curriculumUsedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CurriculumUsedDescriptor", _curriculumUsedDescriptor); + if (_courseLevelCharacteristicDescriptorId == default(int)) + _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); - return _curriculumUsedDescriptorId; + return _courseLevelCharacteristicDescriptorId; } set { - _curriculumUsedDescriptorId = value; - _curriculumUsedDescriptor = null; + _courseLevelCharacteristicDescriptorId = value; + _courseLevelCharacteristicDescriptor = null; } } - private int _curriculumUsedDescriptorId; - private string _curriculumUsedDescriptor; + private int _courseLevelCharacteristicDescriptorId; + private string _courseLevelCharacteristicDescriptor; - public virtual string CurriculumUsedDescriptor + [IgnoreMember] + public virtual string CourseLevelCharacteristicDescriptor { get { - if (_curriculumUsedDescriptor == null) - _curriculumUsedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CurriculumUsedDescriptor", _curriculumUsedDescriptorId); + if (_courseLevelCharacteristicDescriptor == null) + _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); - return _curriculumUsedDescriptor; + return _courseLevelCharacteristicDescriptor; } set { - _curriculumUsedDescriptor = value; - _curriculumUsedDescriptorId = default(int); + _courseLevelCharacteristicDescriptor = value; + _courseLevelCharacteristicDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -27792,14 +34221,27 @@ public virtual string CurriculumUsedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Course", "CourseLevelCharacteristic")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -27818,7 +34260,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Course", "CourseLevelCharacteristic")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -27834,7 +34316,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CurriculumUsedDescriptor", new LookupColumnDetails { PropertyName = "CurriculumUsedDescriptorId", LookupTypeName = "CurriculumUsedDescriptor"} }, + { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -27846,10 +34328,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Course as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); + keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); return keyValues; } @@ -27913,36 +34395,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristic)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed) target, null); + this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristic) target, null); } void IChildEntity.SetParent(object value) { - CourseOffering = (CourseOffering) value; + Course = (Course) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseOfferingOfferedGradeLevel table of the CourseOffering aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferedGradeLevel table of the Course aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseOfferingOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseOfferingOfferedGradeLevel() + public CourseOfferedGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -27950,16 +34433,17 @@ public CourseOfferingOfferedGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseOffering CourseOffering { get; set; } + [DomainSignature, IgnoreMember] + public virtual Course Course { get; set; } - Entities.Common.EdFi.ICourseOffering ICourseOfferingOfferedGradeLevel.CourseOffering + Entities.Common.EdFi.ICourse ICourseOfferedGradeLevel.Course { - get { return CourseOffering; } - set { CourseOffering = (CourseOffering) value; } + get { return Course; } + set { Course = (Course) value; } } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -27979,6 +34463,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -28016,14 +34501,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Course", "CourseOfferedGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -28042,7 +34540,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Course", "CourseOfferedGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -28070,7 +34608,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseOffering as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Course as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -28137,41 +34675,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferedGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferedGradeLevel) target, null); } void IChildEntity.SetParent(object value) { - CourseOffering = (CourseOffering) value; + Course = (Course) value; } } } -// Aggregate: CourseRepeatCodeDescriptor +// Aggregate: CourseAttemptResultDescriptor -namespace EdFi.Ods.Entities.NHibernate.CourseRepeatCodeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CourseAttemptResultDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseRepeatCodeDescriptor table of the CourseRepeatCodeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseAttemptResultDescriptor table of the CourseAttemptResultDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseRepeatCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICourseRepeatCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CourseAttemptResultDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseAttemptResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CourseRepeatCodeDescriptorId + [IgnoreMember] + public virtual int CourseAttemptResultDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -28256,7 +34796,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseRepeatCodeDescriptorId", CourseRepeatCodeDescriptorId); + keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); return keyValues; } @@ -28320,980 +34860,290 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseAttemptResultDescriptor) target, null); } } } -// Aggregate: CourseTranscript +// Aggregate: CourseDefinedByDescriptor -namespace EdFi.Ods.Entities.NHibernate.CourseTranscriptAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CourseDefinedByDescriptorAggregate.EdFi { - /// - /// Represents a read-only reference to the entity. - /// - public class CourseTranscriptReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual int CourseAttemptResultDescriptorId { get; set; } - public virtual string CourseCode { get; set; } - public virtual long CourseEducationOrganizationId { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual short SchoolYear { get; set; } - public virtual int StudentUSI { get; set; } - public virtual int TermDescriptorId { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("StudentUSI", StudentUSI); - keyValues.Add("TermDescriptorId", TermDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion - } - // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscript table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseDefinedByDescriptor table of the CourseDefinedByDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscript : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICourseTranscript, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseDefinedByDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseDefinedByDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseTranscript() - { - CourseTranscriptAcademicSubjects = new HashSet(); - CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(); - CourseTranscriptCoursePrograms = new HashSet(); - CourseTranscriptCreditCategories = new HashSet(); - CourseTranscriptEarnedAdditionalCredits = new HashSet(); - CourseTranscriptPartialCourseTranscriptAwards = new HashSet(); - CourseTranscriptSections = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int CourseAttemptResultDescriptorId - { - get - { - if (_courseAttemptResultDescriptorId == default(int)) - _courseAttemptResultDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseAttemptResultDescriptor", _courseAttemptResultDescriptor); - - return _courseAttemptResultDescriptorId; - } - set - { - _courseAttemptResultDescriptorId = value; - _courseAttemptResultDescriptor = null; - } - } - - private int _courseAttemptResultDescriptorId; - private string _courseAttemptResultDescriptor; - - public virtual string CourseAttemptResultDescriptor - { - get - { - if (_courseAttemptResultDescriptor == null) - _courseAttemptResultDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseAttemptResultDescriptor", _courseAttemptResultDescriptorId); - - return _courseAttemptResultDescriptor; - } - set - { - _courseAttemptResultDescriptor = value; - _courseAttemptResultDescriptorId = default(int); - } - } - [DomainSignature] - public virtual string CourseCode { get; set; } - [DomainSignature] - public virtual long CourseEducationOrganizationId { get; set; } - [DomainSignature] - public virtual long EducationOrganizationId { get; set; } - [DomainSignature] - public virtual short SchoolYear { get; set; } - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId - { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } - } - [DomainSignature] - public virtual int TermDescriptorId - { - get - { - if (_termDescriptorId == default(int)) - _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); - - return _termDescriptorId; - } - set - { - _termDescriptorId = value; - _termDescriptor = null; - } - } - - private int _termDescriptorId; - private string _termDescriptor; - - public virtual string TermDescriptor + [IgnoreMember] + public virtual int CourseDefinedByDescriptorId { - get - { - if (_termDescriptor == null) - _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); - - return _termDescriptor; - } - set - { - _termDescriptor = value; - _termDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string AlternativeCourseTitle { get; set; } - public virtual string AssigningOrganizationIdentificationCode { get; set; } - public virtual decimal? AttemptedCreditConversion { get; set; } - public virtual decimal? AttemptedCredits { get; set; } - public virtual int? AttemptedCreditTypeDescriptorId - { - get - { - if (_attemptedCreditTypeDescriptorId == default(int?)) - _attemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_attemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _attemptedCreditTypeDescriptor); - - return _attemptedCreditTypeDescriptorId; - } - set - { - _attemptedCreditTypeDescriptorId = value; - _attemptedCreditTypeDescriptor = null; - } - } - - private int? _attemptedCreditTypeDescriptorId; - private string _attemptedCreditTypeDescriptor; - - public virtual string AttemptedCreditTypeDescriptor - { - get - { - if (_attemptedCreditTypeDescriptor == null) - _attemptedCreditTypeDescriptor = _attemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _attemptedCreditTypeDescriptorId.Value); - - return _attemptedCreditTypeDescriptor; - } - set - { - _attemptedCreditTypeDescriptor = value; - _attemptedCreditTypeDescriptorId = default(int?); - } - } - public virtual string CourseCatalogURL { get; set; } - public virtual int? CourseRepeatCodeDescriptorId - { - get - { - if (_courseRepeatCodeDescriptorId == default(int?)) - _courseRepeatCodeDescriptorId = string.IsNullOrWhiteSpace(_courseRepeatCodeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptor); - - return _courseRepeatCodeDescriptorId; - } - set - { - _courseRepeatCodeDescriptorId = value; - _courseRepeatCodeDescriptor = null; - } - } - - private int? _courseRepeatCodeDescriptorId; - private string _courseRepeatCodeDescriptor; - - public virtual string CourseRepeatCodeDescriptor - { - get - { - if (_courseRepeatCodeDescriptor == null) - _courseRepeatCodeDescriptor = _courseRepeatCodeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptorId.Value); - - return _courseRepeatCodeDescriptor; - } - set - { - _courseRepeatCodeDescriptor = value; - _courseRepeatCodeDescriptorId = default(int?); - } - } - public virtual string CourseTitle { get; set; } - public virtual decimal? EarnedCreditConversion { get; set; } - public virtual decimal? EarnedCredits { get; set; } - public virtual int? EarnedCreditTypeDescriptorId - { - get - { - if (_earnedCreditTypeDescriptorId == default(int?)) - _earnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_earnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _earnedCreditTypeDescriptor); - - return _earnedCreditTypeDescriptorId; - } - set - { - _earnedCreditTypeDescriptorId = value; - _earnedCreditTypeDescriptor = null; - } - } - - private int? _earnedCreditTypeDescriptorId; - private string _earnedCreditTypeDescriptor; - - public virtual string EarnedCreditTypeDescriptor - { - get - { - if (_earnedCreditTypeDescriptor == null) - _earnedCreditTypeDescriptor = _earnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _earnedCreditTypeDescriptorId.Value); - - return _earnedCreditTypeDescriptor; - } - set - { - _earnedCreditTypeDescriptor = value; - _earnedCreditTypeDescriptorId = default(int?); - } - } - public virtual long? ExternalEducationOrganizationId { get; set; } - public virtual string ExternalEducationOrganizationNameOfInstitution { get; set; } - public virtual string FinalLetterGradeEarned { get; set; } - public virtual decimal? FinalNumericGradeEarned { get; set; } - public virtual int? MethodCreditEarnedDescriptorId + string IDescriptor.CodeValue { - get - { - if (_methodCreditEarnedDescriptorId == default(int?)) - _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); - - return _methodCreditEarnedDescriptorId; - } - set - { - _methodCreditEarnedDescriptorId = value; - _methodCreditEarnedDescriptor = null; - } + get { return CodeValue; } + set { CodeValue = value; } } - - private int? _methodCreditEarnedDescriptorId; - private string _methodCreditEarnedDescriptor; - - public virtual string MethodCreditEarnedDescriptor + string IDescriptor.Description { - get - { - if (_methodCreditEarnedDescriptor == null) - _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); - - return _methodCreditEarnedDescriptor; - } - set - { - _methodCreditEarnedDescriptor = value; - _methodCreditEarnedDescriptorId = default(int?); - } + get { return Description; } + set { Description = value; } } - public virtual int? ResponsibleTeacherStaffUSI + DateTime? IDescriptor.EffectiveBeginDate { - get - { - if (_responsibleTeacherStaffUSI == default(int?) && _responsibleTeacherStaffUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_responsibleTeacherStaffUniqueId, out var usi)) - { - _responsibleTeacherStaffUSI = usi; - } - } - - return _responsibleTeacherStaffUSI; - } - set - { - _responsibleTeacherStaffUSI = value; - - if (value != null) - { - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value.Value); - } - } + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } } - - private int? _responsibleTeacherStaffUSI; - private string _responsibleTeacherStaffUniqueId; - - public virtual string ResponsibleTeacherStaffUniqueId + DateTime? IDescriptor.EffectiveEndDate { - get - { - if (_responsibleTeacherStaffUniqueId == null && _responsibleTeacherStaffUSI.HasValue) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_responsibleTeacherStaffUSI.Value, out var uniqueId)) - { - _responsibleTeacherStaffUniqueId = uniqueId; - } - } - - return _responsibleTeacherStaffUniqueId; - } - set - { - if (_responsibleTeacherStaffUniqueId != value) - _responsibleTeacherStaffUSI = default(int?); - - _responsibleTeacherStaffUniqueId = value; - } + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } } - public virtual int? WhenTakenGradeLevelDescriptorId + string IDescriptor.Namespace { - get - { - if (_whenTakenGradeLevelDescriptorId == default(int?)) - _whenTakenGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenTakenGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenTakenGradeLevelDescriptor); - - return _whenTakenGradeLevelDescriptorId; - } - set - { - _whenTakenGradeLevelDescriptorId = value; - _whenTakenGradeLevelDescriptor = null; - } + get { return Namespace; } + set { Namespace = value; } } - - private int? _whenTakenGradeLevelDescriptorId; - private string _whenTakenGradeLevelDescriptor; - - public virtual string WhenTakenGradeLevelDescriptor + string IDescriptor.ShortDescription { - get - { - if (_whenTakenGradeLevelDescriptor == null) - _whenTakenGradeLevelDescriptor = _whenTakenGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenTakenGradeLevelDescriptorId.Value); - - return _whenTakenGradeLevelDescriptor; - } - set - { - _whenTakenGradeLevelDescriptor = value; - _whenTakenGradeLevelDescriptorId = default(int?); - } + get { return ShortDescription; } + set { ShortDescription = value; } } // ------------------------------------------------------------- // ============================================================= - // One-to-one relationships + // Properties // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= - // Extensions + // One-to-one relationships // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } - - /// - /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscript.CourseDiscriminator - { - get { return CourseReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscript.CourseResourceId - { - get { return CourseReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ExternalEducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the ExternalEducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationDiscriminator - { - get { return ExternalEducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ExternalEducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationResourceId - { - get { return ExternalEducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData ResponsibleTeacherStaffReferenceData { get; set; } - - /// - /// Read-only property that allows the ResponsibleTeacherStaff discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffDiscriminator - { - get { return ResponsibleTeacherStaffReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the ResponsibleTeacherStaff resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffResourceId - { - get { return ResponsibleTeacherStaffReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordReferenceData StudentAcademicRecordReferenceData { get; set; } - - /// - /// Read-only property that allows the StudentAcademicRecord discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator - { - get { return StudentAcademicRecordReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the StudentAcademicRecord resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordResourceId - { - get { return StudentAcademicRecordReferenceData?.Id; } - set { } - } - + // Extensions // ------------------------------------------------------------- - - //============================================================= - // Collections // ------------------------------------------------------------- - private ICollection _courseTranscriptAcademicSubjects; - private ICollection _courseTranscriptAcademicSubjectsCovariant; - public virtual ICollection CourseTranscriptAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptAcademicSubjects) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptAcademicSubjects; - } - set - { - _courseTranscriptAcademicSubjects = value; - _courseTranscriptAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAcademicSubjects - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptAcademicSubjects) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptAcademicSubjectsCovariant; - } - set - { - CourseTranscriptAcademicSubjects = new HashSet(value.Cast()); - } - } - + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- - private ICollection _courseTranscriptAlternativeCourseIdentificationCodes; - private ICollection _courseTranscriptAlternativeCourseIdentificationCodesCovariant; - public virtual ICollection CourseTranscriptAlternativeCourseIdentificationCodes - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _courseTranscriptAlternativeCourseIdentificationCodes; - } - set + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - _courseTranscriptAlternativeCourseIdentificationCodes = value; - _courseTranscriptAlternativeCourseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); - } - } + }; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAlternativeCourseIdentificationCodes + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptAlternativeCourseIdentificationCodesCovariant; - } - set - { - CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(value.Cast()); - } + get { return _idPropertyByLookupProperty; } } - - private ICollection _courseTranscriptCoursePrograms; - private ICollection _courseTranscriptCourseProgramsCovariant; - public virtual ICollection CourseTranscriptCoursePrograms + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCoursePrograms) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - return _courseTranscriptCoursePrograms; - } - set - { - _courseTranscriptCoursePrograms = value; - _courseTranscriptCourseProgramsCovariant = new CovariantCollectionAdapter(value); - } + // Add current key values + keyValues.Add("CourseDefinedByDescriptorId", CourseDefinedByDescriptorId); + + return keyValues; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCoursePrograms + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCoursePrograms) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _courseTranscriptCourseProgramsCovariant; - } - set - { - CourseTranscriptCoursePrograms = new HashSet(value.Cast()); - } - } + if (ReferenceEquals(this, compareTo)) + return true; + if (compareTo == null) + return false; - private ICollection _courseTranscriptCreditCategories; - private ICollection _courseTranscriptCreditCategoriesCovariant; - public virtual ICollection CourseTranscriptCreditCategories - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCreditCategories) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); - return _courseTranscriptCreditCategories; - } - set + foreach (DictionaryEntry entry in theseKeys) { - _courseTranscriptCreditCategories = value; - _courseTranscriptCreditCategoriesCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCreditCategories + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptCreditCategories) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptCreditCategoriesCovariant; - } - set - { - CourseTranscriptCreditCategories = new HashSet(value.Cast()); - } - } + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + if (keyValues.Count == 0) + return base.GetHashCode(); - private ICollection _courseTranscriptEarnedAdditionalCredits; - private ICollection _courseTranscriptEarnedAdditionalCreditsCovariant; - public virtual ICollection CourseTranscriptEarnedAdditionalCredits - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptEarnedAdditionalCredits) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- + var hashCode = new HashCode(); - return _courseTranscriptEarnedAdditionalCredits; - } - set + foreach (DictionaryEntry entry in keyValues) { - _courseTranscriptEarnedAdditionalCredits = value; - _courseTranscriptEarnedAdditionalCreditsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } - } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptEarnedAdditionalCredits + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptEarnedAdditionalCredits) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptEarnedAdditionalCreditsCovariant; - } - set - { - CourseTranscriptEarnedAdditionalCredits = new HashSet(value.Cast()); - } + return this.SynchronizeTo((Entities.Common.EdFi.ICourseDefinedByDescriptor)target); } - - private ICollection _courseTranscriptPartialCourseTranscriptAwards; - private ICollection _courseTranscriptPartialCourseTranscriptAwardsCovariant; - public virtual ICollection CourseTranscriptPartialCourseTranscriptAwards + void IMappable.Map(object target) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptPartialCourseTranscriptAwards; - } - set - { - _courseTranscriptPartialCourseTranscriptAwards = value; - _courseTranscriptPartialCourseTranscriptAwardsCovariant = new CovariantCollectionAdapter(value); - } + this.MapTo((Entities.Common.EdFi.ICourseDefinedByDescriptor) target, null); } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptPartialCourseTranscriptAwards - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- + } +} +// Aggregate: CourseGPAApplicabilityDescriptor - return _courseTranscriptPartialCourseTranscriptAwardsCovariant; - } - set - { - CourseTranscriptPartialCourseTranscriptAwards = new HashSet(value.Cast()); - } - } +namespace EdFi.Ods.Entities.NHibernate.CourseGPAApplicabilityDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + /// + /// A class which represents the edfi.CourseGPAApplicabilityDescriptor table of the CourseGPAApplicabilityDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class CourseGPAApplicabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { - private ICollection _courseTranscriptSections; - private ICollection _courseTranscriptSectionsCovariant; - public virtual ICollection CourseTranscriptSections + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int CourseGPAApplicabilityDescriptorId { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptSections) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptSections; - } - set - { - _courseTranscriptSections = value; - _courseTranscriptSectionsCovariant = new CovariantCollectionAdapter(value); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + + // ------------------------------------------------------------- - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptSections + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _courseTranscriptSections) - if (item.CourseTranscript == null) - item.CourseTranscript = this; - // ------------------------------------------------------------- - - return _courseTranscriptSectionsCovariant; - } - set - { - CourseTranscriptSections = new HashSet(value.Cast()); - } + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CourseRepeatCodeDescriptor", new LookupColumnDetails { PropertyName = "CourseRepeatCodeDescriptorId", LookupTypeName = "CourseRepeatCodeDescriptor"} }, - { "EarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "EarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, - { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, - { "WhenTakenGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenTakenGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -29308,13 +35158,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); - keyValues.Add("CourseCode", CourseCode); - keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("SchoolYear", SchoolYear); - keyValues.Add("StudentUSI", StudentUSI); - keyValues.Add("TermDescriptorId", TermDescriptorId); + keyValues.Add("CourseGPAApplicabilityDescriptorId", CourseGPAApplicabilityDescriptorId); return keyValues; } @@ -29378,88 +35222,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscript)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscript) target, null); + this.MapTo((Entities.Common.EdFi.ICourseGPAApplicabilityDescriptor) target, null); } } +} +// Aggregate: CourseIdentificationSystemDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CourseIdentificationSystemDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptAcademicSubject table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseIdentificationSystemDescriptor table of the CourseIdentificationSystemDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseTranscriptAcademicSubject() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } - - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAcademicSubject.CourseTranscript - { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } - } - [DomainSignature] - public virtual int AcademicSubjectDescriptorId - { - get - { - if (_academicSubjectDescriptorId == default(int)) - _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); - - return _academicSubjectDescriptorId; - } - set - { - _academicSubjectDescriptorId = value; - _academicSubjectDescriptor = null; - } - } - - private int _academicSubjectDescriptorId; - private string _academicSubjectDescriptor; - - public virtual string AcademicSubjectDescriptor + [IgnoreMember] + public virtual int CourseIdentificationSystemDescriptorId { - get - { - if (_academicSubjectDescriptor == null) - _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); - - return _academicSubjectDescriptor; - } - set - { - _academicSubjectDescriptor = value; - _academicSubjectDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -29475,35 +35310,6 @@ public virtual string AcademicSubjectDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -29519,9 +35325,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -29532,11 +35335,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); + keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); return keyValues; } @@ -29600,100 +35403,84 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.ICourseIdentificationSystemDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - CourseTranscript = (CourseTranscript) value; - } } +} +// Aggregate: CourseLevelCharacteristicDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CourseLevelCharacteristicDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptAlternativeCourseIdentificationCode table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseLevelCharacteristicDescriptor table of the CourseLevelCharacteristicDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptAlternativeCourseIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseLevelCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseTranscriptAlternativeCourseIdentificationCode() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } - - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAlternativeCourseIdentificationCode.CourseTranscript - { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } - } - [DomainSignature] - public virtual int CourseIdentificationSystemDescriptorId - { - get - { - if (_courseIdentificationSystemDescriptorId == default(int)) - _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); - - return _courseIdentificationSystemDescriptorId; - } - set - { - _courseIdentificationSystemDescriptorId = value; - _courseIdentificationSystemDescriptor = null; - } - } - - private int _courseIdentificationSystemDescriptorId; - private string _courseIdentificationSystemDescriptor; - - public virtual string CourseIdentificationSystemDescriptor + [IgnoreMember] + public virtual int CourseLevelCharacteristicDescriptorId { - get - { - if (_courseIdentificationSystemDescriptor == null) - _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); - - return _courseIdentificationSystemDescriptor; - } - set - { - _courseIdentificationSystemDescriptor = value; - _courseIdentificationSystemDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AssigningOrganizationIdentificationCode { get; set; } - public virtual string CourseCatalogURL { get; set; } - public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -29704,35 +35491,6 @@ public virtual string CourseIdentificationSystemDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -29748,9 +35506,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -29761,11 +35516,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); + keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); return keyValues; } @@ -29829,36 +35584,130 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.ICourseLevelCharacteristicDescriptor) target, null); } - void IChildEntity.SetParent(object value) + } +} +// Aggregate: CourseOffering + +namespace EdFi.Ods.Entities.NHibernate.CourseOfferingAggregate.EdFi +{ + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class CourseOfferingReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual string LocalCourseCode { get; set; } + [Key(1)] + public virtual long SchoolId { get; set; } + [Key(2)] + public virtual short SchoolYear { get; set; } + [Key(3)] + public virtual string SessionName { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(4)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(5)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - CourseTranscript = (CourseTranscript) value; + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SessionName", SessionName); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); } + #endregion } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptCourseProgram table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseOffering table of the CourseOffering aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptCourseProgram : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptCourseProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseOffering : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICourseOffering, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptCourseProgram() + public CourseOffering() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CourseOfferingCourseLevelCharacteristics = new HashSet(); + CourseOfferingCurriculumUseds = new HashSet(); + CourseOfferingOfferedGradeLevels = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -29866,52 +35715,18 @@ public CourseTranscriptCourseProgram() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } - - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCourseProgram.CourseTranscript - { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } - } - [DomainSignature] - public virtual string CourseProgramName { get; set; } + [Key(6)] + public virtual string LocalCourseCode { get; set; } [DomainSignature] - public virtual int CourseProgramTypeDescriptorId - { - get - { - if (_courseProgramTypeDescriptorId == default(int)) - _courseProgramTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _courseProgramTypeDescriptor); - - return _courseProgramTypeDescriptorId; - } - set - { - _courseProgramTypeDescriptorId = value; - _courseProgramTypeDescriptor = null; - } - } - - private int _courseProgramTypeDescriptorId; - private string _courseProgramTypeDescriptor; - - public virtual string CourseProgramTypeDescriptor - { - get - { - if (_courseProgramTypeDescriptor == null) - _courseProgramTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _courseProgramTypeDescriptorId); - - return _courseProgramTypeDescriptor; - } - set - { - _courseProgramTypeDescriptor = value; - _courseProgramTypeDescriptorId = default(int); - } - } + [Key(7)] + public virtual long SchoolId { get; set; } + [DomainSignature] + [Key(8)] + public virtual short SchoolYear { get; set; } + [DomainSignature] + [Key(9)] + public virtual string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -29922,6 +35737,14 @@ public virtual string CourseProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] + public virtual string CourseCode { get; set; } + [Key(11)] + public virtual long EducationOrganizationId { get; set; } + [Key(12)] + public virtual int? InstructionalTimePlanned { get; set; } + [Key(13)] + public virtual string LocalCourseTitle { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -29934,14 +35757,27 @@ public virtual string CourseProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseOffering", "CourseOffering")] + [Key(14)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -29960,45 +35796,278 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseOffering", "CourseOffering")] + [Key(15)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData CourseProgramReferenceData { get; set; } + [Key(16)] + public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } /// - /// Read-only property that allows the CourseProgram discriminator value to be mapped to the resource reference. + /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. /// - string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscriminator + string Entities.Common.EdFi.ICourseOffering.CourseDiscriminator { - get { return CourseProgramReferenceData?.Discriminator; } + get { return CourseReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseOffering.CourseResourceId + { + get { return CourseReferenceData?.Id; } + set { } + } + + [Key(17)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseOffering.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } + } + + [Key(18)] + public virtual NHibernate.SessionAggregate.EdFi.SessionReferenceData SessionReferenceData { get; set; } + + /// + /// Read-only property that allows the Session discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseOffering.SessionDiscriminator + { + get { return SessionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Session resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseOffering.SessionResourceId + { + get { return SessionReferenceData?.Id; } set { } } - /// - /// Read-only property that allows the CourseProgram resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramResourceId + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _courseOfferingCourseLevelCharacteristics; + private ICollection _courseOfferingCourseLevelCharacteristicsCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseOfferingCourseLevelCharacteristics + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseOfferingCourseLevelCharacteristics is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseOfferingCourseLevelCharacteristics"); + } + + foreach (var item in _courseOfferingCourseLevelCharacteristics) + if (item.CourseOffering == null) + item.CourseOffering = this; + // ------------------------------------------------------------- + + return _courseOfferingCourseLevelCharacteristics; + } + set + { + _courseOfferingCourseLevelCharacteristics = value; + _courseOfferingCourseLevelCharacteristicsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCourseLevelCharacteristics + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseOfferingCourseLevelCharacteristics) + if (item.CourseOffering == null) + item.CourseOffering = this; + // ------------------------------------------------------------- + + return _courseOfferingCourseLevelCharacteristicsCovariant; + } + set + { + CourseOfferingCourseLevelCharacteristics = new HashSet(value.Cast()); + } + } + + + private ICollection _courseOfferingCurriculumUseds; + private ICollection _courseOfferingCurriculumUsedsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseOfferingCurriculumUseds + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseOfferingCurriculumUseds is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseOfferingCurriculumUseds"); + } + + foreach (var item in _courseOfferingCurriculumUseds) + if (item.CourseOffering == null) + item.CourseOffering = this; + // ------------------------------------------------------------- + + return _courseOfferingCurriculumUseds; + } + set + { + _courseOfferingCurriculumUseds = value; + _courseOfferingCurriculumUsedsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingCurriculumUseds + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseOfferingCurriculumUseds) + if (item.CourseOffering == null) + item.CourseOffering = this; + // ------------------------------------------------------------- + + return _courseOfferingCurriculumUsedsCovariant; + } + set + { + CourseOfferingCurriculumUseds = new HashSet(value.Cast()); + } + } + + + private ICollection _courseOfferingOfferedGradeLevels; + private ICollection _courseOfferingOfferedGradeLevelsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseOfferingOfferedGradeLevels + { + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseOfferingOfferedGradeLevels is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseOfferingOfferedGradeLevels"); + } + + foreach (var item in _courseOfferingOfferedGradeLevels) + if (item.CourseOffering == null) + item.CourseOffering = this; + // ------------------------------------------------------------- + + return _courseOfferingOfferedGradeLevels; + } + set + { + _courseOfferingOfferedGradeLevels = value; + _courseOfferingOfferedGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } + } + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseOffering.CourseOfferingOfferedGradeLevels { - get { return CourseProgramReferenceData?.Id; } - set { } - } + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseOfferingOfferedGradeLevels) + if (item.CourseOffering == null) + item.CourseOffering = this; + // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _courseOfferingOfferedGradeLevelsCovariant; + } + set + { + CourseOfferingOfferedGradeLevels = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CourseProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "CourseProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30009,12 +36078,14 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CourseProgramName", CourseProgramName); - keyValues.Add("CourseProgramTypeDescriptorId", CourseProgramTypeDescriptorId); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("SessionName", SessionName); return keyValues; } @@ -30078,36 +36149,33 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOffering)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOffering) target, null); } - void IChildEntity.SetParent(object value) - { - CourseTranscript = (CourseTranscript) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptCreditCategory table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferingCourseLevelCharacteristic table of the CourseOffering aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptCreditCategory : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptCreditCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseOfferingCourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptCreditCategory() + public CourseOfferingCourseLevelCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -30115,48 +36183,50 @@ public CourseTranscriptCreditCategory() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } + [DomainSignature, IgnoreMember] + public virtual CourseOffering CourseOffering { get; set; } - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCreditCategory.CourseTranscript + Entities.Common.EdFi.ICourseOffering ICourseOfferingCourseLevelCharacteristic.CourseOffering { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get { return CourseOffering; } + set { CourseOffering = (CourseOffering) value; } } [DomainSignature] - public virtual int CreditCategoryDescriptorId + [Key(1)] + public virtual int CourseLevelCharacteristicDescriptorId { get { - if (_creditCategoryDescriptorId == default(int)) - _creditCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditCategoryDescriptor", _creditCategoryDescriptor); + if (_courseLevelCharacteristicDescriptorId == default(int)) + _courseLevelCharacteristicDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptor); - return _creditCategoryDescriptorId; + return _courseLevelCharacteristicDescriptorId; } set { - _creditCategoryDescriptorId = value; - _creditCategoryDescriptor = null; + _courseLevelCharacteristicDescriptorId = value; + _courseLevelCharacteristicDescriptor = null; } } - private int _creditCategoryDescriptorId; - private string _creditCategoryDescriptor; + private int _courseLevelCharacteristicDescriptorId; + private string _courseLevelCharacteristicDescriptor; - public virtual string CreditCategoryDescriptor + [IgnoreMember] + public virtual string CourseLevelCharacteristicDescriptor { get { - if (_creditCategoryDescriptor == null) - _creditCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditCategoryDescriptor", _creditCategoryDescriptorId); + if (_courseLevelCharacteristicDescriptor == null) + _courseLevelCharacteristicDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseLevelCharacteristicDescriptor", _courseLevelCharacteristicDescriptorId); - return _creditCategoryDescriptor; + return _courseLevelCharacteristicDescriptor; } set { - _creditCategoryDescriptor = value; - _creditCategoryDescriptorId = default(int); + _courseLevelCharacteristicDescriptor = value; + _courseLevelCharacteristicDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -30181,14 +36251,27 @@ public virtual string CreditCategoryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseOffering", "CourseOfferingCourseLevelCharacteristic")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -30207,7 +36290,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseOffering", "CourseOfferingCourseLevelCharacteristic")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -30223,9 +36346,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "CreditCategoryDescriptor", new LookupColumnDetails { PropertyName = "CreditCategoryDescriptorId", LookupTypeName = "CreditCategoryDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "CourseLevelCharacteristicDescriptor", new LookupColumnDetails { PropertyName = "CourseLevelCharacteristicDescriptorId", LookupTypeName = "CourseLevelCharacteristicDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30237,10 +36358,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseOffering as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); + keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); return keyValues; } @@ -30304,36 +36425,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferingCourseLevelCharacteristic) target, null); } void IChildEntity.SetParent(object value) { - CourseTranscript = (CourseTranscript) value; + CourseOffering = (CourseOffering) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptEarnedAdditionalCredits table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferingCurriculumUsed table of the CourseOffering aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptEarnedAdditionalCredits : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseOfferingCurriculumUsed : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferingCurriculumUsed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptEarnedAdditionalCredits() + public CourseOfferingCurriculumUsed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -30341,48 +36463,50 @@ public CourseTranscriptEarnedAdditionalCredits() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } + [DomainSignature, IgnoreMember] + public virtual CourseOffering CourseOffering { get; set; } - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptEarnedAdditionalCredits.CourseTranscript + Entities.Common.EdFi.ICourseOffering ICourseOfferingCurriculumUsed.CourseOffering { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get { return CourseOffering; } + set { CourseOffering = (CourseOffering) value; } } [DomainSignature] - public virtual int AdditionalCreditTypeDescriptorId + [Key(1)] + public virtual int CurriculumUsedDescriptorId { get { - if (_additionalCreditTypeDescriptorId == default(int)) - _additionalCreditTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptor); + if (_curriculumUsedDescriptorId == default(int)) + _curriculumUsedDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CurriculumUsedDescriptor", _curriculumUsedDescriptor); - return _additionalCreditTypeDescriptorId; + return _curriculumUsedDescriptorId; } set { - _additionalCreditTypeDescriptorId = value; - _additionalCreditTypeDescriptor = null; + _curriculumUsedDescriptorId = value; + _curriculumUsedDescriptor = null; } } - private int _additionalCreditTypeDescriptorId; - private string _additionalCreditTypeDescriptor; + private int _curriculumUsedDescriptorId; + private string _curriculumUsedDescriptor; - public virtual string AdditionalCreditTypeDescriptor + [IgnoreMember] + public virtual string CurriculumUsedDescriptor { get { - if (_additionalCreditTypeDescriptor == null) - _additionalCreditTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptorId); + if (_curriculumUsedDescriptor == null) + _curriculumUsedDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CurriculumUsedDescriptor", _curriculumUsedDescriptorId); - return _additionalCreditTypeDescriptor; + return _curriculumUsedDescriptor; } set { - _additionalCreditTypeDescriptor = value; - _additionalCreditTypeDescriptorId = default(int); + _curriculumUsedDescriptor = value; + _curriculumUsedDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -30395,7 +36519,6 @@ public virtual string AdditionalCreditTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal Credits { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -30408,14 +36531,27 @@ public virtual string AdditionalCreditTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseOffering", "CourseOfferingCurriculumUsed")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -30434,7 +36570,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseOffering", "CourseOfferingCurriculumUsed")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -30450,9 +36626,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AdditionalCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AdditionalCreditTypeDescriptorId", LookupTypeName = "AdditionalCreditTypeDescriptor"} }, - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "CurriculumUsedDescriptor", new LookupColumnDetails { PropertyName = "CurriculumUsedDescriptorId", LookupTypeName = "CurriculumUsedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30464,10 +36638,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseOffering as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AdditionalCreditTypeDescriptorId", AdditionalCreditTypeDescriptorId); + keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); return keyValues; } @@ -30531,36 +36705,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferingCurriculumUsed) target, null); } void IChildEntity.SetParent(object value) { - CourseTranscript = (CourseTranscript) value; + CourseOffering = (CourseOffering) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptPartialCourseTranscriptAwards table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseOfferingOfferedGradeLevel table of the CourseOffering aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptPartialCourseTranscriptAwards : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseOfferingOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CourseTranscriptPartialCourseTranscriptAwards() + public CourseOfferingOfferedGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -30568,72 +36743,62 @@ public CourseTranscriptPartialCourseTranscriptAwards() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } + [DomainSignature, IgnoreMember] + public virtual CourseOffering CourseOffering { get; set; } - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptPartialCourseTranscriptAwards.CourseTranscript + Entities.Common.EdFi.ICourseOffering ICourseOfferingOfferedGradeLevel.CourseOffering { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get { return CourseOffering; } + set { CourseOffering = (CourseOffering) value; } } [DomainSignature] - public virtual DateTime AwardDate - { - get { return _awardDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _awardDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _awardDate; - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual decimal EarnedCredits { get; set; } - public virtual string LetterGradeEarned { get; set; } - public virtual int? MethodCreditEarnedDescriptorId + [Key(1)] + public virtual int GradeLevelDescriptorId { get { - if (_methodCreditEarnedDescriptorId == default(int?)) - _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); - return _methodCreditEarnedDescriptorId; + return _gradeLevelDescriptorId; } set { - _methodCreditEarnedDescriptorId = value; - _methodCreditEarnedDescriptor = null; + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; } } - private int? _methodCreditEarnedDescriptorId; - private string _methodCreditEarnedDescriptor; + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; - public virtual string MethodCreditEarnedDescriptor + [IgnoreMember] + public virtual string GradeLevelDescriptor { get { - if (_methodCreditEarnedDescriptor == null) - _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); - return _methodCreditEarnedDescriptor; + return _gradeLevelDescriptor; } set { - _methodCreditEarnedDescriptor = value; - _methodCreditEarnedDescriptorId = default(int?); + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); } } - public virtual string NumericGradeEarned { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -30646,14 +36811,27 @@ public virtual string MethodCreditEarnedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseOffering", "CourseOfferingOfferedGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -30672,7 +36850,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseOffering", "CourseOfferingOfferedGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -30688,9 +36906,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30702,10 +36918,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseOffering as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AwardDate", AwardDate); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -30769,65 +36985,83 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards) target, null); + this.MapTo((Entities.Common.EdFi.ICourseOfferingOfferedGradeLevel) target, null); } void IChildEntity.SetParent(object value) { - CourseTranscript = (CourseTranscript) value; + CourseOffering = (CourseOffering) value; } } +} +// Aggregate: CourseRepeatCodeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CourseRepeatCodeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CourseTranscriptSection table of the CourseTranscript aggregate in the ODS database. + /// A class which represents the edfi.CourseRepeatCodeDescriptor table of the CourseRepeatCodeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CourseTranscriptSection : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICourseTranscriptSection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseRepeatCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICourseRepeatCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public CourseTranscriptSection() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual CourseTranscript CourseTranscript { get; set; } - - Entities.Common.EdFi.ICourseTranscript ICourseTranscriptSection.CourseTranscript + [DomainSignature] + [IgnoreMember] + public virtual int CourseRepeatCodeDescriptorId { - get { return CourseTranscript; } - set { CourseTranscript = (CourseTranscript) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string LocalCourseCode { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } - [DomainSignature] - public virtual string SectionIdentifier { get; set; } - [DomainSignature] - public virtual string SessionName { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -30843,60 +37077,11 @@ Entities.Common.EdFi.ICourseTranscript ICourseTranscriptSection.CourseTranscript // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } - - /// - /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator - { - get { return SectionReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.ICourseTranscriptSection.SectionResourceId - { - get { return SectionReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -30907,8 +37092,6 @@ string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, - { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -30919,14 +37102,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (CourseTranscript as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LocalCourseCode", LocalCourseCode); - keyValues.Add("SchoolId", SchoolId); - keyValues.Add("SectionIdentifier", SectionIdentifier); - keyValues.Add("SessionName", SessionName); + keyValues.Add("CourseRepeatCodeDescriptorId", CourseRepeatCodeDescriptorId); return keyValues; } @@ -30990,45 +37170,56 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptSection)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICourseTranscriptSection) target, null); + this.MapTo((Entities.Common.EdFi.ICourseRepeatCodeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - CourseTranscript = (CourseTranscript) value; - } } } -// Aggregate: Credential +// Aggregate: CourseTranscript -namespace EdFi.Ods.Entities.NHibernate.CredentialAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CourseTranscriptAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CredentialReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class CourseTranscriptReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CredentialIdentifier { get; set; } - public virtual int StateOfIssueStateAbbreviationDescriptorId { get; set; } + [Key(0)] + public virtual int CourseAttemptResultDescriptorId { get; set; } + [Key(1)] + public virtual string CourseCode { get; set; } + [Key(2)] + public virtual long CourseEducationOrganizationId { get; set; } + [Key(3)] + public virtual long EducationOrganizationId { get; set; } + [Key(4)] + public virtual short SchoolYear { get; set; } + [Key(5)] + public virtual int StudentUSI { get; set; } + [Key(6)] + public virtual int TermDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -31038,8 +37229,13 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CredentialIdentifier", CredentialIdentifier); - keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); + keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("TermDescriptorId", TermDescriptorId); return keyValues; } @@ -31090,22 +37286,27 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Credential table of the Credential aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscript table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class Credential : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICredential, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseTranscript : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICourseTranscript, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public Credential() + public CourseTranscript() { - CredentialAcademicSubjects = new HashSet(); - CredentialEndorsements = new HashSet(); - CredentialGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CourseTranscriptAcademicSubjects = new HashSet(); + CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(); + CourseTranscriptCoursePrograms = new HashSet(); + CourseTranscriptCreditCategories = new HashSet(); + CourseTranscriptEarnedAdditionalCredits = new HashSet(); + CourseTranscriptPartialCourseTranscriptAwards = new HashSet(); + CourseTranscriptSections = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -31114,289 +37315,818 @@ public Credential() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CredentialIdentifier { get; set; } + [Key(6)] + public virtual int CourseAttemptResultDescriptorId + { + get + { + if (_courseAttemptResultDescriptorId == default(int)) + _courseAttemptResultDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseAttemptResultDescriptor", _courseAttemptResultDescriptor); + + return _courseAttemptResultDescriptorId; + } + set + { + _courseAttemptResultDescriptorId = value; + _courseAttemptResultDescriptor = null; + } + } + + private int _courseAttemptResultDescriptorId; + private string _courseAttemptResultDescriptor; + + [IgnoreMember] + public virtual string CourseAttemptResultDescriptor + { + get + { + if (_courseAttemptResultDescriptor == null) + _courseAttemptResultDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseAttemptResultDescriptor", _courseAttemptResultDescriptorId); + + return _courseAttemptResultDescriptor; + } + set + { + _courseAttemptResultDescriptor = value; + _courseAttemptResultDescriptorId = default(int); + } + } [DomainSignature] - public virtual int StateOfIssueStateAbbreviationDescriptorId + [Key(7)] + public virtual string CourseCode { get; set; } + [DomainSignature] + [Key(8)] + public virtual long CourseEducationOrganizationId { get; set; } + [DomainSignature] + [Key(9)] + public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + [Key(10)] + public virtual short SchoolYear { get; set; } + [Display(Name="StudentUniqueId")][DomainSignature] + [Key(11)] + public virtual int StudentUSI { get { - if (_stateOfIssueStateAbbreviationDescriptorId == default(int)) - _stateOfIssueStateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptor); + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - return _stateOfIssueStateAbbreviationDescriptorId; + return _studentUSI; } set { - _stateOfIssueStateAbbreviationDescriptorId = value; - _stateOfIssueStateAbbreviationDescriptor = null; + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + } + } + + private int _studentUSI; + private string _studentUniqueId; + + [IgnoreMember] + public virtual string StudentUniqueId + { + get + { + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; + } + set + { + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; + } + } + [DomainSignature] + [Key(12)] + public virtual int TermDescriptorId + { + get + { + if (_termDescriptorId == default(int)) + _termDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TermDescriptor", _termDescriptor); + + return _termDescriptorId; + } + set + { + _termDescriptorId = value; + _termDescriptor = null; + } + } + + private int _termDescriptorId; + private string _termDescriptor; + + [IgnoreMember] + public virtual string TermDescriptor + { + get + { + if (_termDescriptor == null) + _termDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TermDescriptor", _termDescriptorId); + + return _termDescriptor; + } + set + { + _termDescriptor = value; + _termDescriptorId = default(int); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(13)] + public virtual string AlternativeCourseTitle { get; set; } + [Key(14)] + public virtual string AssigningOrganizationIdentificationCode { get; set; } + [Key(15)] + public virtual decimal? AttemptedCreditConversion { get; set; } + [Key(16)] + public virtual decimal? AttemptedCredits { get; set; } + [Key(17)] + public virtual int? AttemptedCreditTypeDescriptorId + { + get + { + if (_attemptedCreditTypeDescriptorId == default(int?)) + _attemptedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_attemptedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _attemptedCreditTypeDescriptor); + + return _attemptedCreditTypeDescriptorId; + } + set + { + _attemptedCreditTypeDescriptorId = value; + _attemptedCreditTypeDescriptor = null; + } + } + + private int? _attemptedCreditTypeDescriptorId; + private string _attemptedCreditTypeDescriptor; + + [IgnoreMember] + public virtual string AttemptedCreditTypeDescriptor + { + get + { + if (_attemptedCreditTypeDescriptor == null) + _attemptedCreditTypeDescriptor = _attemptedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _attemptedCreditTypeDescriptorId.Value); + + return _attemptedCreditTypeDescriptor; + } + set + { + _attemptedCreditTypeDescriptor = value; + _attemptedCreditTypeDescriptorId = default(int?); + } + } + [Key(18)] + public virtual string CourseCatalogURL { get; set; } + [Key(19)] + public virtual int? CourseRepeatCodeDescriptorId + { + get + { + if (_courseRepeatCodeDescriptorId == default(int?)) + _courseRepeatCodeDescriptorId = string.IsNullOrWhiteSpace(_courseRepeatCodeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptor); + + return _courseRepeatCodeDescriptorId; + } + set + { + _courseRepeatCodeDescriptorId = value; + _courseRepeatCodeDescriptor = null; + } + } + + private int? _courseRepeatCodeDescriptorId; + private string _courseRepeatCodeDescriptor; + + [IgnoreMember] + public virtual string CourseRepeatCodeDescriptor + { + get + { + if (_courseRepeatCodeDescriptor == null) + _courseRepeatCodeDescriptor = _courseRepeatCodeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseRepeatCodeDescriptor", _courseRepeatCodeDescriptorId.Value); + + return _courseRepeatCodeDescriptor; + } + set + { + _courseRepeatCodeDescriptor = value; + _courseRepeatCodeDescriptorId = default(int?); + } + } + [Key(20)] + public virtual string CourseTitle { get; set; } + [Key(21)] + public virtual decimal? EarnedCreditConversion { get; set; } + [Key(22)] + public virtual decimal? EarnedCredits { get; set; } + [Key(23)] + public virtual int? EarnedCreditTypeDescriptorId + { + get + { + if (_earnedCreditTypeDescriptorId == default(int?)) + _earnedCreditTypeDescriptorId = string.IsNullOrWhiteSpace(_earnedCreditTypeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditTypeDescriptor", _earnedCreditTypeDescriptor); + + return _earnedCreditTypeDescriptorId; + } + set + { + _earnedCreditTypeDescriptorId = value; + _earnedCreditTypeDescriptor = null; + } + } + + private int? _earnedCreditTypeDescriptorId; + private string _earnedCreditTypeDescriptor; + + [IgnoreMember] + public virtual string EarnedCreditTypeDescriptor + { + get + { + if (_earnedCreditTypeDescriptor == null) + _earnedCreditTypeDescriptor = _earnedCreditTypeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditTypeDescriptor", _earnedCreditTypeDescriptorId.Value); + + return _earnedCreditTypeDescriptor; + } + set + { + _earnedCreditTypeDescriptor = value; + _earnedCreditTypeDescriptorId = default(int?); + } + } + [Key(24)] + public virtual long? ExternalEducationOrganizationId { get; set; } + [Key(25)] + public virtual string ExternalEducationOrganizationNameOfInstitution { get; set; } + [Key(26)] + public virtual string FinalLetterGradeEarned { get; set; } + [Key(27)] + public virtual decimal? FinalNumericGradeEarned { get; set; } + [Key(28)] + public virtual int? MethodCreditEarnedDescriptorId + { + get + { + if (_methodCreditEarnedDescriptorId == default(int?)) + _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); + + return _methodCreditEarnedDescriptorId; + } + set + { + _methodCreditEarnedDescriptorId = value; + _methodCreditEarnedDescriptor = null; + } + } + + private int? _methodCreditEarnedDescriptorId; + private string _methodCreditEarnedDescriptor; + + [IgnoreMember] + public virtual string MethodCreditEarnedDescriptor + { + get + { + if (_methodCreditEarnedDescriptor == null) + _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); + + return _methodCreditEarnedDescriptor; + } + set + { + _methodCreditEarnedDescriptor = value; + _methodCreditEarnedDescriptorId = default(int?); + } + } + [Key(29)] + public virtual int? ResponsibleTeacherStaffUSI + { + get + { + if (_responsibleTeacherStaffUSI == default(int?) && _responsibleTeacherStaffUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_responsibleTeacherStaffUniqueId, out var usi)) + { + _responsibleTeacherStaffUSI = usi; + } + } + + return _responsibleTeacherStaffUSI; + } + set + { + _responsibleTeacherStaffUSI = value; + + if (value != null) + { + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value.Value); + } + } + } + + private int? _responsibleTeacherStaffUSI; + private string _responsibleTeacherStaffUniqueId; + + [IgnoreMember] + public virtual string ResponsibleTeacherStaffUniqueId + { + get + { + if (_responsibleTeacherStaffUniqueId == null && _responsibleTeacherStaffUSI.HasValue) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_responsibleTeacherStaffUSI.Value, out var uniqueId)) + { + _responsibleTeacherStaffUniqueId = uniqueId; + } + } + + return _responsibleTeacherStaffUniqueId; + } + set + { + if (_responsibleTeacherStaffUniqueId != value) + _responsibleTeacherStaffUSI = default(int?); + + _responsibleTeacherStaffUniqueId = value; + } + } + [Key(30)] + public virtual int? WhenTakenGradeLevelDescriptorId + { + get + { + if (_whenTakenGradeLevelDescriptorId == default(int?)) + _whenTakenGradeLevelDescriptorId = string.IsNullOrWhiteSpace(_whenTakenGradeLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _whenTakenGradeLevelDescriptor); + + return _whenTakenGradeLevelDescriptorId; + } + set + { + _whenTakenGradeLevelDescriptorId = value; + _whenTakenGradeLevelDescriptor = null; + } + } + + private int? _whenTakenGradeLevelDescriptorId; + private string _whenTakenGradeLevelDescriptor; + + [IgnoreMember] + public virtual string WhenTakenGradeLevelDescriptor + { + get + { + if (_whenTakenGradeLevelDescriptor == null) + _whenTakenGradeLevelDescriptor = _whenTakenGradeLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _whenTakenGradeLevelDescriptorId.Value); + + return _whenTakenGradeLevelDescriptor; + } + set + { + _whenTakenGradeLevelDescriptor = value; + _whenTakenGradeLevelDescriptorId = default(int?); + } + } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscript")] + [Key(31)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscript")] + [Key(32)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - private int _stateOfIssueStateAbbreviationDescriptorId; - private string _stateOfIssueStateAbbreviationDescriptor; + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(33)] + public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } + + /// + /// Read-only property that allows the Course discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscript.CourseDiscriminator + { + get { return CourseReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Course resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscript.CourseResourceId + { + get { return CourseReferenceData?.Id; } + set { } + } + + [Key(34)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ExternalEducationOrganizationReferenceData { get; set; } + + /// + /// Read-only property that allows the ExternalEducationOrganization discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationDiscriminator + { + get { return ExternalEducationOrganizationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ExternalEducationOrganization resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscript.ExternalEducationOrganizationResourceId + { + get { return ExternalEducationOrganizationReferenceData?.Id; } + set { } + } + + [Key(35)] + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData ResponsibleTeacherStaffReferenceData { get; set; } + + /// + /// Read-only property that allows the ResponsibleTeacherStaff discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffDiscriminator + { + get { return ResponsibleTeacherStaffReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the ResponsibleTeacherStaff resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscript.ResponsibleTeacherStaffResourceId + { + get { return ResponsibleTeacherStaffReferenceData?.Id; } + set { } + } + + [Key(36)] + public virtual NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordReferenceData StudentAcademicRecordReferenceData { get; set; } - public virtual string StateOfIssueStateAbbreviationDescriptor + /// + /// Read-only property that allows the StudentAcademicRecord discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordDiscriminator { - get - { - if (_stateOfIssueStateAbbreviationDescriptor == null) - _stateOfIssueStateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptorId); - - return _stateOfIssueStateAbbreviationDescriptor; - } - set - { - _stateOfIssueStateAbbreviationDescriptor = value; - _stateOfIssueStateAbbreviationDescriptorId = default(int); - } + get { return StudentAcademicRecordReferenceData?.Discriminator; } + set { } } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual int? CredentialFieldDescriptorId + /// + /// Read-only property that allows the StudentAcademicRecord resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscript.StudentAcademicRecordResourceId { - get - { - if (_credentialFieldDescriptorId == default(int?)) - _credentialFieldDescriptorId = string.IsNullOrWhiteSpace(_credentialFieldDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialFieldDescriptor", _credentialFieldDescriptor); - - return _credentialFieldDescriptorId; - } - set - { - _credentialFieldDescriptorId = value; - _credentialFieldDescriptor = null; - } + get { return StudentAcademicRecordReferenceData?.Id; } + set { } } - private int? _credentialFieldDescriptorId; - private string _credentialFieldDescriptor; + // ------------------------------------------------------------- - public virtual string CredentialFieldDescriptor + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _courseTranscriptAcademicSubjects; + private ICollection _courseTranscriptAcademicSubjectsCovariant; + [Key(37)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseTranscriptAcademicSubjects { get { - if (_credentialFieldDescriptor == null) - _credentialFieldDescriptor = _credentialFieldDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialFieldDescriptor", _credentialFieldDescriptorId.Value); - - return _credentialFieldDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseTranscriptAcademicSubjects is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseTranscriptAcademicSubjects"); + } + + foreach (var item in _courseTranscriptAcademicSubjects) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- + + return _courseTranscriptAcademicSubjects; } set { - _credentialFieldDescriptor = value; - _credentialFieldDescriptorId = default(int?); + _courseTranscriptAcademicSubjects = value; + _courseTranscriptAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); } } - public virtual int CredentialTypeDescriptorId + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAcademicSubjects { get { - if (_credentialTypeDescriptorId == default(int)) - _credentialTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialTypeDescriptor", _credentialTypeDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptAcademicSubjects) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - return _credentialTypeDescriptorId; - } + return _courseTranscriptAcademicSubjectsCovariant; + } set { - _credentialTypeDescriptorId = value; - _credentialTypeDescriptor = null; + CourseTranscriptAcademicSubjects = new HashSet(value.Cast()); } } - private int _credentialTypeDescriptorId; - private string _credentialTypeDescriptor; - public virtual string CredentialTypeDescriptor + private ICollection _courseTranscriptAlternativeCourseIdentificationCodes; + private ICollection _courseTranscriptAlternativeCourseIdentificationCodesCovariant; + [Key(38)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseTranscriptAlternativeCourseIdentificationCodes { get { - if (_credentialTypeDescriptor == null) - _credentialTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialTypeDescriptor", _credentialTypeDescriptorId); - - return _credentialTypeDescriptor; - } - set - { - _credentialTypeDescriptor = value; - _credentialTypeDescriptorId = default(int); - } - } - public virtual DateTime? EffectiveDate - { - get { return _effectiveDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _effectiveDate = null; - } else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseTranscriptAlternativeCourseIdentificationCodes is DeserializedPersistentGenericSet set) { - var given = (DateTime) value; - _effectiveDate = new DateTime(given.Year, given.Month, given.Day); + set.Reattach(this, "CourseTranscriptAlternativeCourseIdentificationCodes"); } - } - } + + foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - private DateTime? _effectiveDate; - - public virtual DateTime? ExpirationDate - { - get { return _expirationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _expirationDate = null; - } else - { - var given = (DateTime) value; - _expirationDate = new DateTime(given.Year, given.Month, given.Day); - } + return _courseTranscriptAlternativeCourseIdentificationCodes; + } + set + { + _courseTranscriptAlternativeCourseIdentificationCodes = value; + _courseTranscriptAlternativeCourseIdentificationCodesCovariant = new CovariantCollectionAdapter(value); } } - private DateTime? _expirationDate; - - public virtual DateTime IssuanceDate - { - get { return _issuanceDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _issuanceDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _issuanceDate; - - public virtual string Namespace { get; set; } - public virtual int? TeachingCredentialBasisDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptAlternativeCourseIdentificationCodes { get { - if (_teachingCredentialBasisDescriptorId == default(int?)) - _teachingCredentialBasisDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialBasisDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptAlternativeCourseIdentificationCodes) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - return _teachingCredentialBasisDescriptorId; - } + return _courseTranscriptAlternativeCourseIdentificationCodesCovariant; + } set { - _teachingCredentialBasisDescriptorId = value; - _teachingCredentialBasisDescriptor = null; + CourseTranscriptAlternativeCourseIdentificationCodes = new HashSet(value.Cast()); } } - private int? _teachingCredentialBasisDescriptorId; - private string _teachingCredentialBasisDescriptor; - public virtual string TeachingCredentialBasisDescriptor + private ICollection _courseTranscriptCoursePrograms; + private ICollection _courseTranscriptCourseProgramsCovariant; + [Key(39)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseTranscriptCoursePrograms { get { - if (_teachingCredentialBasisDescriptor == null) - _teachingCredentialBasisDescriptor = _teachingCredentialBasisDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptorId.Value); - - return _teachingCredentialBasisDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseTranscriptCoursePrograms is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseTranscriptCoursePrograms"); + } + + foreach (var item in _courseTranscriptCoursePrograms) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- + + return _courseTranscriptCoursePrograms; } set { - _teachingCredentialBasisDescriptor = value; - _teachingCredentialBasisDescriptorId = default(int?); + _courseTranscriptCoursePrograms = value; + _courseTranscriptCourseProgramsCovariant = new CovariantCollectionAdapter(value); } } - public virtual int? TeachingCredentialDescriptorId + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCoursePrograms { get { - if (_teachingCredentialDescriptorId == default(int?)) - _teachingCredentialDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialDescriptor", _teachingCredentialDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptCoursePrograms) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - return _teachingCredentialDescriptorId; - } + return _courseTranscriptCourseProgramsCovariant; + } set { - _teachingCredentialDescriptorId = value; - _teachingCredentialDescriptor = null; + CourseTranscriptCoursePrograms = new HashSet(value.Cast()); } } - private int? _teachingCredentialDescriptorId; - private string _teachingCredentialDescriptor; - public virtual string TeachingCredentialDescriptor + private ICollection _courseTranscriptCreditCategories; + private ICollection _courseTranscriptCreditCategoriesCovariant; + [Key(40)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseTranscriptCreditCategories { get { - if (_teachingCredentialDescriptor == null) - _teachingCredentialDescriptor = _teachingCredentialDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialDescriptor", _teachingCredentialDescriptorId.Value); - - return _teachingCredentialDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_courseTranscriptCreditCategories is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CourseTranscriptCreditCategories"); + } + + foreach (var item in _courseTranscriptCreditCategories) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- + + return _courseTranscriptCreditCategories; } set { - _teachingCredentialDescriptor = value; - _teachingCredentialDescriptorId = default(int?); + _courseTranscriptCreditCategories = value; + _courseTranscriptCreditCategoriesCovariant = new CovariantCollectionAdapter(value); } } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - public IDictionary Extensions + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptCreditCategories { - get => _extensions; - set + get { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _courseTranscriptCreditCategories) + if (item.CourseTranscript == null) + item.CourseTranscript = this; + // ------------------------------------------------------------- - _extensions = value; + return _courseTranscriptCreditCategoriesCovariant; + } + set + { + CourseTranscriptCreditCategories = new HashSet(value.Cast()); } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _credentialAcademicSubjects; - private ICollection _credentialAcademicSubjectsCovariant; - public virtual ICollection CredentialAcademicSubjects + private ICollection _courseTranscriptEarnedAdditionalCredits; + private ICollection _courseTranscriptEarnedAdditionalCreditsCovariant; + [Key(41)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseTranscriptEarnedAdditionalCredits { get { @@ -31405,45 +38135,52 @@ public virtual ICollection set) + { + set.Reattach(this, "CourseTranscriptEarnedAdditionalCredits"); + } + + foreach (var item in _courseTranscriptEarnedAdditionalCredits) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialAcademicSubjects; + return _courseTranscriptEarnedAdditionalCredits; } set { - _credentialAcademicSubjects = value; - _credentialAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + _courseTranscriptEarnedAdditionalCredits = value; + _courseTranscriptEarnedAdditionalCreditsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialAcademicSubjects + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptEarnedAdditionalCredits { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _credentialAcademicSubjects) - if (item.Credential == null) - item.Credential = this; + foreach (var item in _courseTranscriptEarnedAdditionalCredits) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialAcademicSubjectsCovariant; + return _courseTranscriptEarnedAdditionalCreditsCovariant; } set { - CredentialAcademicSubjects = new HashSet(value.Cast()); + CourseTranscriptEarnedAdditionalCredits = new HashSet(value.Cast()); } } - private ICollection _credentialEndorsements; - private ICollection _credentialEndorsementsCovariant; - public virtual ICollection CredentialEndorsements + private ICollection _courseTranscriptPartialCourseTranscriptAwards; + private ICollection _courseTranscriptPartialCourseTranscriptAwardsCovariant; + [Key(42)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseTranscriptPartialCourseTranscriptAwards { get { @@ -31452,45 +38189,52 @@ public virtual ICollection set) + { + set.Reattach(this, "CourseTranscriptPartialCourseTranscriptAwards"); + } + + foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialEndorsements; + return _courseTranscriptPartialCourseTranscriptAwards; } set { - _credentialEndorsements = value; - _credentialEndorsementsCovariant = new CovariantCollectionAdapter(value); + _courseTranscriptPartialCourseTranscriptAwards = value; + _courseTranscriptPartialCourseTranscriptAwardsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialEndorsements + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptPartialCourseTranscriptAwards { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _credentialEndorsements) - if (item.Credential == null) - item.Credential = this; + foreach (var item in _courseTranscriptPartialCourseTranscriptAwards) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialEndorsementsCovariant; + return _courseTranscriptPartialCourseTranscriptAwardsCovariant; } set { - CredentialEndorsements = new HashSet(value.Cast()); + CourseTranscriptPartialCourseTranscriptAwards = new HashSet(value.Cast()); } } - private ICollection _credentialGradeLevels; - private ICollection _credentialGradeLevelsCovariant; - public virtual ICollection CredentialGradeLevels + private ICollection _courseTranscriptSections; + private ICollection _courseTranscriptSectionsCovariant; + [Key(43)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CourseTranscriptSections { get { @@ -31499,38 +38243,43 @@ public virtual ICollection set) + { + set.Reattach(this, "CourseTranscriptSections"); + } + + foreach (var item in _courseTranscriptSections) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialGradeLevels; + return _courseTranscriptSections; } set { - _credentialGradeLevels = value; - _credentialGradeLevelsCovariant = new CovariantCollectionAdapter(value); + _courseTranscriptSections = value; + _courseTranscriptSectionsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.ICredential.CredentialGradeLevels + ICollection Entities.Common.EdFi.ICourseTranscript.CourseTranscriptSections { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _credentialGradeLevels) - if (item.Credential == null) - item.Credential = this; + foreach (var item in _courseTranscriptSections) + if (item.CourseTranscript == null) + item.CourseTranscript = this; // ------------------------------------------------------------- - return _credentialGradeLevelsCovariant; + return _courseTranscriptSectionsCovariant; } set { - CredentialGradeLevels = new HashSet(value.Cast()); + CourseTranscriptSections = new HashSet(value.Cast()); } } @@ -31539,11 +38288,13 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "CredentialFieldDescriptor", new LookupColumnDetails { PropertyName = "CredentialFieldDescriptorId", LookupTypeName = "CredentialFieldDescriptor"} }, - { "CredentialTypeDescriptor", new LookupColumnDetails { PropertyName = "CredentialTypeDescriptorId", LookupTypeName = "CredentialTypeDescriptor"} }, - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, - { "TeachingCredentialBasisDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialBasisDescriptorId", LookupTypeName = "TeachingCredentialBasisDescriptor"} }, - { "TeachingCredentialDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialDescriptorId", LookupTypeName = "TeachingCredentialDescriptor"} }, + { "AttemptedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AttemptedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CourseRepeatCodeDescriptor", new LookupColumnDetails { PropertyName = "CourseRepeatCodeDescriptorId", LookupTypeName = "CourseRepeatCodeDescriptor"} }, + { "EarnedCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "EarnedCreditTypeDescriptorId", LookupTypeName = "CreditTypeDescriptor"} }, + { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, + { "WhenTakenGradeLevelDescriptor", new LookupColumnDetails { PropertyName = "WhenTakenGradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -31558,8 +38309,13 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CredentialIdentifier", CredentialIdentifier); - keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); + keyValues.Add("CourseAttemptResultDescriptorId", CourseAttemptResultDescriptorId); + keyValues.Add("CourseCode", CourseCode); + keyValues.Add("CourseEducationOrganizationId", CourseEducationOrganizationId); + keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("SchoolYear", SchoolYear); + keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("TermDescriptorId", TermDescriptorId); return keyValues; } @@ -31623,12 +38379,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredential)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscript)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredential) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscript) target, null); } } @@ -31636,19 +38392,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialAcademicSubject table of the Credential aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptAcademicSubject table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialAcademicSubject : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICredentialAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseTranscriptAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CredentialAcademicSubject() + public CourseTranscriptAcademicSubject() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -31656,16 +38413,17 @@ public CredentialAcademicSubject() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Credential Credential { get; set; } + [DomainSignature, IgnoreMember] + public virtual CourseTranscript CourseTranscript { get; set; } - Entities.Common.EdFi.ICredential ICredentialAcademicSubject.Credential + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAcademicSubject.CourseTranscript { - get { return Credential; } - set { Credential = (Credential) value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } [DomainSignature] + [Key(1)] public virtual int AcademicSubjectDescriptorId { get @@ -31685,6 +38443,7 @@ public virtual int AcademicSubjectDescriptorId private int _academicSubjectDescriptorId; private string _academicSubjectDescriptor; + [IgnoreMember] public virtual string AcademicSubjectDescriptor { get @@ -31722,14 +38481,27 @@ public virtual string AcademicSubjectDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptAcademicSubject")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -31748,7 +38520,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptAcademicSubject")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -31765,7 +38577,8 @@ public IDictionary Extensions private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -31777,7 +38590,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseTranscript as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); @@ -31844,36 +38657,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialAcademicSubject)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialAcademicSubject) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptAcademicSubject) target, null); } void IChildEntity.SetParent(object value) { - Credential = (Credential) value; + CourseTranscript = (CourseTranscript) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialEndorsement table of the Credential aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptAlternativeCourseIdentificationCode table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialEndorsement : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICredentialEndorsement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseTranscriptAlternativeCourseIdentificationCode : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CredentialEndorsement() + public CourseTranscriptAlternativeCourseIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -31881,17 +38695,52 @@ public CredentialEndorsement() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Credential Credential { get; set; } + [DomainSignature, IgnoreMember] + public virtual CourseTranscript CourseTranscript { get; set; } - Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptAlternativeCourseIdentificationCode.CourseTranscript { - get { return Credential; } - set { Credential = (Credential) value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } [DomainSignature] - public virtual string CredentialEndorsementX { get; set; } + [Key(1)] + public virtual int CourseIdentificationSystemDescriptorId + { + get + { + if (_courseIdentificationSystemDescriptorId == default(int)) + _courseIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptor); + + return _courseIdentificationSystemDescriptorId; + } + set + { + _courseIdentificationSystemDescriptorId = value; + _courseIdentificationSystemDescriptor = null; + } + } + + private int _courseIdentificationSystemDescriptorId; + private string _courseIdentificationSystemDescriptor; + + [IgnoreMember] + public virtual string CourseIdentificationSystemDescriptor + { + get + { + if (_courseIdentificationSystemDescriptor == null) + _courseIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CourseIdentificationSystemDescriptor", _courseIdentificationSystemDescriptorId); + + return _courseIdentificationSystemDescriptor; + } + set + { + _courseIdentificationSystemDescriptor = value; + _courseIdentificationSystemDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -31902,6 +38751,12 @@ Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual string AssigningOrganizationIdentificationCode { get; set; } + [Key(3)] + public virtual string CourseCatalogURL { get; set; } + [Key(4)] + public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -31914,14 +38769,27 @@ Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptAlternativeCourseIdentificationCode")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -31940,7 +38808,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptAlternativeCourseIdentificationCode")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -31956,7 +38864,9 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CourseIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "CourseIdentificationSystemDescriptorId", LookupTypeName = "CourseIdentificationSystemDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -31968,10 +38878,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseTranscript as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CredentialEndorsement", CredentialEndorsementX); + keyValues.Add("CourseIdentificationSystemDescriptorId", CourseIdentificationSystemDescriptorId); return keyValues; } @@ -32035,36 +38945,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialEndorsement)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialEndorsement) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptAlternativeCourseIdentificationCode) target, null); } void IChildEntity.SetParent(object value) { - Credential = (Credential) value; + CourseTranscript = (CourseTranscript) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialGradeLevel table of the Credential aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptCourseProgram table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.ICredentialGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CourseTranscriptCourseProgram : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptCourseProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CredentialGradeLevel() + public CourseTranscriptCourseProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -32072,48 +38983,53 @@ public CredentialGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual Credential Credential { get; set; } + [DomainSignature, IgnoreMember] + public virtual CourseTranscript CourseTranscript { get; set; } - Entities.Common.EdFi.ICredential ICredentialGradeLevel.Credential + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCourseProgram.CourseTranscript { - get { return Credential; } - set { Credential = (Credential) value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId + [Key(1)] + public virtual string CourseProgramName { get; set; } + [DomainSignature] + [Key(2)] + public virtual int CourseProgramTypeDescriptorId { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_courseProgramTypeDescriptorId == default(int)) + _courseProgramTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _courseProgramTypeDescriptor); - return _gradeLevelDescriptorId; + return _courseProgramTypeDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _courseProgramTypeDescriptorId = value; + _courseProgramTypeDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int _courseProgramTypeDescriptorId; + private string _courseProgramTypeDescriptor; - public virtual string GradeLevelDescriptor + [IgnoreMember] + public virtual string CourseProgramTypeDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_courseProgramTypeDescriptor == null) + _courseProgramTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _courseProgramTypeDescriptorId); - return _gradeLevelDescriptor; + return _courseProgramTypeDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _courseProgramTypeDescriptor = value; + _courseProgramTypeDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -32138,14 +39054,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptCourseProgram")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -32164,12 +39093,73 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptCourseProgram")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] + public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData CourseProgramReferenceData { get; set; } + + /// + /// Read-only property that allows the CourseProgram discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramDiscriminator + { + get { return CourseProgramReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the CourseProgram resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscriptCourseProgram.CourseProgramResourceId + { + get { return CourseProgramReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -32180,8 +39170,9 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, - { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CourseProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "CourseProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -32193,10 +39184,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Credential as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (CourseTranscript as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("CourseProgramName", CourseProgramName); + keyValues.Add("CourseProgramTypeDescriptorId", CourseProgramTypeDescriptorId); return keyValues; } @@ -32260,83 +39252,97 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptCourseProgram) target, null); } void IChildEntity.SetParent(object value) { - Credential = (Credential) value; + CourseTranscript = (CourseTranscript) value; } } -} -// Aggregate: CredentialFieldDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CredentialFieldDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialFieldDescriptor table of the CredentialFieldDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptCreditCategory table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialFieldDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICredentialFieldDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CourseTranscriptCreditCategory : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptCreditCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CredentialFieldDescriptorId + public CourseTranscriptCreditCategory() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptCreditCategory.CourseTranscript { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int CreditCategoryDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_creditCategoryDescriptorId == default(int)) + _creditCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CreditCategoryDescriptor", _creditCategoryDescriptor); + + return _creditCategoryDescriptorId; + } + set + { + _creditCategoryDescriptorId = value; + _creditCategoryDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _creditCategoryDescriptorId; + private string _creditCategoryDescriptor; + + [IgnoreMember] + public virtual string CreditCategoryDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_creditCategoryDescriptor == null) + _creditCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CreditCategoryDescriptor", _creditCategoryDescriptorId); + + return _creditCategoryDescriptor; + } + set + { + _creditCategoryDescriptor = value; + _creditCategoryDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -32350,6 +39356,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptCreditCategory")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptCreditCategory")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -32365,6 +39453,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "CreditCategoryDescriptor", new LookupColumnDetails { PropertyName = "CreditCategoryDescriptorId", LookupTypeName = "CreditCategoryDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -32375,11 +39466,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CredentialFieldDescriptorId", CredentialFieldDescriptorId); + keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); return keyValues; } @@ -32443,92 +39534,194 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialFieldDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialFieldDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptCreditCategory) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } -} -// Aggregate: CredentialTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CredentialTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CredentialTypeDescriptor table of the CredentialTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptEarnedAdditionalCredits table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CredentialTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICredentialTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CourseTranscriptEarnedAdditionalCredits : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CredentialTypeDescriptorId + public CourseTranscriptEarnedAdditionalCredits() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptEarnedAdditionalCredits.CourseTranscript { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int AdditionalCreditTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_additionalCreditTypeDescriptorId == default(int)) + _additionalCreditTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptor); + + return _additionalCreditTypeDescriptorId; + } + set + { + _additionalCreditTypeDescriptorId = value; + _additionalCreditTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _additionalCreditTypeDescriptorId; + private string _additionalCreditTypeDescriptor; + + [IgnoreMember] + public virtual string AdditionalCreditTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_additionalCreditTypeDescriptor == null) + _additionalCreditTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AdditionalCreditTypeDescriptor", _additionalCreditTypeDescriptorId); + + return _additionalCreditTypeDescriptor; + } + set + { + _additionalCreditTypeDescriptor = value; + _additionalCreditTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual decimal Credits { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptEarnedAdditionalCredits")] + [Key(3)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptEarnedAdditionalCredits")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + _aggregateExtensions = value; + } + } - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -32544,6 +39737,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AdditionalCreditTypeDescriptor", new LookupColumnDetails { PropertyName = "AdditionalCreditTypeDescriptorId", LookupTypeName = "AdditionalCreditTypeDescriptor"} }, + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -32554,11 +39750,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CredentialTypeDescriptorId", CredentialTypeDescriptorId); + keyValues.Add("AdditionalCreditTypeDescriptorId", AdditionalCreditTypeDescriptorId); return keyValues; } @@ -32622,82 +39818,116 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICredentialTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICredentialTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptEarnedAdditionalCredits) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } -} -// Aggregate: CreditCategoryDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CreditCategoryDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CreditCategoryDescriptor table of the CreditCategoryDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptPartialCourseTranscriptAwards table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CreditCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICreditCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CourseTranscriptPartialCourseTranscriptAwards : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CourseTranscriptPartialCourseTranscriptAwards() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptPartialCourseTranscriptAwards.CourseTranscript + { + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } + } + [DomainSignature] - public virtual int CreditCategoryDescriptorId + [Key(1)] + public virtual DateTime AwardDate { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return _awardDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _awardDate = new DateTime(value.Year, value.Month, value.Day); } } + + private DateTime _awardDate; // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] + public virtual decimal EarnedCredits { get; set; } + [Key(3)] + public virtual string LetterGradeEarned { get; set; } + [Key(4)] + public virtual int? MethodCreditEarnedDescriptorId + { + get + { + if (_methodCreditEarnedDescriptorId == default(int?)) + _methodCreditEarnedDescriptorId = string.IsNullOrWhiteSpace(_methodCreditEarnedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptor); + + return _methodCreditEarnedDescriptorId; + } + set + { + _methodCreditEarnedDescriptorId = value; + _methodCreditEarnedDescriptor = null; + } + } + + private int? _methodCreditEarnedDescriptorId; + private string _methodCreditEarnedDescriptor; + + [IgnoreMember] + public virtual string MethodCreditEarnedDescriptor + { + get + { + if (_methodCreditEarnedDescriptor == null) + _methodCreditEarnedDescriptor = _methodCreditEarnedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("MethodCreditEarnedDescriptor", _methodCreditEarnedDescriptorId.Value); + + return _methodCreditEarnedDescriptor; + } + set + { + _methodCreditEarnedDescriptor = value; + _methodCreditEarnedDescriptorId = default(int?); + } + } + [Key(5)] + public virtual string NumericGradeEarned { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -32708,6 +39938,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptPartialCourseTranscriptAwards")] + [Key(6)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptPartialCourseTranscriptAwards")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -32723,6 +40035,9 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "MethodCreditEarnedDescriptor", new LookupColumnDetails { PropertyName = "MethodCreditEarnedDescriptorId", LookupTypeName = "MethodCreditEarnedDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -32733,11 +40048,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); + keyValues.Add("AwardDate", AwardDate); return keyValues; } @@ -32801,77 +40116,70 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICreditCategoryDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICreditCategoryDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptPartialCourseTranscriptAwards) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } -} -// Aggregate: CreditTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CreditTypeDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CreditTypeDescriptor table of the CreditTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CourseTranscriptSection table of the CourseTranscript aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CourseTranscriptSection : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICourseTranscriptSection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CourseTranscriptSection() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int CreditTypeDescriptorId + [DomainSignature, IgnoreMember] + public virtual CourseTranscript CourseTranscript { get; set; } + + Entities.Common.EdFi.ICourseTranscript ICourseTranscriptSection.CourseTranscript { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return CourseTranscript; } + set { CourseTranscript = (CourseTranscript) value; } } - + + [DomainSignature] + [Key(1)] + public virtual string LocalCourseCode { get; set; } + [DomainSignature] + [Key(2)] + public virtual long SchoolId { get; set; } + [DomainSignature] + [Key(3)] + public virtual string SectionIdentifier { get; set; } + [DomainSignature] + [Key(4)] + public virtual string SessionName { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -32887,11 +40195,114 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptSection")] + [Key(5)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CourseTranscript", "CourseTranscriptSection")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(7)] + public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } + + /// + /// Read-only property that allows the Section discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.ICourseTranscriptSection.SectionDiscriminator + { + get { return SectionReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Section resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.ICourseTranscriptSection.SectionResourceId + { + get { return SectionReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -32902,6 +40313,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CourseAttemptResultDescriptor", new LookupColumnDetails { PropertyName = "CourseAttemptResultDescriptorId", LookupTypeName = "CourseAttemptResultDescriptor"} }, + { "TermDescriptor", new LookupColumnDetails { PropertyName = "TermDescriptorId", LookupTypeName = "TermDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -32912,11 +40325,14 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (CourseTranscript as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CreditTypeDescriptorId", CreditTypeDescriptorId); + keyValues.Add("LocalCourseCode", LocalCourseCode); + keyValues.Add("SchoolId", SchoolId); + keyValues.Add("SectionIdentifier", SectionIdentifier); + keyValues.Add("SessionName", SessionName); return keyValues; } @@ -32980,40 +40396,50 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICreditTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICourseTranscriptSection)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICreditTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICourseTranscriptSection) target, null); } + void IChildEntity.SetParent(object value) + { + CourseTranscript = (CourseTranscript) value; + } } } -// Aggregate: CrisisEvent +// Aggregate: Credential -namespace EdFi.Ods.Entities.NHibernate.CrisisEventAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CredentialAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class CrisisEventReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class CredentialReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string CrisisEventName { get; set; } + [Key(0)] + public virtual string CredentialIdentifier { get; set; } + [Key(1)] + public virtual int StateOfIssueStateAbbreviationDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -33023,7 +40449,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CrisisEventName", CrisisEventName); + keyValues.Add("CredentialIdentifier", CredentialIdentifier); + keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); return keyValues; } @@ -33074,19 +40501,23 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CrisisEvent table of the CrisisEvent aggregate in the ODS database. + /// A class which represents the edfi.Credential table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CrisisEvent : AggregateRootWithCompositeKey, - Entities.Common.EdFi.ICrisisEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class Credential : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICredential, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public CrisisEvent() + public Credential() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + CredentialAcademicSubjects = new HashSet(); + CredentialEndorsements = new HashSet(); + CredentialGradeLevels = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -33095,7 +40526,45 @@ public CrisisEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string CrisisEventName { get; set; } + [Key(6)] + public virtual string CredentialIdentifier { get; set; } + [DomainSignature] + [Key(7)] + public virtual int StateOfIssueStateAbbreviationDescriptorId + { + get + { + if (_stateOfIssueStateAbbreviationDescriptorId == default(int)) + _stateOfIssueStateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptor); + + return _stateOfIssueStateAbbreviationDescriptorId; + } + set + { + _stateOfIssueStateAbbreviationDescriptorId = value; + _stateOfIssueStateAbbreviationDescriptor = null; + } + } + + private int _stateOfIssueStateAbbreviationDescriptorId; + private string _stateOfIssueStateAbbreviationDescriptor; + + [IgnoreMember] + public virtual string StateOfIssueStateAbbreviationDescriptor + { + get + { + if (_stateOfIssueStateAbbreviationDescriptor == null) + _stateOfIssueStateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateOfIssueStateAbbreviationDescriptorId); + + return _stateOfIssueStateAbbreviationDescriptor; + } + set + { + _stateOfIssueStateAbbreviationDescriptor = value; + _stateOfIssueStateAbbreviationDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -33106,77 +40575,200 @@ public CrisisEvent() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string CrisisDescription { get; set; } - public virtual DateTime? CrisisEndDate + [Key(8)] + public virtual int? CredentialFieldDescriptorId { - get { return _crisisEndDate; } + get + { + if (_credentialFieldDescriptorId == default(int?)) + _credentialFieldDescriptorId = string.IsNullOrWhiteSpace(_credentialFieldDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialFieldDescriptor", _credentialFieldDescriptor); + + return _credentialFieldDescriptorId; + } + set + { + _credentialFieldDescriptorId = value; + _credentialFieldDescriptor = null; + } + } + + private int? _credentialFieldDescriptorId; + private string _credentialFieldDescriptor; + + [IgnoreMember] + public virtual string CredentialFieldDescriptor + { + get + { + if (_credentialFieldDescriptor == null) + _credentialFieldDescriptor = _credentialFieldDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialFieldDescriptor", _credentialFieldDescriptorId.Value); + + return _credentialFieldDescriptor; + } + set + { + _credentialFieldDescriptor = value; + _credentialFieldDescriptorId = default(int?); + } + } + [Key(9)] + public virtual int CredentialTypeDescriptorId + { + get + { + if (_credentialTypeDescriptorId == default(int)) + _credentialTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CredentialTypeDescriptor", _credentialTypeDescriptor); + + return _credentialTypeDescriptorId; + } + set + { + _credentialTypeDescriptorId = value; + _credentialTypeDescriptor = null; + } + } + + private int _credentialTypeDescriptorId; + private string _credentialTypeDescriptor; + + [IgnoreMember] + public virtual string CredentialTypeDescriptor + { + get + { + if (_credentialTypeDescriptor == null) + _credentialTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CredentialTypeDescriptor", _credentialTypeDescriptorId); + + return _credentialTypeDescriptor; + } + set + { + _credentialTypeDescriptor = value; + _credentialTypeDescriptorId = default(int); + } + } + [Key(10)] + public virtual DateTime? EffectiveDate + { + get { return _effectiveDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _crisisEndDate = null; + _effectiveDate = null; } else { var given = (DateTime) value; - _crisisEndDate = new DateTime(given.Year, given.Month, given.Day); + _effectiveDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _crisisEndDate; + private DateTime? _effectiveDate; - public virtual DateTime? CrisisStartDate + [Key(11)] + public virtual DateTime? ExpirationDate { - get { return _crisisStartDate; } + get { return _expirationDate; } set { //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. if(value == null) { - _crisisStartDate = null; + _expirationDate = null; } else { var given = (DateTime) value; - _crisisStartDate = new DateTime(given.Year, given.Month, given.Day); + _expirationDate = new DateTime(given.Year, given.Month, given.Day); } } } - private DateTime? _crisisStartDate; + private DateTime? _expirationDate; - public virtual int CrisisTypeDescriptorId + [Key(12)] + public virtual DateTime IssuanceDate + { + get { return _issuanceDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _issuanceDate = new DateTime(value.Year, value.Month, value.Day); } + } + + private DateTime _issuanceDate; + + [Key(13)] + public virtual string Namespace { get; set; } + [Key(14)] + public virtual int? TeachingCredentialBasisDescriptorId { get { - if (_crisisTypeDescriptorId == default(int)) - _crisisTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CrisisTypeDescriptor", _crisisTypeDescriptor); + if (_teachingCredentialBasisDescriptorId == default(int?)) + _teachingCredentialBasisDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialBasisDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptor); - return _crisisTypeDescriptorId; + return _teachingCredentialBasisDescriptorId; } set { - _crisisTypeDescriptorId = value; - _crisisTypeDescriptor = null; + _teachingCredentialBasisDescriptorId = value; + _teachingCredentialBasisDescriptor = null; } } - private int _crisisTypeDescriptorId; - private string _crisisTypeDescriptor; + private int? _teachingCredentialBasisDescriptorId; + private string _teachingCredentialBasisDescriptor; - public virtual string CrisisTypeDescriptor + [IgnoreMember] + public virtual string TeachingCredentialBasisDescriptor { get { - if (_crisisTypeDescriptor == null) - _crisisTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CrisisTypeDescriptor", _crisisTypeDescriptorId); + if (_teachingCredentialBasisDescriptor == null) + _teachingCredentialBasisDescriptor = _teachingCredentialBasisDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialBasisDescriptor", _teachingCredentialBasisDescriptorId.Value); - return _crisisTypeDescriptor; + return _teachingCredentialBasisDescriptor; } set { - _crisisTypeDescriptor = value; - _crisisTypeDescriptorId = default(int); + _teachingCredentialBasisDescriptor = value; + _teachingCredentialBasisDescriptorId = default(int?); + } + } + [Key(15)] + public virtual int? TeachingCredentialDescriptorId + { + get + { + if (_teachingCredentialDescriptorId == default(int?)) + _teachingCredentialDescriptorId = string.IsNullOrWhiteSpace(_teachingCredentialDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("TeachingCredentialDescriptor", _teachingCredentialDescriptor); + + return _teachingCredentialDescriptorId; + } + set + { + _teachingCredentialDescriptorId = value; + _teachingCredentialDescriptor = null; + } + } + + private int? _teachingCredentialDescriptorId; + private string _teachingCredentialDescriptor; + + [IgnoreMember] + public virtual string TeachingCredentialDescriptor + { + get + { + if (_teachingCredentialDescriptor == null) + _teachingCredentialDescriptor = _teachingCredentialDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("TeachingCredentialDescriptor", _teachingCredentialDescriptorId.Value); + + return _teachingCredentialDescriptor; + } + set + { + _teachingCredentialDescriptor = value; + _teachingCredentialDescriptorId = default(int?); } } // ------------------------------------------------------------- @@ -33191,14 +40783,27 @@ public virtual string CrisisTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Credential", "Credential")] + [Key(16)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -33217,7 +40822,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Credential", "Credential")] + [Key(17)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -33228,191 +40873,178 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - // ------------------------------------------------------------- - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + private ICollection _credentialAcademicSubjects; + private ICollection _credentialAcademicSubjectsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CredentialAcademicSubjects + { + get { - { "CrisisTypeDescriptor", new LookupColumnDetails { PropertyName = "CrisisTypeDescriptorId", LookupTypeName = "CrisisTypeDescriptor"} }, - }; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_credentialAcademicSubjects is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "CredentialAcademicSubjects"); + } + + foreach (var item in _credentialAcademicSubjects) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } + return _credentialAcademicSubjects; + } + set + { + _credentialAcademicSubjects = value; + _credentialAcademicSubjectsCovariant = new CovariantCollectionAdapter(value); + } } - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialAcademicSubjects { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("CrisisEventName", CrisisEventName); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialAcademicSubjects) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- - return keyValues; + return _credentialAcademicSubjectsCovariant; + } + set + { + CredentialAcademicSubjects = new HashSet(value.Cast()); + } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - foreach (DictionaryEntry entry in theseKeys) + private ICollection _credentialEndorsements; + private ICollection _credentialEndorsementsCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CredentialEndorsements + { + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_credentialEndorsements is DeserializedPersistentGenericSet set) { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; + set.Reattach(this, "CredentialEndorsements"); } - } + + foreach (var item in _credentialEndorsements) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- - return true; + return _credentialEndorsements; + } + set + { + _credentialEndorsements = value; + _credentialEndorsementsCovariant = new CovariantCollectionAdapter(value); + } } - public override int GetHashCode() + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialEndorsements { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialEndorsements) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- - if (keyValues.Count == 0) - return base.GetHashCode(); + return _credentialEndorsementsCovariant; + } + set + { + CredentialEndorsements = new HashSet(value.Cast()); + } + } - var hashCode = new HashCode(); - foreach (DictionaryEntry entry in keyValues) + private ICollection _credentialGradeLevels; + private ICollection _credentialGradeLevelsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection CredentialGradeLevels + { + get { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_credentialGradeLevels is DeserializedPersistentGenericSet set) { - hashCode.Add(entry.Value); + set.Reattach(this, "CredentialGradeLevels"); } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.ICrisisEvent)target); - } + + foreach (var item in _credentialGradeLevels) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.ICrisisEvent) target, null); + return _credentialGradeLevels; + } + set + { + _credentialGradeLevels = value; + _credentialGradeLevelsCovariant = new CovariantCollectionAdapter(value); + } } - } -} -// Aggregate: CrisisTypeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CrisisTypeDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.CrisisTypeDescriptor table of the CrisisTypeDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class CrisisTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICrisisTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CrisisTypeDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.ICredential.CredentialGradeLevels { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _credentialGradeLevels) + if (item.Credential == null) + item.Credential = this; + // ------------------------------------------------------------- - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } + return _credentialGradeLevelsCovariant; + } + set + { + CredentialGradeLevels = new HashSet(value.Cast()); + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- // ------------------------------------------------------------- // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CredentialFieldDescriptor", new LookupColumnDetails { PropertyName = "CredentialFieldDescriptorId", LookupTypeName = "CredentialFieldDescriptor"} }, + { "CredentialTypeDescriptor", new LookupColumnDetails { PropertyName = "CredentialTypeDescriptorId", LookupTypeName = "CredentialTypeDescriptor"} }, + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "TeachingCredentialBasisDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialBasisDescriptorId", LookupTypeName = "TeachingCredentialBasisDescriptor"} }, + { "TeachingCredentialDescriptor", new LookupColumnDetails { PropertyName = "TeachingCredentialDescriptorId", LookupTypeName = "TeachingCredentialDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -33427,7 +41059,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("CrisisTypeDescriptorId", CrisisTypeDescriptorId); + keyValues.Add("CredentialIdentifier", CredentialIdentifier); + keyValues.Add("StateOfIssueStateAbbreviationDescriptorId", StateOfIssueStateAbbreviationDescriptorId); return keyValues; } @@ -33491,92 +41124,188 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICrisisTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredential)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICrisisTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredential) target, null); } } -} -// Aggregate: CTEProgramServiceDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CTEProgramServiceDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CTEProgramServiceDescriptor table of the CTEProgramServiceDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialAcademicSubject table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CTEProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICTEProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CredentialAcademicSubject : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICredentialAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int CTEProgramServiceDescriptorId + public CredentialAcademicSubject() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + [DomainSignature, IgnoreMember] + public virtual Credential Credential { get; set; } + + Entities.Common.EdFi.ICredential ICredentialAcademicSubject.Credential { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return Credential; } + set { Credential = (Credential) value; } } - DateTime? IDescriptor.EffectiveEndDate + + [DomainSignature] + [Key(1)] + public virtual int AcademicSubjectDescriptorId { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get + { + if (_academicSubjectDescriptorId == default(int)) + _academicSubjectDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AcademicSubjectDescriptor", _academicSubjectDescriptor); + + return _academicSubjectDescriptorId; + } + set + { + _academicSubjectDescriptorId = value; + _academicSubjectDescriptor = null; + } } - string IDescriptor.Namespace + + private int _academicSubjectDescriptorId; + private string _academicSubjectDescriptor; + + [IgnoreMember] + public virtual string AcademicSubjectDescriptor { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_academicSubjectDescriptor == null) + _academicSubjectDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AcademicSubjectDescriptor", _academicSubjectDescriptorId); + + return _academicSubjectDescriptor; + } + set + { + _academicSubjectDescriptor = value; + _academicSubjectDescriptorId = default(int); + } } - string IDescriptor.ShortDescription + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Credential", "CredentialAcademicSubject")] + [Key(2)] + public IDictionary Extensions { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } } - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Credential", "CredentialAcademicSubject")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -33592,6 +41321,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "AcademicSubjectDescriptor", new LookupColumnDetails { PropertyName = "AcademicSubjectDescriptorId", LookupTypeName = "AcademicSubjectDescriptor"} }, + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -33602,11 +41333,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Credential as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CTEProgramServiceDescriptorId", CTEProgramServiceDescriptorId); + keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); return keyValues; } @@ -33670,77 +41401,61 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialAcademicSubject)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialAcademicSubject) target, null); } + void IChildEntity.SetParent(object value) + { + Credential = (Credential) value; + } } -} -// Aggregate: CurriculumUsedDescriptor - -namespace EdFi.Ods.Entities.NHibernate.CurriculumUsedDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.CurriculumUsedDescriptor table of the CurriculumUsedDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialEndorsement table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class CurriculumUsedDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.ICurriculumUsedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CredentialEndorsement : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICredentialEndorsement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CredentialEndorsement() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature] - public virtual int CurriculumUsedDescriptorId + [DomainSignature, IgnoreMember] + public virtual Credential Credential { get; set; } + + Entities.Common.EdFi.ICredential ICredentialEndorsement.Credential { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + get { return Credential; } + set { Credential = (Credential) value; } } - + + [DomainSignature] + [Key(1)] + public virtual string CredentialEndorsementX { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } // ------------------------------------------------------------- // ============================================================= @@ -33756,6 +41471,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Credential", "CredentialEndorsement")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Credential", "CredentialEndorsement")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -33771,6 +41568,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -33781,11 +41579,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Credential as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); + keyValues.Add("CredentialEndorsement", CredentialEndorsementX); return keyValues; } @@ -33849,79 +41647,97 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.ICurriculumUsedDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialEndorsement)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.ICurriculumUsedDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialEndorsement) target, null); } + void IChildEntity.SetParent(object value) + { + Credential = (Credential) value; + } } -} -// Aggregate: DeliveryMethodDescriptor - -namespace EdFi.Ods.Entities.NHibernate.DeliveryMethodDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DeliveryMethodDescriptor table of the DeliveryMethodDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialGradeLevel table of the Credential aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DeliveryMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDeliveryMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CredentialGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.ICredentialGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int DeliveryMethodDescriptorId + public CredentialGradeLevel() { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Inherited Properties + // Primary Key // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate + [DomainSignature, IgnoreMember] + public virtual Credential Credential { get; set; } + + Entities.Common.EdFi.ICredential ICredentialGradeLevel.Credential { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return Credential; } + set { Credential = (Credential) value; } } - string IDescriptor.Namespace + + [DomainSignature] + [Key(1)] + public virtual int GradeLevelDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + [IgnoreMember] + public virtual string GradeLevelDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } } // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= // Properties // ------------------------------------------------------------- @@ -33935,6 +41751,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Credential", "CredentialGradeLevel")] + [Key(2)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Credential", "CredentialGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -33950,6 +41848,8 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "StateOfIssueStateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateOfIssueStateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -33960,11 +41860,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (Credential as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("DeliveryMethodDescriptorId", DeliveryMethodDescriptorId); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -34028,95 +41928,88 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDeliveryMethodDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDeliveryMethodDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialGradeLevel) target, null); } + void IChildEntity.SetParent(object value) + { + Credential = (Credential) value; + } } } -// Aggregate: Descriptor +// Aggregate: CredentialFieldDescriptor -namespace EdFi.Ods.Entities.NHibernate.DescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CredentialFieldDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.Descriptor table of the Descriptor aggregate in the ODS database. + /// A class which represents the edfi.CredentialFieldDescriptor table of the CredentialFieldDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public abstract class Descriptor : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDescriptor, IHasPrimaryKeyValues, IHasAlternateKeyValues, IHasLookupColumnPropertyMap + [MessagePackObject] + public class CredentialFieldDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICredentialFieldDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public Descriptor() - { - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual int DescriptorId { get; set; } + [DomainSignature] + [IgnoreMember] + public virtual int CredentialFieldDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CodeValue { get; set; } - public virtual string Description { get; set; } - public virtual DateTime? EffectiveBeginDate + string IDescriptor.CodeValue { - get { return _effectiveBeginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _effectiveBeginDate = null; - } else - { - var given = (DateTime) value; - _effectiveBeginDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return CodeValue; } + set { CodeValue = value; } } - - private DateTime? _effectiveBeginDate; - - public virtual DateTime? EffectiveEndDate + string IDescriptor.Description { - get { return _effectiveEndDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _effectiveEndDate = null; - } else - { - var given = (DateTime) value; - _effectiveEndDate = new DateTime(given.Year, given.Month, given.Day); - } - } + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- - private DateTime? _effectiveEndDate; - - public virtual string Namespace { get; set; } - public virtual string ShortDescription { get; set; } + // ============================================================= + // Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -34156,20 +42049,11 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DescriptorId", DescriptorId); + keyValues.Add("CredentialFieldDescriptorId", CredentialFieldDescriptorId); return keyValues; } - // Provide alternate key information - OrderedDictionary IHasAlternateKeyValues.GetAlternateKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - keyValues.Add("Namespace", Namespace); - keyValues.Add("CodeValue", CodeValue); - return keyValues; - } #region Overrides for Equals() and GetHashCode() public override bool Equals(object obj) { @@ -34227,132 +42111,81 @@ public override int GetHashCode() return hashCode.ToHashCode(); } #endregion - } -} -// Aggregate: DescriptorMapping - -namespace EdFi.Ods.Entities.NHibernate.DescriptorMappingAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class DescriptorMappingReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string MappedNamespace { get; set; } - public virtual string MappedValue { get; set; } - public virtual string Namespace { get; set; } - public virtual string Value { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + bool ISynchronizable.Synchronize(object target) { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("MappedNamespace", MappedNamespace); - keyValues.Add("MappedValue", MappedValue); - keyValues.Add("Namespace", Namespace); - keyValues.Add("Value", Value); - - return keyValues; + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialFieldDescriptor)target); } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + void IMappable.Map(object target) { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; + this.MapTo((Entities.Common.EdFi.ICredentialFieldDescriptor) target, null); } - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); - } - - return hashCode.ToHashCode(); - } - #endregion } +} +// Aggregate: CredentialTypeDescriptor +namespace EdFi.Ods.Entities.NHibernate.CredentialTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DescriptorMapping table of the DescriptorMapping aggregate in the ODS database. + /// A class which represents the edfi.CredentialTypeDescriptor table of the CredentialTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DescriptorMapping : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDescriptorMapping, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CredentialTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICredentialTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public DescriptorMapping() - { - DescriptorMappingModelEntities = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string MappedNamespace { get; set; } - [DomainSignature] - public virtual string MappedValue { get; set; } - [DomainSignature] - public virtual string Namespace { get; set; } - [DomainSignature] - public virtual string Value { get; set; } + [IgnoreMember] + public virtual int CredentialTypeDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } + } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -34368,35 +42201,6 @@ public DescriptorMapping() // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -34407,53 +42211,6 @@ public IDictionary Extensions //============================================================= // Collections // ------------------------------------------------------------- - - private ICollection _descriptorMappingModelEntities; - private ICollection _descriptorMappingModelEntitiesCovariant; - public virtual ICollection DescriptorMappingModelEntities - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _descriptorMappingModelEntities) - if (item.DescriptorMapping == null) - item.DescriptorMapping = this; - // ------------------------------------------------------------- - - return _descriptorMappingModelEntities; - } - set - { - _descriptorMappingModelEntities = value; - _descriptorMappingModelEntitiesCovariant = new CovariantCollectionAdapter(value); - } - } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDescriptorMapping.DescriptorMappingModelEntities - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _descriptorMappingModelEntities) - if (item.DescriptorMapping == null) - item.DescriptorMapping = this; - // ------------------------------------------------------------- - - return _descriptorMappingModelEntitiesCovariant; - } - set - { - DescriptorMappingModelEntities = new HashSet(value.Cast()); - } - } - // ------------------------------------------------------------- // Provide lookup property map @@ -34473,10 +42230,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("MappedNamespace", MappedNamespace); - keyValues.Add("MappedValue", MappedValue); - keyValues.Add("Namespace", Namespace); - keyValues.Add("Value", Value); + keyValues.Add("CredentialTypeDescriptorId", CredentialTypeDescriptorId); return keyValues; } @@ -34540,88 +42294,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMapping)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICredentialTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDescriptorMapping) target, null); + this.MapTo((Entities.Common.EdFi.ICredentialTypeDescriptor) target, null); } } +} +// Aggregate: CreditCategoryDescriptor + +namespace EdFi.Ods.Entities.NHibernate.CreditCategoryDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DescriptorMappingModelEntity table of the DescriptorMapping aggregate in the ODS database. + /// A class which represents the edfi.CreditCategoryDescriptor table of the CreditCategoryDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DescriptorMappingModelEntity : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDescriptorMappingModelEntity, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class CreditCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICreditCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public DescriptorMappingModelEntity() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DescriptorMapping DescriptorMapping { get; set; } - - Entities.Common.EdFi.IDescriptorMapping IDescriptorMappingModelEntity.DescriptorMapping - { - get { return DescriptorMapping; } - set { DescriptorMapping = (DescriptorMapping) value; } - } - [DomainSignature] - public virtual int ModelEntityDescriptorId - { - get - { - if (_modelEntityDescriptorId == default(int)) - _modelEntityDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ModelEntityDescriptor", _modelEntityDescriptor); - - return _modelEntityDescriptorId; - } - set - { - _modelEntityDescriptorId = value; - _modelEntityDescriptor = null; - } - } - - private int _modelEntityDescriptorId; - private string _modelEntityDescriptor; - - public virtual string ModelEntityDescriptor + [IgnoreMember] + public virtual int CreditCategoryDescriptorId { - get - { - if (_modelEntityDescriptor == null) - _modelEntityDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ModelEntityDescriptor", _modelEntityDescriptorId); - - return _modelEntityDescriptor; - } - set - { - _modelEntityDescriptor = value; - _modelEntityDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -34637,35 +42382,6 @@ public virtual string ModelEntityDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -34681,7 +42397,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ModelEntityDescriptor", new LookupColumnDetails { PropertyName = "ModelEntityDescriptorId", LookupTypeName = "ModelEntityDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -34692,11 +42407,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (DescriptorMapping as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ModelEntityDescriptorId", ModelEntityDescriptorId); + keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); return keyValues; } @@ -34760,41 +42475,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMappingModelEntity)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICreditCategoryDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDescriptorMappingModelEntity) target, null); + this.MapTo((Entities.Common.EdFi.ICreditCategoryDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - DescriptorMapping = (DescriptorMapping) value; - } } } -// Aggregate: DiagnosisDescriptor +// Aggregate: CreditTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.DiagnosisDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CreditTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DiagnosisDescriptor table of the DiagnosisDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CreditTypeDescriptor table of the CreditTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DiagnosisDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDiagnosisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DiagnosisDescriptorId + [IgnoreMember] + public virtual int CreditTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -34879,7 +42592,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); + keyValues.Add("CreditTypeDescriptorId", CreditTypeDescriptorId); return keyValues; } @@ -34943,84 +42656,218 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDiagnosisDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICreditTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDiagnosisDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICreditTypeDescriptor) target, null); } } } -// Aggregate: DiplomaLevelDescriptor +// Aggregate: CrisisEvent -namespace EdFi.Ods.Entities.NHibernate.DiplomaLevelDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CrisisEventAggregate.EdFi { + /// + /// Represents a read-only reference to the entity. + /// + [MessagePackObject] + public class CrisisEventReferenceData : IHasPrimaryKeyValues + { + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [Key(0)] + public virtual string CrisisEventName { get; set; } + // ------------------------------------------------------------- + + /// + /// The id of the referenced entity (used as the resource identifier in the API). + /// + [Key(1)] + public virtual Guid? Id { get; set; } + + /// + /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity + /// when that entity has been derived; otherwise null. + /// + [Key(2)] + public virtual string Discriminator { get; set; } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("CrisisEventName", CrisisEventName); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + hashCode.Add(entry.Value); + } + + return hashCode.ToHashCode(); + } + #endregion + } + // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DiplomaLevelDescriptor table of the DiplomaLevelDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CrisisEvent table of the CrisisEvent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DiplomaLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDiplomaLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CrisisEvent : AggregateRootWithCompositeKey, + Entities.Common.EdFi.ICrisisEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } + + public CrisisEvent() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DiplomaLevelDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - + [Key(6)] + public virtual string CrisisEventName { get; set; } // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(7)] + public virtual string CrisisDescription { get; set; } + [Key(8)] + public virtual DateTime? CrisisEndDate { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } + get { return _crisisEndDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _crisisEndDate = null; + } else + { + var given = (DateTime) value; + _crisisEndDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - DateTime? IDescriptor.EffectiveEndDate + + private DateTime? _crisisEndDate; + + [Key(9)] + public virtual DateTime? CrisisStartDate { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } + get { return _crisisStartDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _crisisStartDate = null; + } else + { + var given = (DateTime) value; + _crisisStartDate = new DateTime(given.Year, given.Month, given.Day); + } + } } - string IDescriptor.Namespace + + private DateTime? _crisisStartDate; + + [Key(10)] + public virtual int CrisisTypeDescriptorId { - get { return Namespace; } - set { Namespace = value; } + get + { + if (_crisisTypeDescriptorId == default(int)) + _crisisTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CrisisTypeDescriptor", _crisisTypeDescriptor); + + return _crisisTypeDescriptorId; + } + set + { + _crisisTypeDescriptorId = value; + _crisisTypeDescriptor = null; + } } - string IDescriptor.ShortDescription + + private int _crisisTypeDescriptorId; + private string _crisisTypeDescriptor; + + [IgnoreMember] + public virtual string CrisisTypeDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_crisisTypeDescriptor == null) + _crisisTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CrisisTypeDescriptor", _crisisTypeDescriptorId); + + return _crisisTypeDescriptor; + } + set + { + _crisisTypeDescriptor = value; + _crisisTypeDescriptorId = default(int); + } } // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= // One-to-one relationships // ------------------------------------------------------------- @@ -35029,6 +42876,88 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "CrisisEvent", "CrisisEvent")] + [Key(11)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "CrisisEvent", "CrisisEvent")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -35044,6 +42973,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "CrisisTypeDescriptor", new LookupColumnDetails { PropertyName = "CrisisTypeDescriptorId", LookupTypeName = "CrisisTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -35058,7 +42988,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiplomaLevelDescriptorId", DiplomaLevelDescriptorId); + keyValues.Add("CrisisEventName", CrisisEventName); return keyValues; } @@ -35122,37 +43052,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaLevelDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICrisisEvent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDiplomaLevelDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICrisisEvent) target, null); } } } -// Aggregate: DiplomaTypeDescriptor +// Aggregate: CrisisTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.DiplomaTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CrisisTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DiplomaTypeDescriptor table of the DiplomaTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CrisisTypeDescriptor table of the CrisisTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DiplomaTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDiplomaTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CrisisTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICrisisTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DiplomaTypeDescriptorId + [IgnoreMember] + public virtual int CrisisTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -35237,7 +43169,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DiplomaTypeDescriptorId", DiplomaTypeDescriptorId); + keyValues.Add("CrisisTypeDescriptorId", CrisisTypeDescriptorId); return keyValues; } @@ -35301,37 +43233,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICrisisTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDiplomaTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICrisisTypeDescriptor) target, null); } } } -// Aggregate: DisabilityDescriptor +// Aggregate: CTEProgramServiceDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisabilityDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CTEProgramServiceDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisabilityDescriptor table of the DisabilityDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CTEProgramServiceDescriptor table of the CTEProgramServiceDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CTEProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICTEProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisabilityDescriptorId + [IgnoreMember] + public virtual int CTEProgramServiceDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -35416,7 +43350,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisabilityDescriptorId", DisabilityDescriptorId); + keyValues.Add("CTEProgramServiceDescriptorId", CTEProgramServiceDescriptorId); return keyValues; } @@ -35480,37 +43414,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisabilityDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICTEProgramServiceDescriptor) target, null); } } } -// Aggregate: DisabilityDesignationDescriptor +// Aggregate: CurriculumUsedDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisabilityDesignationDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.CurriculumUsedDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisabilityDesignationDescriptor table of the DisabilityDesignationDescriptor aggregate in the ODS database. + /// A class which represents the edfi.CurriculumUsedDescriptor table of the CurriculumUsedDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisabilityDesignationDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisabilityDesignationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class CurriculumUsedDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.ICurriculumUsedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisabilityDesignationDescriptorId + [IgnoreMember] + public virtual int CurriculumUsedDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -35595,7 +43531,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisabilityDesignationDescriptorId", DisabilityDesignationDescriptorId); + keyValues.Add("CurriculumUsedDescriptorId", CurriculumUsedDescriptorId); return keyValues; } @@ -35659,37 +43595,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.ICurriculumUsedDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.ICurriculumUsedDescriptor) target, null); } } } -// Aggregate: DisabilityDeterminationSourceTypeDescriptor +// Aggregate: DeliveryMethodDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisabilityDeterminationSourceTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DeliveryMethodDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisabilityDeterminationSourceTypeDescriptor table of the DisabilityDeterminationSourceTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DeliveryMethodDescriptor table of the DeliveryMethodDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisabilityDeterminationSourceTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class DeliveryMethodDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDeliveryMethodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisabilityDeterminationSourceTypeDescriptorId + [IgnoreMember] + public virtual int DeliveryMethodDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -35774,7 +43712,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisabilityDeterminationSourceTypeDescriptorId", DisabilityDeterminationSourceTypeDescriptorId); + keyValues.Add("DeliveryMethodDescriptorId", DeliveryMethodDescriptorId); return keyValues; } @@ -35838,42 +43776,50 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDeliveryMethodDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDeliveryMethodDescriptor) target, null); } } } -// Aggregate: DisciplineAction +// Aggregate: DescriptorMapping -namespace EdFi.Ods.Entities.NHibernate.DisciplineActionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DescriptorMappingAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class DisciplineActionReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class DescriptorMappingReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string DisciplineActionIdentifier { get; set; } - public virtual DateTime DisciplineDate { get; set; } - public virtual int StudentUSI { get; set; } + [Key(0)] + public virtual string MappedNamespace { get; set; } + [Key(1)] + public virtual string MappedValue { get; set; } + [Key(2)] + public virtual string Namespace { get; set; } + [Key(3)] + public virtual string Value { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -35883,9 +43829,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); - keyValues.Add("DisciplineDate", DisciplineDate); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("MappedNamespace", MappedNamespace); + keyValues.Add("MappedValue", MappedValue); + keyValues.Add("Namespace", Namespace); + keyValues.Add("Value", Value); return keyValues; } @@ -35936,22 +43883,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineAction table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DescriptorMapping table of the DescriptorMapping aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineAction : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDisciplineAction, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DescriptorMapping : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDescriptorMapping, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineAction() + public DescriptorMapping() { - DisciplineActionDisciplines = new HashSet(); - DisciplineActionStaffs = new HashSet(); - DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + DescriptorMappingModelEntities = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -35960,66 +43906,17 @@ public DisciplineAction() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string DisciplineActionIdentifier { get; set; } + [Key(6)] + public virtual string MappedNamespace { get; set; } [DomainSignature] - public virtual DateTime DisciplineDate - { - get { return _disciplineDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _disciplineDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _disciplineDate; - - [Display(Name="StudentUniqueId")][DomainSignature] - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) - { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) - { - _studentUSI = usi; - } - } - - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); - } - } - - private int _studentUSI; - private string _studentUniqueId; - - public virtual string StudentUniqueId - { - get - { - if (_studentUniqueId == null) - { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) - { - _studentUniqueId = uniqueId; - } - } - - return _studentUniqueId; - } - set - { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } - } + [Key(7)] + public virtual string MappedValue { get; set; } + [DomainSignature] + [Key(8)] + public virtual string Namespace { get; set; } + [DomainSignature] + [Key(9)] + public virtual string Value { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -36030,46 +43927,6 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- - public virtual decimal? ActualDisciplineActionLength { get; set; } - public virtual long? AssignmentSchoolId { get; set; } - public virtual decimal? DisciplineActionLength { get; set; } - public virtual int? DisciplineActionLengthDifferenceReasonDescriptorId - { - get - { - if (_disciplineActionLengthDifferenceReasonDescriptorId == default(int?)) - _disciplineActionLengthDifferenceReasonDescriptorId = string.IsNullOrWhiteSpace(_disciplineActionLengthDifferenceReasonDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptor); - - return _disciplineActionLengthDifferenceReasonDescriptorId; - } - set - { - _disciplineActionLengthDifferenceReasonDescriptorId = value; - _disciplineActionLengthDifferenceReasonDescriptor = null; - } - } - - private int? _disciplineActionLengthDifferenceReasonDescriptorId; - private string _disciplineActionLengthDifferenceReasonDescriptor; - - public virtual string DisciplineActionLengthDifferenceReasonDescriptor - { - get - { - if (_disciplineActionLengthDifferenceReasonDescriptor == null) - _disciplineActionLengthDifferenceReasonDescriptor = _disciplineActionLengthDifferenceReasonDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptorId.Value); - - return _disciplineActionLengthDifferenceReasonDescriptor; - } - set - { - _disciplineActionLengthDifferenceReasonDescriptor = value; - _disciplineActionLengthDifferenceReasonDescriptorId = default(int?); - } - } - public virtual bool? IEPPlacementMeetingIndicator { get; set; } - public virtual bool? RelatedToZeroTolerancePolicy { get; set; } - public virtual long ResponsibilitySchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -36082,14 +43939,27 @@ public virtual string DisciplineActionLengthDifferenceReasonDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DescriptorMapping", "DescriptorMapping")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -36108,157 +43978,63 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData AssignmentSchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the AssignmentSchool resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolResourceId - { - get { return AssignmentSchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ResponsibilitySchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the ResponsibilitySchool resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolResourceId - { - get { return ResponsibilitySchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } - - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineAction.StudentResourceId - { - get { return StudentReferenceData?.Id; } - set { } - } - - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _disciplineActionDisciplines; - private ICollection _disciplineActionDisciplinesCovariant; - public virtual ICollection DisciplineActionDisciplines - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionDisciplines) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- - - return _disciplineActionDisciplines; - } - set - { - _disciplineActionDisciplines = value; - _disciplineActionDisciplinesCovariant = new CovariantCollectionAdapter(value); - } - } + private IDictionary _aggregateExtensions; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionDisciplines - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DescriptorMapping", "DescriptorMapping")] + [Key(11)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionDisciplines) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _disciplineActionDisciplinesCovariant; + return _aggregateExtensions; } set { - DisciplineActionDisciplines = new HashSet(value.Cast()); - } - } - - - private ICollection _disciplineActionStaffs; - private ICollection _disciplineActionStaffsCovariant; - public virtual ICollection DisciplineActionStaffs - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionStaffs) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } - return _disciplineActionStaffs; - } - set - { - _disciplineActionStaffs = value; - _disciplineActionStaffsCovariant = new CovariantCollectionAdapter(value); + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStaffs - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _disciplineActionStaffs) - if (item.DisciplineAction == null) - item.DisciplineAction = this; - // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _disciplineActionStaffsCovariant; - } - set - { - DisciplineActionStaffs = new HashSet(value.Cast()); - } - } + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- - private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociations; - private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; - public virtual ICollection DisciplineActionStudentDisciplineIncidentBehaviorAssociations + private ICollection _descriptorMappingModelEntities; + private ICollection _descriptorMappingModelEntitiesCovariant; + [Key(12)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection DescriptorMappingModelEntities { get { @@ -36267,38 +44043,43 @@ public virtual ICollection set) + { + set.Reattach(this, "DescriptorMappingModelEntities"); + } + + foreach (var item in _descriptorMappingModelEntities) + if (item.DescriptorMapping == null) + item.DescriptorMapping = this; // ------------------------------------------------------------- - return _disciplineActionStudentDisciplineIncidentBehaviorAssociations; + return _descriptorMappingModelEntities; } set { - _disciplineActionStudentDisciplineIncidentBehaviorAssociations = value; - _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant = new CovariantCollectionAdapter(value); + _descriptorMappingModelEntities = value; + _descriptorMappingModelEntitiesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStudentDisciplineIncidentBehaviorAssociations + ICollection Entities.Common.EdFi.IDescriptorMapping.DescriptorMappingModelEntities { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineActionStudentDisciplineIncidentBehaviorAssociations) - if (item.DisciplineAction == null) - item.DisciplineAction = this; + foreach (var item in _descriptorMappingModelEntities) + if (item.DescriptorMapping == null) + item.DescriptorMapping = this; // ------------------------------------------------------------- - return _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; + return _descriptorMappingModelEntitiesCovariant; } set { - DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(value.Cast()); + DescriptorMappingModelEntities = new HashSet(value.Cast()); } } @@ -36307,7 +44088,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DisciplineActionLengthDifferenceReasonDescriptor", new LookupColumnDetails { PropertyName = "DisciplineActionLengthDifferenceReasonDescriptorId", LookupTypeName = "DisciplineActionLengthDifferenceReasonDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -36322,9 +44102,10 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); - keyValues.Add("DisciplineDate", DisciplineDate); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("MappedNamespace", MappedNamespace); + keyValues.Add("MappedValue", MappedValue); + keyValues.Add("Namespace", Namespace); + keyValues.Add("Value", Value); return keyValues; } @@ -36388,12 +44169,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineAction)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMapping)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineAction) target, null); + this.MapTo((Entities.Common.EdFi.IDescriptorMapping) target, null); } } @@ -36401,19 +44182,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionDiscipline table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DescriptorMappingModelEntity table of the DescriptorMapping aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionDiscipline : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineActionDiscipline, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DescriptorMappingModelEntity : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDescriptorMappingModelEntity, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineActionDiscipline() + public DescriptorMappingModelEntity() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -36421,48 +44203,50 @@ public DisciplineActionDiscipline() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineAction DisciplineAction { get; set; } + [DomainSignature, IgnoreMember] + public virtual DescriptorMapping DescriptorMapping { get; set; } - Entities.Common.EdFi.IDisciplineAction IDisciplineActionDiscipline.DisciplineAction + Entities.Common.EdFi.IDescriptorMapping IDescriptorMappingModelEntity.DescriptorMapping { - get { return DisciplineAction; } - set { DisciplineAction = (DisciplineAction) value; } + get { return DescriptorMapping; } + set { DescriptorMapping = (DescriptorMapping) value; } } [DomainSignature] - public virtual int DisciplineDescriptorId + [Key(1)] + public virtual int ModelEntityDescriptorId { get { - if (_disciplineDescriptorId == default(int)) - _disciplineDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineDescriptor", _disciplineDescriptor); + if (_modelEntityDescriptorId == default(int)) + _modelEntityDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ModelEntityDescriptor", _modelEntityDescriptor); - return _disciplineDescriptorId; + return _modelEntityDescriptorId; } set { - _disciplineDescriptorId = value; - _disciplineDescriptor = null; + _modelEntityDescriptorId = value; + _modelEntityDescriptor = null; } } - private int _disciplineDescriptorId; - private string _disciplineDescriptor; + private int _modelEntityDescriptorId; + private string _modelEntityDescriptor; - public virtual string DisciplineDescriptor + [IgnoreMember] + public virtual string ModelEntityDescriptor { get { - if (_disciplineDescriptor == null) - _disciplineDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineDescriptor", _disciplineDescriptorId); + if (_modelEntityDescriptor == null) + _modelEntityDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ModelEntityDescriptor", _modelEntityDescriptorId); - return _disciplineDescriptor; + return _modelEntityDescriptor; } set { - _disciplineDescriptor = value; - _disciplineDescriptorId = default(int); + _modelEntityDescriptor = value; + _modelEntityDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -36487,14 +44271,27 @@ public virtual string DisciplineDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DescriptorMapping", "DescriptorMappingModelEntity")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -36513,7 +44310,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DescriptorMapping", "DescriptorMappingModelEntity")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -36529,7 +44366,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DisciplineDescriptor", new LookupColumnDetails { PropertyName = "DisciplineDescriptorId", LookupTypeName = "DisciplineDescriptor"} }, + { "ModelEntityDescriptor", new LookupColumnDetails { PropertyName = "ModelEntityDescriptorId", LookupTypeName = "ModelEntityDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -36541,10 +44378,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DescriptorMapping as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); + keyValues.Add("ModelEntityDescriptorId", ModelEntityDescriptorId); return keyValues; } @@ -36608,106 +44445,264 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionDiscipline)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDescriptorMappingModelEntity)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionDiscipline) target, null); + this.MapTo((Entities.Common.EdFi.IDescriptorMappingModelEntity) target, null); } void IChildEntity.SetParent(object value) { - DisciplineAction = (DisciplineAction) value; + DescriptorMapping = (DescriptorMapping) value; } } +} +// Aggregate: DiagnosisDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DiagnosisDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionStaff table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DiagnosisDescriptor table of the DiagnosisDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionStaff : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineActionStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DiagnosisDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDiagnosisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineActionStaff() + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int DiagnosisDescriptorId { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 + + // ------------------------------------------------------------- // ============================================================= - // Primary Key + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineAction DisciplineAction { get; set; } - Entities.Common.EdFi.IDisciplineAction IDisciplineActionStaff.DisciplineAction + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get { return DisciplineAction; } - set { DisciplineAction = (DisciplineAction) value; } + get { return _idPropertyByLookupProperty; } } - [Display(Name="StaffUniqueId")][DomainSignature] - public virtual int StaffUSI + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - if (_staffUSI == default(int) && _staffUniqueId != null) + if (entry.Value is string) { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) { - _staffUSI = usi; + return false; } } - - return _staffUSI; - } - set - { - _staffUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } - } - private int _staffUSI; - private string _staffUniqueId; + return true; + } - public virtual string StaffUniqueId + public override int GetHashCode() { - get + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - if (_staffUniqueId == null) + if (entry.Value is string) { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) - { - _staffUniqueId = uniqueId; - } + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); } - - return _staffUniqueId; } - set - { - if (_staffUniqueId != value) - _staffUSI = default(int); - _staffUniqueId = value; - } + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IDiagnosisDescriptor)target); + } + + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IDiagnosisDescriptor) target, null); + } + + } +} +// Aggregate: DiplomaLevelDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DiplomaLevelDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.DiplomaLevelDescriptor table of the DiplomaLevelDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class DiplomaLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDiplomaLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature] + [IgnoreMember] + public virtual int DiplomaLevelDescriptorId + { + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -36723,60 +44718,192 @@ public virtual string StaffUniqueId // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; + // ------------------------------------------------------------- - public IDictionary Extensions + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + }; + + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty { - get => _extensions; - set + get { return _idPropertyByLookupProperty; } + } + + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + { + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); + + // Add current key values + keyValues.Add("DiplomaLevelDescriptorId", DiplomaLevelDescriptorId); + + return keyValues; + } + + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) + { + var compareTo = obj as IHasPrimaryKeyValues; + + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + if (entry.Value is string) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } + return false; } } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } + } - _extensions = value; + return true; + } + + public override int GetHashCode() + { + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) + { + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaLevelDescriptor)target); } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IDiplomaLevelDescriptor) target, null); + } + + } +} +// Aggregate: DiplomaTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DiplomaTypeDescriptorAggregate.EdFi +{ +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.DiplomaTypeDescriptor table of the DiplomaTypeDescriptor aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class DiplomaTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDiplomaTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + { // ============================================================= - // Reference Data + // Primary Key // ------------------------------------------------------------- - public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } - - /// - /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IDisciplineActionStaff.StaffDiscriminator + [DomainSignature] + [IgnoreMember] + public virtual int DiplomaTypeDescriptorId { - get { return StaffReferenceData?.Discriminator; } - set { } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + + // ------------------------------------------------------------- - /// - /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineActionStaff.StaffResourceId + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + string IDescriptor.CodeValue { - get { return StaffReferenceData?.Id; } - set { } + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } } + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- // ------------------------------------------------------------- //============================================================= @@ -36797,11 +44924,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("StaffUSI", StaffUSI); + keyValues.Add("DiplomaTypeDescriptorId", DiplomaTypeDescriptorId); return keyValues; } @@ -36865,96 +44992,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStaff)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDiplomaTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionStaff) target, null); + this.MapTo((Entities.Common.EdFi.IDiplomaTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - DisciplineAction = (DisciplineAction) value; - } } +} +// Aggregate: DisabilityDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DisabilityDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionStudentDisciplineIncidentBehaviorAssociation table of the DisciplineAction aggregate in the ODS database. + /// A class which represents the edfi.DisabilityDescriptor table of the DisabilityDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionStudentDisciplineIncidentBehaviorAssociation : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public DisciplineActionStudentDisciplineIncidentBehaviorAssociation() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineAction DisciplineAction { get; set; } - - Entities.Common.EdFi.IDisciplineAction IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.DisciplineAction - { - get { return DisciplineAction; } - set { DisciplineAction = (DisciplineAction) value; } - } - [DomainSignature] - public virtual int BehaviorDescriptorId - { - get - { - if (_behaviorDescriptorId == default(int)) - _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); - - return _behaviorDescriptorId; - } - set - { - _behaviorDescriptorId = value; - _behaviorDescriptor = null; - } - } - - private int _behaviorDescriptorId; - private string _behaviorDescriptor; - - public virtual string BehaviorDescriptor + [IgnoreMember] + public virtual int DisabilityDescriptorId { - get - { - if (_behaviorDescriptor == null) - _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); - - return _behaviorDescriptor; - } - set - { - _behaviorDescriptor = value; - _behaviorDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - [DomainSignature] - public virtual string IncidentIdentifier { get; set; } - [DomainSignature] - public virtual long SchoolId { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -36970,60 +45080,11 @@ public virtual string BehaviorDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.StudentDisciplineIncidentBehaviorAssociationAggregate.EdFi.StudentDisciplineIncidentBehaviorAssociationReferenceData StudentDisciplineIncidentBehaviorAssociationReferenceData { get; set; } - - /// - /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDiscriminator - { - get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationResourceId - { - get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -37034,7 +45095,6 @@ string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAs // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -37045,13 +45105,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (DisciplineAction as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("DisabilityDescriptorId", DisabilityDescriptorId); return keyValues; } @@ -37115,41 +45173,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IDisabilityDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - DisciplineAction = (DisciplineAction) value; - } } } -// Aggregate: DisciplineActionLengthDifferenceReasonDescriptor +// Aggregate: DisabilityDesignationDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisciplineActionLengthDifferenceReasonDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisabilityDesignationDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineActionLengthDifferenceReasonDescriptor table of the DisciplineActionLengthDifferenceReasonDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisabilityDesignationDescriptor table of the DisabilityDesignationDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineActionLengthDifferenceReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class DisabilityDesignationDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisabilityDesignationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisciplineActionLengthDifferenceReasonDescriptorId + [IgnoreMember] + public virtual int DisabilityDesignationDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -37234,7 +45290,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineActionLengthDifferenceReasonDescriptorId", DisciplineActionLengthDifferenceReasonDescriptorId); + keyValues.Add("DisabilityDesignationDescriptorId", DisabilityDesignationDescriptorId); return keyValues; } @@ -37298,37 +45354,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisabilityDesignationDescriptor) target, null); } } } -// Aggregate: DisciplineDescriptor +// Aggregate: DisabilityDeterminationSourceTypeDescriptor -namespace EdFi.Ods.Entities.NHibernate.DisciplineDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisabilityDeterminationSourceTypeDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineDescriptor table of the DisciplineDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisabilityDeterminationSourceTypeDescriptor table of the DisabilityDeterminationSourceTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisciplineDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class DisabilityDeterminationSourceTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DisciplineDescriptorId + [IgnoreMember] + public virtual int DisabilityDeterminationSourceTypeDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -37413,7 +45471,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); + keyValues.Add("DisabilityDeterminationSourceTypeDescriptorId", DisabilityDeterminationSourceTypeDescriptorId); return keyValues; } @@ -37477,41 +45535,48 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisabilityDeterminationSourceTypeDescriptor) target, null); } } } -// Aggregate: DisciplineIncident +// Aggregate: DisciplineAction -namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisciplineActionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class DisciplineIncidentReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class DisciplineActionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string IncidentIdentifier { get; set; } - public virtual long SchoolId { get; set; } + [Key(0)] + public virtual string DisciplineActionIdentifier { get; set; } + [Key(1)] + public virtual DateTime DisciplineDate { get; set; } + [Key(2)] + public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -37521,8 +45586,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); + keyValues.Add("DisciplineDate", DisciplineDate); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -37573,22 +45639,23 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncident table of the DisciplineIncident aggregate in the ODS database. + /// A class which represents the edfi.DisciplineAction table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncident : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IDisciplineIncident, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisciplineAction : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDisciplineAction, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineIncident() + public DisciplineAction() { - DisciplineIncidentBehaviors = new HashSet(); - DisciplineIncidentExternalParticipants = new HashSet(); - DisciplineIncidentWeapons = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + DisciplineActionDisciplines = new HashSet(); + DisciplineActionStaffs = new HashSet(); + DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -37597,102 +45664,128 @@ public DisciplineIncident() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string IncidentIdentifier { get; set; } + [Key(6)] + public virtual string DisciplineActionIdentifier { get; set; } [DomainSignature] - public virtual long SchoolId { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CaseNumber { get; set; } - public virtual decimal? IncidentCost { get; set; } - public virtual DateTime IncidentDate + [Key(7)] + public virtual DateTime DisciplineDate { - get { return _incidentDate; } + get { return _disciplineDate; } //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _incidentDate = new DateTime(value.Year, value.Month, value.Day); } + set { _disciplineDate = new DateTime(value.Year, value.Month, value.Day); } } - private DateTime _incidentDate; + private DateTime _disciplineDate; - public virtual string IncidentDescription { get; set; } - public virtual int? IncidentLocationDescriptorId + [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] + public virtual int StudentUSI { get { - if (_incidentLocationDescriptorId == default(int?)) - _incidentLocationDescriptorId = string.IsNullOrWhiteSpace(_incidentLocationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IncidentLocationDescriptor", _incidentLocationDescriptor); + if (_studentUSI == default(int) && _studentUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + { + _studentUSI = usi; + } + } - return _incidentLocationDescriptorId; + return _studentUSI; } set { - _incidentLocationDescriptorId = value; - _incidentLocationDescriptor = null; + _studentUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); } } - private int? _incidentLocationDescriptorId; - private string _incidentLocationDescriptor; + private int _studentUSI; + private string _studentUniqueId; - public virtual string IncidentLocationDescriptor + [IgnoreMember] + public virtual string StudentUniqueId { get { - if (_incidentLocationDescriptor == null) - _incidentLocationDescriptor = _incidentLocationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IncidentLocationDescriptor", _incidentLocationDescriptorId.Value); - - return _incidentLocationDescriptor; + if (_studentUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + { + _studentUniqueId = uniqueId; + } + } + + return _studentUniqueId; } set { - _incidentLocationDescriptor = value; - _incidentLocationDescriptorId = default(int?); + if (_studentUniqueId != value) + _studentUSI = default(int); + + _studentUniqueId = value; } } - public virtual TimeSpan? IncidentTime { get; set; } - public virtual bool? ReportedToLawEnforcement { get; set; } - public virtual int? ReporterDescriptionDescriptorId + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(9)] + public virtual decimal? ActualDisciplineActionLength { get; set; } + [Key(10)] + public virtual long? AssignmentSchoolId { get; set; } + [Key(11)] + public virtual decimal? DisciplineActionLength { get; set; } + [Key(12)] + public virtual int? DisciplineActionLengthDifferenceReasonDescriptorId { get { - if (_reporterDescriptionDescriptorId == default(int?)) - _reporterDescriptionDescriptorId = string.IsNullOrWhiteSpace(_reporterDescriptionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReporterDescriptionDescriptor", _reporterDescriptionDescriptor); + if (_disciplineActionLengthDifferenceReasonDescriptorId == default(int?)) + _disciplineActionLengthDifferenceReasonDescriptorId = string.IsNullOrWhiteSpace(_disciplineActionLengthDifferenceReasonDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptor); - return _reporterDescriptionDescriptorId; + return _disciplineActionLengthDifferenceReasonDescriptorId; } set { - _reporterDescriptionDescriptorId = value; - _reporterDescriptionDescriptor = null; + _disciplineActionLengthDifferenceReasonDescriptorId = value; + _disciplineActionLengthDifferenceReasonDescriptor = null; } } - private int? _reporterDescriptionDescriptorId; - private string _reporterDescriptionDescriptor; + private int? _disciplineActionLengthDifferenceReasonDescriptorId; + private string _disciplineActionLengthDifferenceReasonDescriptor; - public virtual string ReporterDescriptionDescriptor + [IgnoreMember] + public virtual string DisciplineActionLengthDifferenceReasonDescriptor { get { - if (_reporterDescriptionDescriptor == null) - _reporterDescriptionDescriptor = _reporterDescriptionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReporterDescriptionDescriptor", _reporterDescriptionDescriptorId.Value); + if (_disciplineActionLengthDifferenceReasonDescriptor == null) + _disciplineActionLengthDifferenceReasonDescriptor = _disciplineActionLengthDifferenceReasonDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineActionLengthDifferenceReasonDescriptor", _disciplineActionLengthDifferenceReasonDescriptorId.Value); - return _reporterDescriptionDescriptor; + return _disciplineActionLengthDifferenceReasonDescriptor; } set { - _reporterDescriptionDescriptor = value; - _reporterDescriptionDescriptorId = default(int?); + _disciplineActionLengthDifferenceReasonDescriptor = value; + _disciplineActionLengthDifferenceReasonDescriptorId = default(int?); } } - public virtual string ReporterName { get; set; } + [Key(13)] + public virtual bool? IEPPlacementMeetingIndicator { get; set; } + [Key(14)] + public virtual bool? RelatedToZeroTolerancePolicy { get; set; } + [Key(15)] + public virtual long ResponsibilitySchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -37705,14 +45798,27 @@ public virtual string ReporterDescriptionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineAction")] + [Key(16)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -37731,20 +45837,94 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineAction")] + [Key(17)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } + [Key(18)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData AssignmentSchoolReferenceData { get; set; } /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the AssignmentSchool resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IDisciplineIncident.SchoolResourceId + Guid? Entities.Common.EdFi.IDisciplineAction.AssignmentSchoolResourceId { - get { return SchoolReferenceData?.Id; } + get { return AssignmentSchoolReferenceData?.Id; } + set { } + } + + [Key(19)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ResponsibilitySchoolReferenceData { get; set; } + + /// + /// Read-only property that allows the ResponsibilitySchool resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineAction.ResponsibilitySchoolResourceId + { + get { return ResponsibilitySchoolReferenceData?.Id; } + set { } + } + + [Key(20)] + public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } + + /// + /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IDisciplineAction.StudentDiscriminator + { + get { return StudentReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineAction.StudentResourceId + { + get { return StudentReferenceData?.Id; } set { } } @@ -37754,9 +45934,11 @@ public IDictionary Extensions // Collections // ------------------------------------------------------------- - private ICollection _disciplineIncidentBehaviors; - private ICollection _disciplineIncidentBehaviorsCovariant; - public virtual ICollection DisciplineIncidentBehaviors + private ICollection _disciplineActionDisciplines; + private ICollection _disciplineActionDisciplinesCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection DisciplineActionDisciplines { get { @@ -37765,45 +45947,52 @@ public virtual ICollection set) + { + set.Reattach(this, "DisciplineActionDisciplines"); + } + + foreach (var item in _disciplineActionDisciplines) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentBehaviors; + return _disciplineActionDisciplines; } set { - _disciplineIncidentBehaviors = value; - _disciplineIncidentBehaviorsCovariant = new CovariantCollectionAdapter(value); + _disciplineActionDisciplines = value; + _disciplineActionDisciplinesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentBehaviors + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionDisciplines { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineIncidentBehaviors) - if (item.DisciplineIncident == null) - item.DisciplineIncident = this; + foreach (var item in _disciplineActionDisciplines) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentBehaviorsCovariant; + return _disciplineActionDisciplinesCovariant; } set { - DisciplineIncidentBehaviors = new HashSet(value.Cast()); + DisciplineActionDisciplines = new HashSet(value.Cast()); } } - private ICollection _disciplineIncidentExternalParticipants; - private ICollection _disciplineIncidentExternalParticipantsCovariant; - public virtual ICollection DisciplineIncidentExternalParticipants + private ICollection _disciplineActionStaffs; + private ICollection _disciplineActionStaffsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection DisciplineActionStaffs { get { @@ -37812,45 +46001,52 @@ public virtual ICollection set) + { + set.Reattach(this, "DisciplineActionStaffs"); + } + + foreach (var item in _disciplineActionStaffs) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentExternalParticipants; + return _disciplineActionStaffs; } set { - _disciplineIncidentExternalParticipants = value; - _disciplineIncidentExternalParticipantsCovariant = new CovariantCollectionAdapter(value); + _disciplineActionStaffs = value; + _disciplineActionStaffsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentExternalParticipants + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStaffs { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineIncidentExternalParticipants) - if (item.DisciplineIncident == null) - item.DisciplineIncident = this; + foreach (var item in _disciplineActionStaffs) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentExternalParticipantsCovariant; + return _disciplineActionStaffsCovariant; } set { - DisciplineIncidentExternalParticipants = new HashSet(value.Cast()); + DisciplineActionStaffs = new HashSet(value.Cast()); } } - private ICollection _disciplineIncidentWeapons; - private ICollection _disciplineIncidentWeaponsCovariant; - public virtual ICollection DisciplineIncidentWeapons + private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociations; + private ICollection _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; + [Key(23)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection DisciplineActionStudentDisciplineIncidentBehaviorAssociations { get { @@ -37859,38 +46055,43 @@ public virtual ICollection set) + { + set.Reattach(this, "DisciplineActionStudentDisciplineIncidentBehaviorAssociations"); + } + + foreach (var item in _disciplineActionStudentDisciplineIncidentBehaviorAssociations) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentWeapons; + return _disciplineActionStudentDisciplineIncidentBehaviorAssociations; } set { - _disciplineIncidentWeapons = value; - _disciplineIncidentWeaponsCovariant = new CovariantCollectionAdapter(value); + _disciplineActionStudentDisciplineIncidentBehaviorAssociations = value; + _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentWeapons + ICollection Entities.Common.EdFi.IDisciplineAction.DisciplineActionStudentDisciplineIncidentBehaviorAssociations { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _disciplineIncidentWeapons) - if (item.DisciplineIncident == null) - item.DisciplineIncident = this; + foreach (var item in _disciplineActionStudentDisciplineIncidentBehaviorAssociations) + if (item.DisciplineAction == null) + item.DisciplineAction = this; // ------------------------------------------------------------- - return _disciplineIncidentWeaponsCovariant; + return _disciplineActionStudentDisciplineIncidentBehaviorAssociationsCovariant; } set { - DisciplineIncidentWeapons = new HashSet(value.Cast()); + DisciplineActionStudentDisciplineIncidentBehaviorAssociations = new HashSet(value.Cast()); } } @@ -37899,8 +46100,7 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IncidentLocationDescriptor", new LookupColumnDetails { PropertyName = "IncidentLocationDescriptorId", LookupTypeName = "IncidentLocationDescriptor"} }, - { "ReporterDescriptionDescriptor", new LookupColumnDetails { PropertyName = "ReporterDescriptionDescriptorId", LookupTypeName = "ReporterDescriptionDescriptor"} }, + { "DisciplineActionLengthDifferenceReasonDescriptor", new LookupColumnDetails { PropertyName = "DisciplineActionLengthDifferenceReasonDescriptorId", LookupTypeName = "DisciplineActionLengthDifferenceReasonDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -37915,8 +46115,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("IncidentIdentifier", IncidentIdentifier); - keyValues.Add("SchoolId", SchoolId); + keyValues.Add("DisciplineActionIdentifier", DisciplineActionIdentifier); + keyValues.Add("DisciplineDate", DisciplineDate); + keyValues.Add("StudentUSI", StudentUSI); return keyValues; } @@ -37980,12 +46181,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncident)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineAction)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncident) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineAction) target, null); } } @@ -37993,19 +46194,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncidentBehavior table of the DisciplineIncident aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionDiscipline table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncidentBehavior : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineIncidentBehavior, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisciplineActionDiscipline : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineActionDiscipline, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineIncidentBehavior() + public DisciplineActionDiscipline() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -38013,48 +46215,50 @@ public DisciplineIncidentBehavior() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineIncident DisciplineIncident { get; set; } + [DomainSignature, IgnoreMember] + public virtual DisciplineAction DisciplineAction { get; set; } - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentBehavior.DisciplineIncident + Entities.Common.EdFi.IDisciplineAction IDisciplineActionDiscipline.DisciplineAction { - get { return DisciplineIncident; } - set { DisciplineIncident = (DisciplineIncident) value; } + get { return DisciplineAction; } + set { DisciplineAction = (DisciplineAction) value; } } [DomainSignature] - public virtual int BehaviorDescriptorId + [Key(1)] + public virtual int DisciplineDescriptorId { get { - if (_behaviorDescriptorId == default(int)) - _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); + if (_disciplineDescriptorId == default(int)) + _disciplineDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineDescriptor", _disciplineDescriptor); - return _behaviorDescriptorId; + return _disciplineDescriptorId; } set { - _behaviorDescriptorId = value; - _behaviorDescriptor = null; + _disciplineDescriptorId = value; + _disciplineDescriptor = null; } } - private int _behaviorDescriptorId; - private string _behaviorDescriptor; + private int _disciplineDescriptorId; + private string _disciplineDescriptor; - public virtual string BehaviorDescriptor + [IgnoreMember] + public virtual string DisciplineDescriptor { get { - if (_behaviorDescriptor == null) - _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); + if (_disciplineDescriptor == null) + _disciplineDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineDescriptor", _disciplineDescriptorId); - return _behaviorDescriptor; + return _disciplineDescriptor; } set { - _behaviorDescriptor = value; - _behaviorDescriptorId = default(int); + _disciplineDescriptor = value; + _disciplineDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -38067,7 +46271,6 @@ public virtual string BehaviorDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -38080,14 +46283,27 @@ public virtual string BehaviorDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineActionDiscipline")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -38106,235 +46322,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + private IDictionary _aggregateExtensions; - foreach (DictionaryEntry entry in theseKeys) + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineActionDiscipline")] + [Key(3)] + public IDictionary AggregateExtensions + { + get { - if (entry.Value is string) + foreach (var key in _aggregateExtensions.Keys) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) { - return false; + collection.ReattachAggregateExtension(this, (string) key); } } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentBehavior)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentBehavior) target, null); - } - - void IChildEntity.SetParent(object value) - { - DisciplineIncident = (DisciplineIncident) value; - } - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.DisciplineIncidentExternalParticipant table of the DisciplineIncident aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class DisciplineIncidentExternalParticipant : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineIncidentExternalParticipant, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public DisciplineIncidentExternalParticipant() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineIncident DisciplineIncident { get; set; } - - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentExternalParticipant.DisciplineIncident - { - get { return DisciplineIncident; } - set { DisciplineIncident = (DisciplineIncident) value; } - } - - [DomainSignature] - public virtual int DisciplineIncidentParticipationCodeDescriptorId - { - get - { - if (_disciplineIncidentParticipationCodeDescriptorId == default(int)) - _disciplineIncidentParticipationCodeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptor); - - return _disciplineIncidentParticipationCodeDescriptorId; - } - set - { - _disciplineIncidentParticipationCodeDescriptorId = value; - _disciplineIncidentParticipationCodeDescriptor = null; - } - } - - private int _disciplineIncidentParticipationCodeDescriptorId; - private string _disciplineIncidentParticipationCodeDescriptor; - public virtual string DisciplineIncidentParticipationCodeDescriptor - { - get - { - if (_disciplineIncidentParticipationCodeDescriptor == null) - _disciplineIncidentParticipationCodeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptorId); - - return _disciplineIncidentParticipationCodeDescriptor; + return _aggregateExtensions; } set { - _disciplineIncidentParticipationCodeDescriptor = value; - _disciplineIncidentParticipationCodeDescriptorId = default(int); - } - } - [DomainSignature] - public virtual string FirstName { get; set; } - [DomainSignature] - public virtual string LastSurname { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor + // If the _aggregateExtensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_aggregateExtensions != null && value != null) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) + foreach (var key in _aggregateExtensions.Keys) { if (!value.Contains(key)) { - value[key] = _extensions[key]; + value[key] = _aggregateExtensions[key]; } } } - _extensions = value; + _aggregateExtensions = value; } } - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -38350,7 +46378,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "DisciplineIncidentParticipationCodeDescriptor", new LookupColumnDetails { PropertyName = "DisciplineIncidentParticipationCodeDescriptorId", LookupTypeName = "DisciplineIncidentParticipationCodeDescriptor"} }, + { "DisciplineDescriptor", new LookupColumnDetails { PropertyName = "DisciplineDescriptorId", LookupTypeName = "DisciplineDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -38362,12 +46390,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineAction as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); - keyValues.Add("FirstName", FirstName); - keyValues.Add("LastSurname", LastSurname); + keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); return keyValues; } @@ -38431,36 +46457,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionDiscipline)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionDiscipline) target, null); } void IChildEntity.SetParent(object value) { - DisciplineIncident = (DisciplineIncident) value; + DisciplineAction = (DisciplineAction) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisciplineIncidentWeapon table of the DisciplineIncident aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionStaff table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisciplineIncidentWeapon : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IDisciplineIncidentWeapon, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisciplineActionStaff : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineActionStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public DisciplineIncidentWeapon() + public DisciplineActionStaff() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -38468,48 +46495,64 @@ public DisciplineIncidentWeapon() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual DisciplineIncident DisciplineIncident { get; set; } + [DomainSignature, IgnoreMember] + public virtual DisciplineAction DisciplineAction { get; set; } - Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentWeapon.DisciplineIncident + Entities.Common.EdFi.IDisciplineAction IDisciplineActionStaff.DisciplineAction { - get { return DisciplineIncident; } - set { DisciplineIncident = (DisciplineIncident) value; } + get { return DisciplineAction; } + set { DisciplineAction = (DisciplineAction) value; } } - [DomainSignature] - public virtual int WeaponDescriptorId + [Display(Name="StaffUniqueId")][DomainSignature] + [Key(1)] + public virtual int StaffUSI { get { - if (_weaponDescriptorId == default(int)) - _weaponDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("WeaponDescriptor", _weaponDescriptor); + if (_staffUSI == default(int) && _staffUniqueId != null) + { + if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Staff", out var usiByUniqueId) + && usiByUniqueId.TryGetValue(_staffUniqueId, out var usi)) + { + _staffUSI = usi; + } + } - return _weaponDescriptorId; + return _staffUSI; } set { - _weaponDescriptorId = value; - _weaponDescriptor = null; + _staffUSI = value; + GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Staff", value); } } - private int _weaponDescriptorId; - private string _weaponDescriptor; + private int _staffUSI; + private string _staffUniqueId; - public virtual string WeaponDescriptor + [IgnoreMember] + public virtual string StaffUniqueId { get { - if (_weaponDescriptor == null) - _weaponDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("WeaponDescriptor", _weaponDescriptorId); - - return _weaponDescriptor; + if (_staffUniqueId == null) + { + if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Staff", out var uniqueIdByUsi) + && uniqueIdByUsi.TryGetValue(_staffUSI, out var uniqueId)) + { + _staffUniqueId = uniqueId; + } + } + + return _staffUniqueId; } set { - _weaponDescriptor = value; - _weaponDescriptorId = default(int); + if (_staffUniqueId != value) + _staffUSI = default(int); + + _staffUniqueId = value; } } // ------------------------------------------------------------- @@ -38534,14 +46577,27 @@ public virtual string WeaponDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineActionStaff")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -38560,196 +46616,73 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "WeaponDescriptor", new LookupColumnDetails { PropertyName = "WeaponDescriptorId", LookupTypeName = "WeaponDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Get parent key values - var keyValues = (DisciplineIncident as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - // Add current key values - keyValues.Add("WeaponDescriptorId", WeaponDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + private IDictionary _aggregateExtensions; - foreach (DictionaryEntry entry in theseKeys) + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineActionStaff")] + [Key(3)] + public IDictionary AggregateExtensions + { + get { - if (entry.Value is string) + foreach (var key in _aggregateExtensions.Keys) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) { - return false; + collection.ReattachAggregateExtension(this, (string) key); } } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - foreach (DictionaryEntry entry in keyValues) + return _aggregateExtensions; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) { - hashCode.Add(entry.Value); + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentWeapon)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentWeapon) target, null); - } - void IChildEntity.SetParent(object value) - { - DisciplineIncident = (DisciplineIncident) value; + _aggregateExtensions = value; + } } - } -} -// Aggregate: DisciplineIncidentParticipationCodeDescriptor - -namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentParticipationCodeDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.DisciplineIncidentParticipationCodeDescriptor table of the DisciplineIncidentParticipationCodeDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class DisciplineIncidentParticipationCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int DisciplineIncidentParticipationCodeDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - // ------------------------------------------------------------- // ============================================================= - // Inherited Properties + // Reference Data // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace + [Key(4)] + public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } + + /// + /// Read-only property that allows the Staff discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IDisciplineActionStaff.StaffDiscriminator { - get { return Namespace; } - set { Namespace = value; } + get { return StaffReferenceData?.Discriminator; } + set { } } - string IDescriptor.ShortDescription + + /// + /// Read-only property that allows the Staff resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineActionStaff.StaffResourceId { - get { return ShortDescription; } - set { ShortDescription = value; } + get { return StaffReferenceData?.Id; } + set { } } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Reference Data - // ------------------------------------------------------------- // ------------------------------------------------------------- //============================================================= @@ -38770,11 +46703,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (DisciplineAction as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); + keyValues.Add("StaffUSI", StaffUSI); return keyValues; } @@ -38838,256 +46771,101 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStaff)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionStaff) target, null); } + void IChildEntity.SetParent(object value) + { + DisciplineAction = (DisciplineAction) value; + } } -} -// Aggregate: DisplacedStudentStatusDescriptor - -namespace EdFi.Ods.Entities.NHibernate.DisplacedStudentStatusDescriptorAggregate.EdFi -{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DisplacedStudentStatusDescriptor table of the DisplacedStudentStatusDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionStudentDisciplineIncidentBehaviorAssociation table of the DisciplineAction aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DisplacedStudentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDisplacedStudentStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class DisciplineActionStudentDisciplineIncidentBehaviorAssociation : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { + public virtual void SuspendReferenceAssignmentCheck() { } - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int DisplacedStudentStatusDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + public DisciplineActionStudentDisciplineIncidentBehaviorAssociation() { - get { return ShortDescription; } - set { ShortDescription = value; } + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + // Primary Key // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual DisciplineAction DisciplineAction { get; set; } - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() + Entities.Common.EdFi.IDisciplineAction IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.DisciplineAction { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("DisplacedStudentStatusDescriptorId", DisplacedStudentStatusDescriptorId); - - return keyValues; + get { return DisciplineAction; } + set { DisciplineAction = (DisciplineAction) value; } } - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) + [DomainSignature] + [Key(1)] + public virtual int BehaviorDescriptorId { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) + get { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); + if (_behaviorDescriptorId == default(int)) + _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); - foreach (DictionaryEntry entry in keyValues) + return _behaviorDescriptorId; + } + set { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + _behaviorDescriptorId = value; + _behaviorDescriptor = null; } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor) target, null); } - } -} -// Aggregate: DualCreditInstitutionDescriptor - -namespace EdFi.Ods.Entities.NHibernate.DualCreditInstitutionDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.DualCreditInstitutionDescriptor table of the DualCreditInstitutionDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class DualCreditInstitutionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDualCreditInstitutionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int DualCreditInstitutionDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- + private int _behaviorDescriptorId; + private string _behaviorDescriptor; - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription + [IgnoreMember] + public virtual string BehaviorDescriptor { - get { return ShortDescription; } - set { ShortDescription = value; } + get + { + if (_behaviorDescriptor == null) + _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); + + return _behaviorDescriptor; + } + set + { + _behaviorDescriptor = value; + _behaviorDescriptorId = default(int); + } } + [DomainSignature] + [Key(2)] + public virtual string IncidentIdentifier { get; set; } + [DomainSignature] + [Key(3)] + public virtual long SchoolId { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= @@ -39103,11 +46881,114 @@ string IDescriptor.ShortDescription // ============================================================= // Extensions // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineActionStudentDisciplineIncidentBehaviorAssociation")] + [Key(4)] + public IDictionary Extensions + { + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } + set + { + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; + } + } + + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineAction", "DisciplineActionStudentDisciplineIncidentBehaviorAssociation")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] + public virtual NHibernate.StudentDisciplineIncidentBehaviorAssociationAggregate.EdFi.StudentDisciplineIncidentBehaviorAssociationReferenceData StudentDisciplineIncidentBehaviorAssociationReferenceData { get; set; } + + /// + /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationDiscriminator + { + get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Discriminator; } + set { } + } + + /// + /// Read-only property that allows the StudentDisciplineIncidentBehaviorAssociation resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation.StudentDisciplineIncidentBehaviorAssociationResourceId + { + get { return StudentDisciplineIncidentBehaviorAssociationReferenceData?.Id; } + set { } + } + // ------------------------------------------------------------- //============================================================= @@ -39118,6 +46999,7 @@ string IDescriptor.ShortDescription // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { + { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -39128,11 +47010,13 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (DisciplineAction as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("DualCreditInstitutionDescriptorId", DualCreditInstitutionDescriptorId); + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); return keyValues; } @@ -39196,37 +47080,43 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDualCreditInstitutionDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDualCreditInstitutionDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionStudentDisciplineIncidentBehaviorAssociation) target, null); } + void IChildEntity.SetParent(object value) + { + DisciplineAction = (DisciplineAction) value; + } } } -// Aggregate: DualCreditTypeDescriptor +// Aggregate: DisciplineActionLengthDifferenceReasonDescriptor -namespace EdFi.Ods.Entities.NHibernate.DualCreditTypeDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisciplineActionLengthDifferenceReasonDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.DualCreditTypeDescriptor table of the DualCreditTypeDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisciplineActionLengthDifferenceReasonDescriptor table of the DisciplineActionLengthDifferenceReasonDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class DualCreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IDualCreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class DisciplineActionLengthDifferenceReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int DualCreditTypeDescriptorId + [IgnoreMember] + public virtual int DisciplineActionLengthDifferenceReasonDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -39311,7 +47201,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DualCreditTypeDescriptorId", DualCreditTypeDescriptorId); + keyValues.Add("DisciplineActionLengthDifferenceReasonDescriptorId", DisciplineActionLengthDifferenceReasonDescriptorId); return keyValues; } @@ -39375,37 +47265,39 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IDualCreditTypeDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IDualCreditTypeDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineActionLengthDifferenceReasonDescriptor) target, null); } } } -// Aggregate: EducationalEnvironmentDescriptor +// Aggregate: DisciplineDescriptor -namespace EdFi.Ods.Entities.NHibernate.EducationalEnvironmentDescriptorAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisciplineDescriptorAggregate.EdFi { // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationalEnvironmentDescriptor table of the EducationalEnvironmentDescriptor aggregate in the ODS database. + /// A class which represents the edfi.DisciplineDescriptor table of the DisciplineDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationalEnvironmentDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IEducationalEnvironmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor + [MessagePackObject] + public class DisciplineDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisciplineDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { // ============================================================= // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual int EducationalEnvironmentDescriptorId + [IgnoreMember] + public virtual int DisciplineDescriptorId { get { return base.DescriptorId; } set { base.DescriptorId = value; } @@ -39490,7 +47382,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationalEnvironmentDescriptorId", EducationalEnvironmentDescriptorId); + keyValues.Add("DisciplineDescriptorId", DisciplineDescriptorId); return keyValues; } @@ -39554,40 +47446,46 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineDescriptor) target, null); } } } -// Aggregate: EducationContent +// Aggregate: DisciplineIncident -namespace EdFi.Ods.Entities.NHibernate.EducationContentAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class EducationContentReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class DisciplineIncidentReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual string ContentIdentifier { get; set; } + [Key(0)] + public virtual string IncidentIdentifier { get; set; } + [Key(1)] + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -39597,7 +47495,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ContentIdentifier", ContentIdentifier); + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); return keyValues; } @@ -39648,26 +47547,23 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContent table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncident table of the DisciplineIncident aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContent : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisciplineIncident : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IDisciplineIncident, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationContent() + public DisciplineIncident() { - EducationContentAppropriateGradeLevels = new HashSet(); - EducationContentAppropriateSexes = new HashSet(); - EducationContentAuthors = new HashSet(); - EducationContentDerivativeSourceEducationContents = new HashSet(); - EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(); - EducationContentDerivativeSourceURIs = new HashSet(); - EducationContentLanguages = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + DisciplineIncidentBehaviors = new HashSet(); + DisciplineIncidentExternalParticipants = new HashSet(); + DisciplineIncidentWeapons = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -39676,7 +47572,11 @@ public EducationContent() // Primary Key // ------------------------------------------------------------- [DomainSignature] - public virtual string ContentIdentifier { get; set; } + [Key(6)] + public virtual string IncidentIdentifier { get; set; } + [DomainSignature] + [Key(7)] + public virtual long SchoolId { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39687,139 +47587,100 @@ public EducationContent() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual bool? AdditionalAuthorsIndicator { get; set; } - public virtual int? ContentClassDescriptorId + [Key(8)] + public virtual string CaseNumber { get; set; } + [Key(9)] + public virtual decimal? IncidentCost { get; set; } + [Key(10)] + public virtual DateTime IncidentDate { - get - { - if (_contentClassDescriptorId == default(int?)) - _contentClassDescriptorId = string.IsNullOrWhiteSpace(_contentClassDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ContentClassDescriptor", _contentClassDescriptor); - - return _contentClassDescriptorId; - } - set - { - _contentClassDescriptorId = value; - _contentClassDescriptor = null; - } + get { return _incidentDate; } + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + set { _incidentDate = new DateTime(value.Year, value.Month, value.Day); } } - private int? _contentClassDescriptorId; - private string _contentClassDescriptor; - - public virtual string ContentClassDescriptor - { - get - { - if (_contentClassDescriptor == null) - _contentClassDescriptor = _contentClassDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ContentClassDescriptor", _contentClassDescriptorId.Value); - - return _contentClassDescriptor; - } - set - { - _contentClassDescriptor = value; - _contentClassDescriptorId = default(int?); - } - } - public virtual decimal? Cost { get; set; } - public virtual int? CostRateDescriptorId + private DateTime _incidentDate; + + [Key(11)] + public virtual string IncidentDescription { get; set; } + [Key(12)] + public virtual int? IncidentLocationDescriptorId { get { - if (_costRateDescriptorId == default(int?)) - _costRateDescriptorId = string.IsNullOrWhiteSpace(_costRateDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CostRateDescriptor", _costRateDescriptor); + if (_incidentLocationDescriptorId == default(int?)) + _incidentLocationDescriptorId = string.IsNullOrWhiteSpace(_incidentLocationDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IncidentLocationDescriptor", _incidentLocationDescriptor); - return _costRateDescriptorId; + return _incidentLocationDescriptorId; } set { - _costRateDescriptorId = value; - _costRateDescriptor = null; + _incidentLocationDescriptorId = value; + _incidentLocationDescriptor = null; } } - private int? _costRateDescriptorId; - private string _costRateDescriptor; + private int? _incidentLocationDescriptorId; + private string _incidentLocationDescriptor; - public virtual string CostRateDescriptor + [IgnoreMember] + public virtual string IncidentLocationDescriptor { get { - if (_costRateDescriptor == null) - _costRateDescriptor = _costRateDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CostRateDescriptor", _costRateDescriptorId.Value); + if (_incidentLocationDescriptor == null) + _incidentLocationDescriptor = _incidentLocationDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IncidentLocationDescriptor", _incidentLocationDescriptorId.Value); - return _costRateDescriptor; + return _incidentLocationDescriptor; } set { - _costRateDescriptor = value; - _costRateDescriptorId = default(int?); + _incidentLocationDescriptor = value; + _incidentLocationDescriptorId = default(int?); } } - public virtual string Description { get; set; } - public virtual int? InteractivityStyleDescriptorId + [Key(13)] + public virtual TimeSpan? IncidentTime { get; set; } + [Key(14)] + public virtual bool? ReportedToLawEnforcement { get; set; } + [Key(15)] + public virtual int? ReporterDescriptionDescriptorId { get { - if (_interactivityStyleDescriptorId == default(int?)) - _interactivityStyleDescriptorId = string.IsNullOrWhiteSpace(_interactivityStyleDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InteractivityStyleDescriptor", _interactivityStyleDescriptor); + if (_reporterDescriptionDescriptorId == default(int?)) + _reporterDescriptionDescriptorId = string.IsNullOrWhiteSpace(_reporterDescriptionDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReporterDescriptionDescriptor", _reporterDescriptionDescriptor); - return _interactivityStyleDescriptorId; + return _reporterDescriptionDescriptorId; } set { - _interactivityStyleDescriptorId = value; - _interactivityStyleDescriptor = null; + _reporterDescriptionDescriptorId = value; + _reporterDescriptionDescriptor = null; } } - private int? _interactivityStyleDescriptorId; - private string _interactivityStyleDescriptor; + private int? _reporterDescriptionDescriptorId; + private string _reporterDescriptionDescriptor; - public virtual string InteractivityStyleDescriptor + [IgnoreMember] + public virtual string ReporterDescriptionDescriptor { get { - if (_interactivityStyleDescriptor == null) - _interactivityStyleDescriptor = _interactivityStyleDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InteractivityStyleDescriptor", _interactivityStyleDescriptorId.Value); + if (_reporterDescriptionDescriptor == null) + _reporterDescriptionDescriptor = _reporterDescriptionDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReporterDescriptionDescriptor", _reporterDescriptionDescriptorId.Value); - return _interactivityStyleDescriptor; + return _reporterDescriptionDescriptor; } set { - _interactivityStyleDescriptor = value; - _interactivityStyleDescriptorId = default(int?); - } - } - public virtual string LearningResourceMetadataURI { get; set; } - public virtual string LearningStandardId { get; set; } - public virtual string Namespace { get; set; } - public virtual DateTime? PublicationDate - { - get { return _publicationDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _publicationDate = null; - } else - { - var given = (DateTime) value; - _publicationDate = new DateTime(given.Year, given.Month, given.Day); - } + _reporterDescriptionDescriptor = value; + _reporterDescriptionDescriptorId = default(int?); } } - - private DateTime? _publicationDate; - - public virtual short? PublicationYear { get; set; } - public virtual string Publisher { get; set; } - public virtual string ShortDescription { get; set; } - public virtual string TimeRequired { get; set; } - public virtual string UseRightsURL { get; set; } - public virtual string Version { get; set; } + [Key(16)] + public virtual string ReporterName { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -39832,14 +47693,27 @@ public virtual DateTime? PublicationDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncident")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -39858,29 +47732,61 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncident")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } - - /// - /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator - { - get { return LearningStandardReferenceData?.Discriminator; } - set { } - } + [Key(19)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// - /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. /// - Guid? Entities.Common.EdFi.IEducationContent.LearningStandardResourceId + Guid? Entities.Common.EdFi.IDisciplineIncident.SchoolResourceId { - get { return LearningStandardReferenceData?.Id; } + get { return SchoolReferenceData?.Id; } set { } } @@ -39890,9 +47796,11 @@ string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator // Collections // ------------------------------------------------------------- - private ICollection _educationContentAppropriateGradeLevels; - private ICollection _educationContentAppropriateGradeLevelsCovariant; - public virtual ICollection EducationContentAppropriateGradeLevels + private ICollection _disciplineIncidentBehaviors; + private ICollection _disciplineIncidentBehaviorsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection DisciplineIncidentBehaviors { get { @@ -39901,45 +47809,52 @@ public virtual ICollection set) + { + set.Reattach(this, "DisciplineIncidentBehaviors"); + } + + foreach (var item in _disciplineIncidentBehaviors) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentAppropriateGradeLevels; + return _disciplineIncidentBehaviors; } set { - _educationContentAppropriateGradeLevels = value; - _educationContentAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); + _disciplineIncidentBehaviors = value; + _disciplineIncidentBehaviorsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateGradeLevels + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentBehaviors { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationContentAppropriateGradeLevels) - if (item.EducationContent == null) - item.EducationContent = this; + foreach (var item in _disciplineIncidentBehaviors) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentAppropriateGradeLevelsCovariant; + return _disciplineIncidentBehaviorsCovariant; } set { - EducationContentAppropriateGradeLevels = new HashSet(value.Cast()); + DisciplineIncidentBehaviors = new HashSet(value.Cast()); } } - private ICollection _educationContentAppropriateSexes; - private ICollection _educationContentAppropriateSexesCovariant; - public virtual ICollection EducationContentAppropriateSexes + private ICollection _disciplineIncidentExternalParticipants; + private ICollection _disciplineIncidentExternalParticipantsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection DisciplineIncidentExternalParticipants { get { @@ -39948,45 +47863,52 @@ public virtual ICollection set) + { + set.Reattach(this, "DisciplineIncidentExternalParticipants"); + } + + foreach (var item in _disciplineIncidentExternalParticipants) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentAppropriateSexes; + return _disciplineIncidentExternalParticipants; } set { - _educationContentAppropriateSexes = value; - _educationContentAppropriateSexesCovariant = new CovariantCollectionAdapter(value); + _disciplineIncidentExternalParticipants = value; + _disciplineIncidentExternalParticipantsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateSexes + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentExternalParticipants { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationContentAppropriateSexes) - if (item.EducationContent == null) - item.EducationContent = this; + foreach (var item in _disciplineIncidentExternalParticipants) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentAppropriateSexesCovariant; + return _disciplineIncidentExternalParticipantsCovariant; } set { - EducationContentAppropriateSexes = new HashSet(value.Cast()); + DisciplineIncidentExternalParticipants = new HashSet(value.Cast()); } } - private ICollection _educationContentAuthors; - private ICollection _educationContentAuthorsCovariant; - public virtual ICollection EducationContentAuthors + private ICollection _disciplineIncidentWeapons; + private ICollection _disciplineIncidentWeaponsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection DisciplineIncidentWeapons { get { @@ -39995,237 +47917,332 @@ public virtual ICollection set) + { + set.Reattach(this, "DisciplineIncidentWeapons"); + } + + foreach (var item in _disciplineIncidentWeapons) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentAuthors; + return _disciplineIncidentWeapons; } set { - _educationContentAuthors = value; - _educationContentAuthorsCovariant = new CovariantCollectionAdapter(value); + _disciplineIncidentWeapons = value; + _disciplineIncidentWeaponsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentAuthors + ICollection Entities.Common.EdFi.IDisciplineIncident.DisciplineIncidentWeapons { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationContentAuthors) - if (item.EducationContent == null) - item.EducationContent = this; + foreach (var item in _disciplineIncidentWeapons) + if (item.DisciplineIncident == null) + item.DisciplineIncident = this; // ------------------------------------------------------------- - return _educationContentAuthorsCovariant; + return _disciplineIncidentWeaponsCovariant; } set { - EducationContentAuthors = new HashSet(value.Cast()); + DisciplineIncidentWeapons = new HashSet(value.Cast()); } } + // ------------------------------------------------------------- - private ICollection _educationContentDerivativeSourceEducationContents; - private ICollection _educationContentDerivativeSourceEducationContentsCovariant; - public virtual ICollection EducationContentDerivativeSourceEducationContents - { - get + // Provide lookup property map + private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceEducationContents) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- + { "IncidentLocationDescriptor", new LookupColumnDetails { PropertyName = "IncidentLocationDescriptorId", LookupTypeName = "IncidentLocationDescriptor"} }, + { "ReporterDescriptionDescriptor", new LookupColumnDetails { PropertyName = "ReporterDescriptionDescriptorId", LookupTypeName = "ReporterDescriptionDescriptor"} }, + }; - return _educationContentDerivativeSourceEducationContents; - } - set - { - _educationContentDerivativeSourceEducationContents = value; - _educationContentDerivativeSourceEducationContentsCovariant = new CovariantCollectionAdapter(value); - } + Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty + { + get { return _idPropertyByLookupProperty; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceEducationContents + // Provide primary key information + OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceEducationContents) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); - return _educationContentDerivativeSourceEducationContentsCovariant; - } - set - { - EducationContentDerivativeSourceEducationContents = new HashSet(value.Cast()); - } - } + // Add current key values + keyValues.Add("IncidentIdentifier", IncidentIdentifier); + keyValues.Add("SchoolId", SchoolId); + return keyValues; + } - private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIs; - private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; - public virtual ICollection EducationContentDerivativeSourceLearningResourceMetadataURIs + #region Overrides for Equals() and GetHashCode() + public override bool Equals(object obj) { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- + var compareTo = obj as IHasPrimaryKeyValues; - return _educationContentDerivativeSourceLearningResourceMetadataURIs; - } - set + if (ReferenceEquals(this, compareTo)) + return true; + + if (compareTo == null) + return false; + + var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var thoseKeys = compareTo.GetPrimaryKeyValues(); + + foreach (DictionaryEntry entry in theseKeys) { - _educationContentDerivativeSourceLearningResourceMetadataURIs = value; - _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); + if (entry.Value is string) + { + if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + { + return false; + } + } + else + { + if (!entry.Value.Equals(thoseKeys[entry.Key])) + return false; + } } + + return true; } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceLearningResourceMetadataURIs + public override int GetHashCode() { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- + var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - return _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; - } - set + if (keyValues.Count == 0) + return base.GetHashCode(); + + var hashCode = new HashCode(); + + foreach (DictionaryEntry entry in keyValues) { - EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(value.Cast()); + if (entry.Value is string) + { + hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); + } + else + { + hashCode.Add(entry.Value); + } } + + return hashCode.ToHashCode(); + } + #endregion + bool ISynchronizable.Synchronize(object target) + { + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncident)target); } + void IMappable.Map(object target) + { + this.MapTo((Entities.Common.EdFi.IDisciplineIncident) target, null); + } - private ICollection _educationContentDerivativeSourceURIs; - private ICollection _educationContentDerivativeSourceURIsCovariant; - public virtual ICollection EducationContentDerivativeSourceURIs + } +// disable warnings for inheritance from classes marked Obsolete within this generated code only +#pragma warning disable 612, 618 + + /// + /// A class which represents the edfi.DisciplineIncidentBehavior table of the DisciplineIncident aggregate in the ODS database. + /// + [Schema("edfi")] + [ExcludeFromCodeCoverage] + [MessagePackObject] + public class DisciplineIncidentBehavior : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineIncidentBehavior, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + { + public virtual void SuspendReferenceAssignmentCheck() { } + + public DisciplineIncidentBehavior() + { + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); + } +// restore warnings for inheritance from classes marked Obsolete +#pragma warning restore 612, 618 + + // ============================================================= + // Primary Key + // ------------------------------------------------------------- + [DomainSignature, IgnoreMember] + public virtual DisciplineIncident DisciplineIncident { get; set; } + + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentBehavior.DisciplineIncident + { + get { return DisciplineIncident; } + set { DisciplineIncident = (DisciplineIncident) value; } + } + + [DomainSignature] + [Key(1)] + public virtual int BehaviorDescriptorId { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceURIs) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- + if (_behaviorDescriptorId == default(int)) + _behaviorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("BehaviorDescriptor", _behaviorDescriptor); - return _educationContentDerivativeSourceURIs; - } + return _behaviorDescriptorId; + } set { - _educationContentDerivativeSourceURIs = value; - _educationContentDerivativeSourceURIsCovariant = new CovariantCollectionAdapter(value); + _behaviorDescriptorId = value; + _behaviorDescriptor = null; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceURIs + private int _behaviorDescriptorId; + private string _behaviorDescriptor; + + [IgnoreMember] + public virtual string BehaviorDescriptor { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentDerivativeSourceURIs) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- - - return _educationContentDerivativeSourceURIsCovariant; + if (_behaviorDescriptor == null) + _behaviorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("BehaviorDescriptor", _behaviorDescriptorId); + + return _behaviorDescriptor; } set { - EducationContentDerivativeSourceURIs = new HashSet(value.Cast()); + _behaviorDescriptor = value; + _behaviorDescriptorId = default(int); } } + // ------------------------------------------------------------- + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - private ICollection _educationContentLanguages; - private ICollection _educationContentLanguagesCovariant; - public virtual ICollection EducationContentLanguages + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(2)] + public virtual string BehaviorDetailedDescription { get; set; } + // ------------------------------------------------------------- + + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncidentBehavior")] + [Key(3)] + public IDictionary Extensions { - get + get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentLanguages) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } - return _educationContentLanguages; + return _extensions; } set { - _educationContentLanguages = value; - _educationContentLanguagesCovariant = new CovariantCollectionAdapter(value); + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationContent.EducationContentLanguages - { + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncidentBehavior")] + [Key(4)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationContentLanguages) - if (item.EducationContent == null) - item.EducationContent = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _educationContentLanguagesCovariant; + return _aggregateExtensions; } set { - EducationContentLanguages = new HashSet(value.Cast()); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } // ------------------------------------------------------------- + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + // ------------------------------------------------------------- + + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ContentClassDescriptor", new LookupColumnDetails { PropertyName = "ContentClassDescriptorId", LookupTypeName = "ContentClassDescriptor"} }, - { "CostRateDescriptor", new LookupColumnDetails { PropertyName = "CostRateDescriptorId", LookupTypeName = "CostRateDescriptor"} }, - { "InteractivityStyleDescriptor", new LookupColumnDetails { PropertyName = "InteractivityStyleDescriptorId", LookupTypeName = "InteractivityStyleDescriptor"} }, + { "BehaviorDescriptor", new LookupColumnDetails { PropertyName = "BehaviorDescriptorId", LookupTypeName = "BehaviorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -40236,11 +48253,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); + // Get parent key values + var keyValues = (DisciplineIncident as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("ContentIdentifier", ContentIdentifier); + keyValues.Add("BehaviorDescriptorId", BehaviorDescriptorId); return keyValues; } @@ -40304,32 +48321,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentBehavior)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContent) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentBehavior) target, null); } + void IChildEntity.SetParent(object value) + { + DisciplineIncident = (DisciplineIncident) value; + } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentAppropriateGradeLevel table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncidentExternalParticipant table of the DisciplineIncident aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisciplineIncidentExternalParticipant : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineIncidentExternalParticipant, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationContentAppropriateGradeLevel() + public DisciplineIncidentExternalParticipant() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -40337,50 +48359,58 @@ public EducationContentAppropriateGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } + [DomainSignature, IgnoreMember] + public virtual DisciplineIncident DisciplineIncident { get; set; } - Entities.Common.EdFi.IEducationContent IEducationContentAppropriateGradeLevel.EducationContent + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentExternalParticipant.DisciplineIncident { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return DisciplineIncident; } + set { DisciplineIncident = (DisciplineIncident) value; } } [DomainSignature] - public virtual int GradeLevelDescriptorId + [Key(1)] + public virtual int DisciplineIncidentParticipationCodeDescriptorId { get { - if (_gradeLevelDescriptorId == default(int)) - _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + if (_disciplineIncidentParticipationCodeDescriptorId == default(int)) + _disciplineIncidentParticipationCodeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptor); - return _gradeLevelDescriptorId; + return _disciplineIncidentParticipationCodeDescriptorId; } set { - _gradeLevelDescriptorId = value; - _gradeLevelDescriptor = null; + _disciplineIncidentParticipationCodeDescriptorId = value; + _disciplineIncidentParticipationCodeDescriptor = null; } } - private int _gradeLevelDescriptorId; - private string _gradeLevelDescriptor; + private int _disciplineIncidentParticipationCodeDescriptorId; + private string _disciplineIncidentParticipationCodeDescriptor; - public virtual string GradeLevelDescriptor + [IgnoreMember] + public virtual string DisciplineIncidentParticipationCodeDescriptor { get { - if (_gradeLevelDescriptor == null) - _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + if (_disciplineIncidentParticipationCodeDescriptor == null) + _disciplineIncidentParticipationCodeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("DisciplineIncidentParticipationCodeDescriptor", _disciplineIncidentParticipationCodeDescriptorId); - return _gradeLevelDescriptor; + return _disciplineIncidentParticipationCodeDescriptor; } set { - _gradeLevelDescriptor = value; - _gradeLevelDescriptorId = default(int); + _disciplineIncidentParticipationCodeDescriptor = value; + _disciplineIncidentParticipationCodeDescriptorId = default(int); } } + [DomainSignature] + [Key(2)] + public virtual string FirstName { get; set; } + [DomainSignature] + [Key(3)] + public virtual string LastSurname { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40403,14 +48433,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncidentExternalParticipant")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -40429,7 +48472,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncidentExternalParticipant")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -40445,7 +48528,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, + { "DisciplineIncidentParticipationCodeDescriptor", new LookupColumnDetails { PropertyName = "DisciplineIncidentParticipationCodeDescriptorId", LookupTypeName = "DisciplineIncidentParticipationCodeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -40457,10 +48540,12 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineIncident as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); + keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); + keyValues.Add("FirstName", FirstName); + keyValues.Add("LastSurname", LastSurname); return keyValues; } @@ -40524,36 +48609,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentExternalParticipant) target, null); } void IChildEntity.SetParent(object value) { - EducationContent = (EducationContent) value; + DisciplineIncident = (DisciplineIncident) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentAppropriateSex table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncidentWeapon table of the DisciplineIncident aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentAppropriateSex : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisciplineIncidentWeapon : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IDisciplineIncidentWeapon, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationContentAppropriateSex() + public DisciplineIncidentWeapon() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -40561,48 +48647,50 @@ public EducationContentAppropriateSex() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } + [DomainSignature, IgnoreMember] + public virtual DisciplineIncident DisciplineIncident { get; set; } - Entities.Common.EdFi.IEducationContent IEducationContentAppropriateSex.EducationContent + Entities.Common.EdFi.IDisciplineIncident IDisciplineIncidentWeapon.DisciplineIncident { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return DisciplineIncident; } + set { DisciplineIncident = (DisciplineIncident) value; } } [DomainSignature] - public virtual int SexDescriptorId + [Key(1)] + public virtual int WeaponDescriptorId { get { - if (_sexDescriptorId == default(int)) - _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); + if (_weaponDescriptorId == default(int)) + _weaponDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("WeaponDescriptor", _weaponDescriptor); - return _sexDescriptorId; + return _weaponDescriptorId; } set { - _sexDescriptorId = value; - _sexDescriptor = null; + _weaponDescriptorId = value; + _weaponDescriptor = null; } } - private int _sexDescriptorId; - private string _sexDescriptor; + private int _weaponDescriptorId; + private string _weaponDescriptor; - public virtual string SexDescriptor + [IgnoreMember] + public virtual string WeaponDescriptor { get { - if (_sexDescriptor == null) - _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); + if (_weaponDescriptor == null) + _weaponDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("WeaponDescriptor", _weaponDescriptorId); - return _sexDescriptor; + return _weaponDescriptor; } set { - _sexDescriptor = value; - _sexDescriptorId = default(int); + _weaponDescriptor = value; + _weaponDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -40627,14 +48715,27 @@ public virtual string SexDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncidentWeapon")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -40653,7 +48754,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "DisciplineIncident", "DisciplineIncidentWeapon")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -40669,7 +48810,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, + { "WeaponDescriptor", new LookupColumnDetails { PropertyName = "WeaponDescriptorId", LookupTypeName = "WeaponDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -40681,10 +48822,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (DisciplineIncident as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("SexDescriptorId", SexDescriptorId); + keyValues.Add("WeaponDescriptorId", WeaponDescriptorId); return keyValues; } @@ -40748,59 +48889,83 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateSex)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentWeapon)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateSex) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentWeapon) target, null); } void IChildEntity.SetParent(object value) { - EducationContent = (EducationContent) value; + DisciplineIncident = (DisciplineIncident) value; } } +} +// Aggregate: DisciplineIncidentParticipationCodeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DisciplineIncidentParticipationCodeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentAuthor table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisciplineIncidentParticipationCodeDescriptor table of the DisciplineIncidentParticipationCodeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentAuthor : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisciplineIncidentParticipationCodeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentAuthor() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentAuthor.EducationContent + [DomainSignature] + [IgnoreMember] + public virtual int DisciplineIncidentParticipationCodeDescriptorId { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string Author { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -40816,35 +48981,6 @@ Entities.Common.EdFi.IEducationContent IEducationContentAuthor.EducationContent // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -40870,11 +49006,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Author", Author); + keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); return keyValues; } @@ -40938,59 +49074,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAuthor)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentAuthor) target, null); + this.MapTo((Entities.Common.EdFi.IDisciplineIncidentParticipationCodeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } +} +// Aggregate: DisplacedStudentStatusDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DisplacedStudentStatusDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentDerivativeSourceEducationContent table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DisplacedStudentStatusDescriptor table of the DisplacedStudentStatusDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceEducationContent : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DisplacedStudentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDisplacedStudentStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentDerivativeSourceEducationContent() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducationContent.EducationContent + [DomainSignature] + [IgnoreMember] + public virtual int DisplacedStudentStatusDescriptorId { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string DerivativeSourceContentIdentifier { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -41006,60 +49162,11 @@ Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducatio // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData DerivativeSourceEducationContentReferenceData { get; set; } - - /// - /// Read-only property that allows the DerivativeSourceEducationContent discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentDiscriminator - { - get { return DerivativeSourceEducationContentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the DerivativeSourceEducationContent resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentResourceId - { - get { return DerivativeSourceEducationContentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= @@ -41080,11 +49187,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DerivativeSourceContentIdentifier", DerivativeSourceContentIdentifier); + keyValues.Add("DisplacedStudentStatusDescriptorId", DisplacedStudentStatusDescriptorId); return keyValues; } @@ -41148,59 +49255,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent) target, null); + this.MapTo((Entities.Common.EdFi.IDisplacedStudentStatusDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } +} +// Aggregate: DualCreditInstitutionDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DualCreditInstitutionDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentDerivativeSourceLearningResourceMetadataURI table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DualCreditInstitutionDescriptor table of the DualCreditInstitutionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DualCreditInstitutionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDualCreditInstitutionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentDerivativeSourceLearningResourceMetadataURI() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceLearningResourceMetadataURI.EducationContent + [DomainSignature] + [IgnoreMember] + public virtual int DualCreditInstitutionDescriptorId { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string DerivativeSourceLearningResourceMetadataURI { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -41216,35 +49343,6 @@ Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceLearning // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41270,11 +49368,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DerivativeSourceLearningResourceMetadataURI", DerivativeSourceLearningResourceMetadataURI); + keyValues.Add("DualCreditInstitutionDescriptorId", DualCreditInstitutionDescriptorId); return keyValues; } @@ -41338,59 +49436,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDualCreditInstitutionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI) target, null); + this.MapTo((Entities.Common.EdFi.IDualCreditInstitutionDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } +} +// Aggregate: DualCreditTypeDescriptor + +namespace EdFi.Ods.Entities.NHibernate.DualCreditTypeDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentDerivativeSourceURI table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.DualCreditTypeDescriptor table of the DualCreditTypeDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentDerivativeSourceURI : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentDerivativeSourceURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class DualCreditTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IDualCreditTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentDerivativeSourceURI() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.EducationContent + [DomainSignature] + [IgnoreMember] + public virtual int DualCreditTypeDescriptorId { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } - - [DomainSignature] - public virtual string DerivativeSourceURI { get; set; } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -41406,35 +49524,6 @@ Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.Educ // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41460,11 +49549,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("DerivativeSourceURI", DerivativeSourceURI); + keyValues.Add("DualCreditTypeDescriptorId", DualCreditTypeDescriptorId); return keyValues; } @@ -41528,92 +49617,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target); + return this.SynchronizeTo((Entities.Common.EdFi.IDualCreditTypeDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI) target, null); + this.MapTo((Entities.Common.EdFi.IDualCreditTypeDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } +} +// Aggregate: EducationalEnvironmentDescriptor + +namespace EdFi.Ods.Entities.NHibernate.EducationalEnvironmentDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationContentLanguage table of the EducationContent aggregate in the ODS database. + /// A class which represents the edfi.EducationalEnvironmentDescriptor table of the EducationalEnvironmentDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationContentLanguage : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationContentLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationalEnvironmentDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IEducationalEnvironmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationContentLanguage() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationContent EducationContent { get; set; } - - Entities.Common.EdFi.IEducationContent IEducationContentLanguage.EducationContent - { - get { return EducationContent; } - set { EducationContent = (EducationContent) value; } - } - [DomainSignature] - public virtual int LanguageDescriptorId - { - get - { - if (_languageDescriptorId == default(int)) - _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); - - return _languageDescriptorId; - } - set - { - _languageDescriptorId = value; - _languageDescriptor = null; - } - } - - private int _languageDescriptorId; - private string _languageDescriptor; - - public virtual string LanguageDescriptor + [IgnoreMember] + public virtual int EducationalEnvironmentDescriptorId { - get - { - if (_languageDescriptor == null) - _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); - - return _languageDescriptor; - } - set - { - _languageDescriptor = value; - _languageDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -41629,35 +49705,6 @@ public virtual string LanguageDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41673,7 +49720,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -41684,11 +49730,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationContent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); + keyValues.Add("EducationalEnvironmentDescriptorId", EducationalEnvironmentDescriptorId); return keyValues; } @@ -41752,44 +49798,44 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentLanguage)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationContentLanguage) target, null); + this.MapTo((Entities.Common.EdFi.IEducationalEnvironmentDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - EducationContent = (EducationContent) value; - } } } -// Aggregate: EducationOrganization +// Aggregate: EducationContent -namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.EducationContentAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class EducationOrganizationReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class EducationContentReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } + [Key(0)] + public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(1)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(2)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -41799,7 +49845,7 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); + keyValues.Add("ContentIdentifier", ContentIdentifier); return keyValues; } @@ -41850,23 +49896,27 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganization table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContent table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public abstract class EducationOrganization : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IEducationOrganization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap + [MessagePackObject] + public class EducationContent : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganization() + public EducationContent() { - EducationOrganizationAddresses = new HashSet(); - EducationOrganizationCategories = new HashSet(); - EducationOrganizationIdentificationCodes = new HashSet(); - EducationOrganizationIndicators = new HashSet(); - EducationOrganizationInstitutionTelephones = new HashSet(); - EducationOrganizationInternationalAddresses = new HashSet(); + EducationContentAppropriateGradeLevels = new HashSet(); + EducationContentAppropriateSexes = new HashSet(); + EducationContentAuthors = new HashSet(); + EducationContentDerivativeSourceEducationContents = new HashSet(); + EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(); + EducationContentDerivativeSourceURIs = new HashSet(); + EducationContentLanguages = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -41874,7 +49924,9 @@ public EducationOrganization() // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual long EducationOrganizationId { get; set; } + [DomainSignature] + [Key(6)] + public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -41885,302 +49937,287 @@ public EducationOrganization() // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string NameOfInstitution { get; set; } - public virtual int? OperationalStatusDescriptorId + [Key(7)] + public virtual bool? AdditionalAuthorsIndicator { get; set; } + [Key(8)] + public virtual int? ContentClassDescriptorId { get { - if (_operationalStatusDescriptorId == default(int?)) - _operationalStatusDescriptorId = string.IsNullOrWhiteSpace(_operationalStatusDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("OperationalStatusDescriptor", _operationalStatusDescriptor); + if (_contentClassDescriptorId == default(int?)) + _contentClassDescriptorId = string.IsNullOrWhiteSpace(_contentClassDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ContentClassDescriptor", _contentClassDescriptor); - return _operationalStatusDescriptorId; + return _contentClassDescriptorId; } set { - _operationalStatusDescriptorId = value; - _operationalStatusDescriptor = null; + _contentClassDescriptorId = value; + _contentClassDescriptor = null; } } - private int? _operationalStatusDescriptorId; - private string _operationalStatusDescriptor; + private int? _contentClassDescriptorId; + private string _contentClassDescriptor; - public virtual string OperationalStatusDescriptor + [IgnoreMember] + public virtual string ContentClassDescriptor { get { - if (_operationalStatusDescriptor == null) - _operationalStatusDescriptor = _operationalStatusDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("OperationalStatusDescriptor", _operationalStatusDescriptorId.Value); + if (_contentClassDescriptor == null) + _contentClassDescriptor = _contentClassDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ContentClassDescriptor", _contentClassDescriptorId.Value); - return _operationalStatusDescriptor; - } - set - { - _operationalStatusDescriptor = value; - _operationalStatusDescriptorId = default(int?); - } - } - public virtual string ShortNameOfInstitution { get; set; } - public virtual string WebSite { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - - private ICollection _educationOrganizationAddresses; - private ICollection _educationOrganizationAddressesCovariant; - public virtual ICollection EducationOrganizationAddresses - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationAddresses) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- - - return _educationOrganizationAddresses; + return _contentClassDescriptor; } set { - _educationOrganizationAddresses = value; - _educationOrganizationAddressesCovariant = new CovariantCollectionAdapter(value); + _contentClassDescriptor = value; + _contentClassDescriptorId = default(int?); } } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationAddresses + [Key(9)] + public virtual decimal? Cost { get; set; } + [Key(10)] + public virtual int? CostRateDescriptorId { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationAddresses) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- + if (_costRateDescriptorId == default(int?)) + _costRateDescriptorId = string.IsNullOrWhiteSpace(_costRateDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CostRateDescriptor", _costRateDescriptor); - return _educationOrganizationAddressesCovariant; - } + return _costRateDescriptorId; + } set { - EducationOrganizationAddresses = new HashSet(value.Cast()); + _costRateDescriptorId = value; + _costRateDescriptor = null; } } + private int? _costRateDescriptorId; + private string _costRateDescriptor; - private ICollection _educationOrganizationCategories; - private ICollection _educationOrganizationCategoriesCovariant; - public virtual ICollection EducationOrganizationCategories + [IgnoreMember] + public virtual string CostRateDescriptor { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationCategories) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- - - return _educationOrganizationCategories; + if (_costRateDescriptor == null) + _costRateDescriptor = _costRateDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CostRateDescriptor", _costRateDescriptorId.Value); + + return _costRateDescriptor; } set { - _educationOrganizationCategories = value; - _educationOrganizationCategoriesCovariant = new CovariantCollectionAdapter(value); + _costRateDescriptor = value; + _costRateDescriptorId = default(int?); } } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationCategories + [Key(11)] + public virtual string Description { get; set; } + [Key(12)] + public virtual int? InteractivityStyleDescriptorId { get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationCategories) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- + if (_interactivityStyleDescriptorId == default(int?)) + _interactivityStyleDescriptorId = string.IsNullOrWhiteSpace(_interactivityStyleDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InteractivityStyleDescriptor", _interactivityStyleDescriptor); - return _educationOrganizationCategoriesCovariant; - } + return _interactivityStyleDescriptorId; + } set { - EducationOrganizationCategories = new HashSet(value.Cast()); + _interactivityStyleDescriptorId = value; + _interactivityStyleDescriptor = null; } } + private int? _interactivityStyleDescriptorId; + private string _interactivityStyleDescriptor; - private ICollection _educationOrganizationIdentificationCodes; - private ICollection _educationOrganizationIdentificationCodesCovariant; - public virtual ICollection EducationOrganizationIdentificationCodes + [IgnoreMember] + public virtual string InteractivityStyleDescriptor { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIdentificationCodes) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- - - return _educationOrganizationIdentificationCodes; + if (_interactivityStyleDescriptor == null) + _interactivityStyleDescriptor = _interactivityStyleDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InteractivityStyleDescriptor", _interactivityStyleDescriptorId.Value); + + return _interactivityStyleDescriptor; } set { - _educationOrganizationIdentificationCodes = value; - _educationOrganizationIdentificationCodesCovariant = new CovariantCollectionAdapter(value); + _interactivityStyleDescriptor = value; + _interactivityStyleDescriptorId = default(int?); } } - - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIdentificationCodes + [Key(13)] + public virtual string LearningResourceMetadataURI { get; set; } + [Key(14)] + public virtual string LearningStandardId { get; set; } + [Key(15)] + public virtual string Namespace { get; set; } + [Key(16)] + public virtual DateTime? PublicationDate { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIdentificationCodes) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- - - return _educationOrganizationIdentificationCodesCovariant; - } - set - { - EducationOrganizationIdentificationCodes = new HashSet(value.Cast()); + get { return _publicationDate; } + set + { + //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. + if(value == null) + { + _publicationDate = null; + } else + { + var given = (DateTime) value; + _publicationDate = new DateTime(given.Year, given.Month, given.Day); + } } } + private DateTime? _publicationDate; + + [Key(17)] + public virtual short? PublicationYear { get; set; } + [Key(18)] + public virtual string Publisher { get; set; } + [Key(19)] + public virtual string ShortDescription { get; set; } + [Key(20)] + public virtual string TimeRequired { get; set; } + [Key(21)] + public virtual string UseRightsURL { get; set; } + [Key(22)] + public virtual string Version { get; set; } + // ------------------------------------------------------------- - private ICollection _educationOrganizationIndicators; - private ICollection _educationOrganizationIndicatorsCovariant; - public virtual ICollection EducationOrganizationIndicators - { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIndicators) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _educationOrganizationIndicators; - } - set - { - _educationOrganizationIndicators = value; - _educationOrganizationIndicatorsCovariant = new CovariantCollectionAdapter(value); - } - } + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationIndicators + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContent")] + [Key(23)] + public IDictionary Extensions { - get + get { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIndicators) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } - return _educationOrganizationIndicatorsCovariant; + return _extensions; } set { - EducationOrganizationIndicators = new HashSet(value.Cast()); + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) + { + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } + } + } + + _extensions = value; } } + private IDictionary _aggregateExtensions; - private ICollection _educationOrganizationInstitutionTelephones; - private ICollection _educationOrganizationInstitutionTelephonesCovariant; - public virtual ICollection EducationOrganizationInstitutionTelephones - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContent")] + [Key(24)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationInstitutionTelephones) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _educationOrganizationInstitutionTelephones; + return _aggregateExtensions; } set { - _educationOrganizationInstitutionTelephones = value; - _educationOrganizationInstitutionTelephonesCovariant = new CovariantCollectionAdapter(value); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInstitutionTelephones + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(25)] + public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } + + /// + /// Read-only property that allows the LearningStandard discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationContent.LearningStandardDiscriminator { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationInstitutionTelephones) - if (item.EducationOrganization == null) - item.EducationOrganization = this; - // ------------------------------------------------------------- + get { return LearningStandardReferenceData?.Discriminator; } + set { } + } - return _educationOrganizationInstitutionTelephonesCovariant; - } - set - { - EducationOrganizationInstitutionTelephones = new HashSet(value.Cast()); - } + /// + /// Read-only property that allows the LearningStandard resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationContent.LearningStandardResourceId + { + get { return LearningStandardReferenceData?.Id; } + set { } } + // ------------------------------------------------------------- - private ICollection _educationOrganizationInternationalAddresses; - private ICollection _educationOrganizationInternationalAddressesCovariant; - public virtual ICollection EducationOrganizationInternationalAddresses + //============================================================= + // Collections + // ------------------------------------------------------------- + + private ICollection _educationContentAppropriateGradeLevels; + private ICollection _educationContentAppropriateGradeLevelsCovariant; + [Key(26)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationContentAppropriateGradeLevels { get { @@ -42189,339 +50226,322 @@ public virtual ICollection set) + { + set.Reattach(this, "EducationContentAppropriateGradeLevels"); + } + + foreach (var item in _educationContentAppropriateGradeLevels) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationInternationalAddresses; + return _educationContentAppropriateGradeLevels; } set { - _educationOrganizationInternationalAddresses = value; - _educationOrganizationInternationalAddressesCovariant = new CovariantCollectionAdapter(value); + _educationContentAppropriateGradeLevels = value; + _educationContentAppropriateGradeLevelsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganization.EducationOrganizationInternationalAddresses + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateGradeLevels { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationInternationalAddresses) - if (item.EducationOrganization == null) - item.EducationOrganization = this; + foreach (var item in _educationContentAppropriateGradeLevels) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationInternationalAddressesCovariant; + return _educationContentAppropriateGradeLevelsCovariant; } set { - EducationOrganizationInternationalAddresses = new HashSet(value.Cast()); - } - } - - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "OperationalStatusDescriptor", new LookupColumnDetails { PropertyName = "OperationalStatusDescriptorId", LookupTypeName = "OperationalStatusDescriptor"} }, - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } + EducationContentAppropriateGradeLevels = new HashSet(value.Cast()); } + } - return hashCode.ToHashCode(); - } - #endregion - } -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.EducationOrganizationAddress table of the EducationOrganization aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class EducationOrganizationAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public EducationOrganizationAddress() - { - EducationOrganizationAddressPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } - - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationAddress.EducationOrganization + + private ICollection _educationContentAppropriateSexes; + private ICollection _educationContentAppropriateSexesCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationContentAppropriateSexes { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get + { + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationContentAppropriateSexes is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationContentAppropriateSexes"); + } + + foreach (var item in _educationContentAppropriateSexes) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- + + return _educationContentAppropriateSexes; + } + set + { + _educationContentAppropriateSexes = value; + _educationContentAppropriateSexesCovariant = new CovariantCollectionAdapter(value); + } } - [DomainSignature] - public virtual int AddressTypeDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAppropriateSexes { get { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationContentAppropriateSexes) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- - return _addressTypeDescriptorId; - } + return _educationContentAppropriateSexesCovariant; + } set { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; + EducationContentAppropriateSexes = new HashSet(value.Cast()); } } - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; - public virtual string AddressTypeDescriptor + private ICollection _educationContentAuthors; + private ICollection _educationContentAuthorsCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationContentAuthors { get { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); - - return _addressTypeDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationContentAuthors is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationContentAuthors"); + } + + foreach (var item in _educationContentAuthors) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- + + return _educationContentAuthors; } set { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); + _educationContentAuthors = value; + _educationContentAuthorsCovariant = new CovariantCollectionAdapter(value); } } - [DomainSignature] - public virtual string City { get; set; } - [DomainSignature] - public virtual string PostalCode { get; set; } - [DomainSignature] - public virtual int StateAbbreviationDescriptorId + + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentAuthors { get { - if (_stateAbbreviationDescriptorId == default(int)) - _stateAbbreviationDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("StateAbbreviationDescriptor", _stateAbbreviationDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationContentAuthors) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- - return _stateAbbreviationDescriptorId; - } + return _educationContentAuthorsCovariant; + } set { - _stateAbbreviationDescriptorId = value; - _stateAbbreviationDescriptor = null; + EducationContentAuthors = new HashSet(value.Cast()); } } - private int _stateAbbreviationDescriptorId; - private string _stateAbbreviationDescriptor; - public virtual string StateAbbreviationDescriptor + private ICollection _educationContentDerivativeSourceEducationContents; + private ICollection _educationContentDerivativeSourceEducationContentsCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationContentDerivativeSourceEducationContents { get { - if (_stateAbbreviationDescriptor == null) - _stateAbbreviationDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("StateAbbreviationDescriptor", _stateAbbreviationDescriptorId); - - return _stateAbbreviationDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationContentDerivativeSourceEducationContents is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationContentDerivativeSourceEducationContents"); + } + + foreach (var item in _educationContentDerivativeSourceEducationContents) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- + + return _educationContentDerivativeSourceEducationContents; } set { - _stateAbbreviationDescriptor = value; - _stateAbbreviationDescriptorId = default(int); + _educationContentDerivativeSourceEducationContents = value; + _educationContentDerivativeSourceEducationContentsCovariant = new CovariantCollectionAdapter(value); } } - [DomainSignature] - public virtual string StreetNumberName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string ApartmentRoomSuiteNumber { get; set; } - public virtual string BuildingSiteNumber { get; set; } - public virtual string CongressionalDistrict { get; set; } - public virtual string CountyFIPSCode { get; set; } - public virtual bool? DoNotPublishIndicator { get; set; } - public virtual string Latitude { get; set; } - public virtual int? LocaleDescriptorId + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceEducationContents { get { - if (_localeDescriptorId == default(int?)) - _localeDescriptorId = string.IsNullOrWhiteSpace(_localeDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LocaleDescriptor", _localeDescriptor); + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationContentDerivativeSourceEducationContents) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- - return _localeDescriptorId; - } + return _educationContentDerivativeSourceEducationContentsCovariant; + } set { - _localeDescriptorId = value; - _localeDescriptor = null; + EducationContentDerivativeSourceEducationContents = new HashSet(value.Cast()); } } - private int? _localeDescriptorId; - private string _localeDescriptor; - public virtual string LocaleDescriptor + private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIs; + private ICollection _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationContentDerivativeSourceLearningResourceMetadataURIs { get { - if (_localeDescriptor == null) - _localeDescriptor = _localeDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LocaleDescriptor", _localeDescriptorId.Value); - - return _localeDescriptor; + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationContentDerivativeSourceLearningResourceMetadataURIs is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "EducationContentDerivativeSourceLearningResourceMetadataURIs"); + } + + foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- + + return _educationContentDerivativeSourceLearningResourceMetadataURIs; } set { - _localeDescriptor = value; - _localeDescriptorId = default(int?); + _educationContentDerivativeSourceLearningResourceMetadataURIs = value; + _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant = new CovariantCollectionAdapter(value); } } - public virtual string Longitude { get; set; } - public virtual string NameOfCounty { get; set; } - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceLearningResourceMetadataURIs + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationContentDerivativeSourceLearningResourceMetadataURIs) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; + return _educationContentDerivativeSourceLearningResourceMetadataURIsCovariant; + } + set + { + EducationContentDerivativeSourceLearningResourceMetadataURIs = new HashSet(value.Cast()); + } + } - public IDictionary Extensions + + private ICollection _educationContentDerivativeSourceURIs; + private ICollection _educationContentDerivativeSourceURIsCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationContentDerivativeSourceURIs { - get => _extensions; - set + get { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) + // ------------------------------------------------------------- + // On-demand deserialization logic to attach reverse reference of children + // due to ServiceStack's lack of [OnDeserialized] attribute support. + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + if (_educationContentDerivativeSourceURIs is DeserializedPersistentGenericSet set) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } + set.Reattach(this, "EducationContentDerivativeSourceURIs"); } + + foreach (var item in _educationContentDerivativeSourceURIs) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- - _extensions = value; + return _educationContentDerivativeSourceURIs; + } + set + { + _educationContentDerivativeSourceURIs = value; + _educationContentDerivativeSourceURIsCovariant = new CovariantCollectionAdapter(value); } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- + // Covariant version, visible only on the interface + ICollection Entities.Common.EdFi.IEducationContent.EducationContentDerivativeSourceURIs + { + get + { + // ------------------------------------------------------------- + // Back-reference is required by NHibernate for persistence. + // ------------------------------------------------------------- + foreach (var item in _educationContentDerivativeSourceURIs) + if (item.EducationContent == null) + item.EducationContent = this; + // ------------------------------------------------------------- - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- + return _educationContentDerivativeSourceURIsCovariant; + } + set + { + EducationContentDerivativeSourceURIs = new HashSet(value.Cast()); + } + } - //============================================================= - // Collections - // ------------------------------------------------------------- - private ICollection _educationOrganizationAddressPeriods; - private ICollection _educationOrganizationAddressPeriodsCovariant; - public virtual ICollection EducationOrganizationAddressPeriods + private ICollection _educationContentLanguages; + private ICollection _educationContentLanguagesCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection EducationContentLanguages { get { @@ -42530,38 +50550,43 @@ public virtual ICollection set) + { + set.Reattach(this, "EducationContentLanguages"); + } + + foreach (var item in _educationContentLanguages) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationAddressPeriods; + return _educationContentLanguages; } set { - _educationOrganizationAddressPeriods = value; - _educationOrganizationAddressPeriodsCovariant = new CovariantCollectionAdapter(value); + _educationContentLanguages = value; + _educationContentLanguagesCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganizationAddress.EducationOrganizationAddressPeriods + ICollection Entities.Common.EdFi.IEducationContent.EducationContentLanguages { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _educationOrganizationAddressPeriods) - if (item.EducationOrganizationAddress == null) - item.EducationOrganizationAddress = this; + foreach (var item in _educationContentLanguages) + if (item.EducationContent == null) + item.EducationContent = this; // ------------------------------------------------------------- - return _educationOrganizationAddressPeriodsCovariant; + return _educationContentLanguagesCovariant; } set { - EducationOrganizationAddressPeriods = new HashSet(value.Cast()); + EducationContentLanguages = new HashSet(value.Cast()); } } @@ -42570,9 +50595,9 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "LocaleDescriptor", new LookupColumnDetails { PropertyName = "LocaleDescriptorId", LookupTypeName = "LocaleDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "ContentClassDescriptor", new LookupColumnDetails { PropertyName = "ContentClassDescriptorId", LookupTypeName = "ContentClassDescriptor"} }, + { "CostRateDescriptor", new LookupColumnDetails { PropertyName = "CostRateDescriptorId", LookupTypeName = "CostRateDescriptor"} }, + { "InteractivityStyleDescriptor", new LookupColumnDetails { PropertyName = "InteractivityStyleDescriptorId", LookupTypeName = "InteractivityStyleDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -42583,15 +50608,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); - keyValues.Add("City", City); - keyValues.Add("PostalCode", PostalCode); - keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); - keyValues.Add("StreetNumberName", StreetNumberName); + keyValues.Add("ContentIdentifier", ContentIdentifier); return keyValues; } @@ -42655,36 +50676,33 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddress)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddress) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContent) target, null); } - void IChildEntity.SetParent(object value) - { - EducationOrganization = (EducationOrganization) value; - } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationAddressPeriod table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentAppropriateGradeLevel table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationAddressPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationContentAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationAddressPeriod() + public EducationContentAppropriateGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -42692,25 +50710,52 @@ public EducationOrganizationAddressPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganizationAddress EducationOrganizationAddress { get; set; } + [DomainSignature, IgnoreMember] + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganizationAddress IEducationOrganizationAddressPeriod.EducationOrganizationAddress + Entities.Common.EdFi.IEducationContent IEducationContentAppropriateGradeLevel.EducationContent { - get { return EducationOrganizationAddress; } - set { EducationOrganizationAddress = (EducationOrganizationAddress) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual DateTime BeginDate + [Key(1)] + public virtual int GradeLevelDescriptorId { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } + get + { + if (_gradeLevelDescriptorId == default(int)) + _gradeLevelDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("GradeLevelDescriptor", _gradeLevelDescriptor); + + return _gradeLevelDescriptorId; + } + set + { + _gradeLevelDescriptorId = value; + _gradeLevelDescriptor = null; + } } - private DateTime _beginDate; - + private int _gradeLevelDescriptorId; + private string _gradeLevelDescriptor; + + [IgnoreMember] + public virtual string GradeLevelDescriptor + { + get + { + if (_gradeLevelDescriptor == null) + _gradeLevelDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("GradeLevelDescriptor", _gradeLevelDescriptorId); + + return _gradeLevelDescriptor; + } + set + { + _gradeLevelDescriptor = value; + _gradeLevelDescriptorId = default(int); + } + } // ------------------------------------------------------------- // ============================================================= @@ -42721,25 +50766,6 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - // ------------------------------------------------------------- // ============================================================= @@ -42752,14 +50778,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContentAppropriateGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -42778,7 +50817,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContentAppropriateGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -42794,8 +50873,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "StateAbbreviationDescriptor", new LookupColumnDetails { PropertyName = "StateAbbreviationDescriptorId", LookupTypeName = "StateAbbreviationDescriptor"} }, + { "GradeLevelDescriptor", new LookupColumnDetails { PropertyName = "GradeLevelDescriptorId", LookupTypeName = "GradeLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -42807,10 +50885,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganizationAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); + keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); return keyValues; } @@ -42874,36 +50952,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationAddressPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateGradeLevel) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganizationAddress = (EducationOrganizationAddress) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationCategory table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentAppropriateSex table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationCategory : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationContentAppropriateSex : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationCategory() + public EducationContentAppropriateSex() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -42911,48 +50990,50 @@ public EducationOrganizationCategory() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + [DomainSignature, IgnoreMember] + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationCategory.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentAppropriateSex.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int EducationOrganizationCategoryDescriptorId + [Key(1)] + public virtual int SexDescriptorId { get { - if (_educationOrganizationCategoryDescriptorId == default(int)) - _educationOrganizationCategoryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptor); + if (_sexDescriptorId == default(int)) + _sexDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("SexDescriptor", _sexDescriptor); - return _educationOrganizationCategoryDescriptorId; + return _sexDescriptorId; } set { - _educationOrganizationCategoryDescriptorId = value; - _educationOrganizationCategoryDescriptor = null; + _sexDescriptorId = value; + _sexDescriptor = null; } } - private int _educationOrganizationCategoryDescriptorId; - private string _educationOrganizationCategoryDescriptor; + private int _sexDescriptorId; + private string _sexDescriptor; - public virtual string EducationOrganizationCategoryDescriptor + [IgnoreMember] + public virtual string SexDescriptor { get { - if (_educationOrganizationCategoryDescriptor == null) - _educationOrganizationCategoryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationCategoryDescriptor", _educationOrganizationCategoryDescriptorId); + if (_sexDescriptor == null) + _sexDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("SexDescriptor", _sexDescriptorId); - return _educationOrganizationCategoryDescriptor; + return _sexDescriptor; } set { - _educationOrganizationCategoryDescriptor = value; - _educationOrganizationCategoryDescriptorId = default(int); + _sexDescriptor = value; + _sexDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -42977,14 +51058,27 @@ public virtual string EducationOrganizationCategoryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContentAppropriateSex")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -43003,7 +51097,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContentAppropriateSex")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -43019,7 +51153,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EducationOrganizationCategoryDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationCategoryDescriptorId", LookupTypeName = "EducationOrganizationCategoryDescriptor"} }, + { "SexDescriptor", new LookupColumnDetails { PropertyName = "SexDescriptorId", LookupTypeName = "SexDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -43031,10 +51165,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationCategoryDescriptorId", EducationOrganizationCategoryDescriptorId); + keyValues.Add("SexDescriptorId", SexDescriptorId); return keyValues; } @@ -43098,36 +51232,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationCategory)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAppropriateSex)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationCategory) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentAppropriateSex) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationIdentificationCode table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentAuthor table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationIdentificationCode : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationContentAuthor : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationIdentificationCode() + public EducationContentAuthor() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -43135,50 +51270,18 @@ public EducationOrganizationIdentificationCode() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + [DomainSignature, IgnoreMember] + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIdentificationCode.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentAuthor.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int EducationOrganizationIdentificationSystemDescriptorId - { - get - { - if (_educationOrganizationIdentificationSystemDescriptorId == default(int)) - _educationOrganizationIdentificationSystemDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptor); - - return _educationOrganizationIdentificationSystemDescriptorId; - } - set - { - _educationOrganizationIdentificationSystemDescriptorId = value; - _educationOrganizationIdentificationSystemDescriptor = null; - } - } - - private int _educationOrganizationIdentificationSystemDescriptorId; - private string _educationOrganizationIdentificationSystemDescriptor; - - public virtual string EducationOrganizationIdentificationSystemDescriptor - { - get - { - if (_educationOrganizationIdentificationSystemDescriptor == null) - _educationOrganizationIdentificationSystemDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("EducationOrganizationIdentificationSystemDescriptor", _educationOrganizationIdentificationSystemDescriptorId); - - return _educationOrganizationIdentificationSystemDescriptor; - } - set - { - _educationOrganizationIdentificationSystemDescriptor = value; - _educationOrganizationIdentificationSystemDescriptorId = default(int); - } - } + [Key(1)] + public virtual string Author { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43189,7 +51292,6 @@ public virtual string EducationOrganizationIdentificationSystemDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43202,14 +51304,27 @@ public virtual string EducationOrganizationIdentificationSystemDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContentAuthor")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -43228,7 +51343,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContentAuthor")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -43244,7 +51399,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "EducationOrganizationIdentificationSystemDescriptor", new LookupColumnDetails { PropertyName = "EducationOrganizationIdentificationSystemDescriptorId", LookupTypeName = "EducationOrganizationIdentificationSystemDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -43256,10 +51410,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("EducationOrganizationIdentificationSystemDescriptorId", EducationOrganizationIdentificationSystemDescriptorId); + keyValues.Add("Author", Author); return keyValues; } @@ -43323,37 +51477,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentAuthor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationIdentificationCode) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentAuthor) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationIndicator table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentDerivativeSourceEducationContent table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicator : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationIndicator, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationContentDerivativeSourceEducationContent : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationIndicator() + public EducationContentDerivativeSourceEducationContent() { - EducationOrganizationIndicatorPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -43361,50 +51515,18 @@ public EducationOrganizationIndicator() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + [DomainSignature, IgnoreMember] + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationIndicator.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceEducationContent.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int IndicatorDescriptorId - { - get - { - if (_indicatorDescriptorId == default(int)) - _indicatorDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorDescriptor", _indicatorDescriptor); - - return _indicatorDescriptorId; - } - set - { - _indicatorDescriptorId = value; - _indicatorDescriptor = null; - } - } - - private int _indicatorDescriptorId; - private string _indicatorDescriptor; - - public virtual string IndicatorDescriptor - { - get - { - if (_indicatorDescriptor == null) - _indicatorDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorDescriptor", _indicatorDescriptorId); - - return _indicatorDescriptor; - } - set - { - _indicatorDescriptor = value; - _indicatorDescriptorId = default(int); - } - } + [Key(1)] + public virtual string DerivativeSourceContentIdentifier { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43415,76 +51537,6 @@ public virtual string IndicatorDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string DesignatedBy { get; set; } - public virtual int? IndicatorGroupDescriptorId - { - get - { - if (_indicatorGroupDescriptorId == default(int?)) - _indicatorGroupDescriptorId = string.IsNullOrWhiteSpace(_indicatorGroupDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorGroupDescriptor", _indicatorGroupDescriptor); - - return _indicatorGroupDescriptorId; - } - set - { - _indicatorGroupDescriptorId = value; - _indicatorGroupDescriptor = null; - } - } - - private int? _indicatorGroupDescriptorId; - private string _indicatorGroupDescriptor; - - public virtual string IndicatorGroupDescriptor - { - get - { - if (_indicatorGroupDescriptor == null) - _indicatorGroupDescriptor = _indicatorGroupDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorGroupDescriptor", _indicatorGroupDescriptorId.Value); - - return _indicatorGroupDescriptor; - } - set - { - _indicatorGroupDescriptor = value; - _indicatorGroupDescriptorId = default(int?); - } - } - public virtual int? IndicatorLevelDescriptorId - { - get - { - if (_indicatorLevelDescriptorId == default(int?)) - _indicatorLevelDescriptorId = string.IsNullOrWhiteSpace(_indicatorLevelDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("IndicatorLevelDescriptor", _indicatorLevelDescriptor); - - return _indicatorLevelDescriptorId; - } - set - { - _indicatorLevelDescriptorId = value; - _indicatorLevelDescriptor = null; - } - } - - private int? _indicatorLevelDescriptorId; - private string _indicatorLevelDescriptor; - - public virtual string IndicatorLevelDescriptor - { - get - { - if (_indicatorLevelDescriptor == null) - _indicatorLevelDescriptor = _indicatorLevelDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("IndicatorLevelDescriptor", _indicatorLevelDescriptorId.Value); - - return _indicatorLevelDescriptor; - } - set - { - _indicatorLevelDescriptor = value; - _indicatorLevelDescriptorId = default(int?); - } - } - public virtual string IndicatorValue { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43497,14 +51549,27 @@ public virtual string IndicatorLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContentDerivativeSourceEducationContent")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -43523,72 +51588,83 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + private IDictionary _aggregateExtensions; - private ICollection _educationOrganizationIndicatorPeriods; - private ICollection _educationOrganizationIndicatorPeriodsCovariant; - public virtual ICollection EducationOrganizationIndicatorPeriods - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContentDerivativeSourceEducationContent")] + [Key(3)] + public IDictionary AggregateExtensions + { get { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIndicatorPeriods) - if (item.EducationOrganizationIndicator == null) - item.EducationOrganizationIndicator = this; - // ------------------------------------------------------------- + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } - return _educationOrganizationIndicatorPeriods; + return _aggregateExtensions; } set { - _educationOrganizationIndicatorPeriods = value; - _educationOrganizationIndicatorPeriodsCovariant = new CovariantCollectionAdapter(value); + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IEducationOrganizationIndicator.EducationOrganizationIndicatorPeriods + // ------------------------------------------------------------- + + // ============================================================= + // Reference Data + // ------------------------------------------------------------- + [Key(4)] + public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData DerivativeSourceEducationContentReferenceData { get; set; } + + /// + /// Read-only property that allows the DerivativeSourceEducationContent discriminator value to be mapped to the resource reference. + /// + string Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentDiscriminator { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _educationOrganizationIndicatorPeriods) - if (item.EducationOrganizationIndicator == null) - item.EducationOrganizationIndicator = this; - // ------------------------------------------------------------- + get { return DerivativeSourceEducationContentReferenceData?.Discriminator; } + set { } + } - return _educationOrganizationIndicatorPeriodsCovariant; - } - set - { - EducationOrganizationIndicatorPeriods = new HashSet(value.Cast()); - } + /// + /// Read-only property that allows the DerivativeSourceEducationContent resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent.DerivativeSourceEducationContentResourceId + { + get { return DerivativeSourceEducationContentReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, - { "IndicatorGroupDescriptor", new LookupColumnDetails { PropertyName = "IndicatorGroupDescriptorId", LookupTypeName = "IndicatorGroupDescriptor"} }, - { "IndicatorLevelDescriptor", new LookupColumnDetails { PropertyName = "IndicatorLevelDescriptorId", LookupTypeName = "IndicatorLevelDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -43600,10 +51676,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("IndicatorDescriptorId", IndicatorDescriptorId); + keyValues.Add("DerivativeSourceContentIdentifier", DerivativeSourceContentIdentifier); return keyValues; } @@ -43667,36 +51743,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicator)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicator) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceEducationContent) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationIndicatorPeriod table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentDerivativeSourceLearningResourceMetadataURI table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationIndicatorPeriod : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationContentDerivativeSourceLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationIndicatorPeriod() + public EducationContentDerivativeSourceLearningResourceMetadataURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -43704,25 +51781,18 @@ public EducationOrganizationIndicatorPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganizationIndicator EducationOrganizationIndicator { get; set; } + [DomainSignature, IgnoreMember] + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganizationIndicator IEducationOrganizationIndicatorPeriod.EducationOrganizationIndicator + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceLearningResourceMetadataURI.EducationContent { - get { return EducationOrganizationIndicator; } - set { EducationOrganizationIndicator = (EducationOrganizationIndicator) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual DateTime BeginDate - { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _beginDate; - + [Key(1)] + public virtual string DerivativeSourceLearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43733,25 +51803,6 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - // ------------------------------------------------------------- // ============================================================= @@ -43764,14 +51815,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContentDerivativeSourceLearningResourceMetadataURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -43790,7 +51854,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContentDerivativeSourceLearningResourceMetadataURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -43806,7 +51910,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "IndicatorDescriptor", new LookupColumnDetails { PropertyName = "IndicatorDescriptorId", LookupTypeName = "IndicatorDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -43818,10 +51921,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganizationIndicator as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); + keyValues.Add("DerivativeSourceLearningResourceMetadataURI", DerivativeSourceLearningResourceMetadataURI); return keyValues; } @@ -43885,36 +51988,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationIndicatorPeriod) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceLearningResourceMetadataURI) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganizationIndicator = (EducationOrganizationIndicator) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationInstitutionTelephone table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentDerivativeSourceURI table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationInstitutionTelephone : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationContentDerivativeSourceURI : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentDerivativeSourceURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationInstitutionTelephone() + public EducationContentDerivativeSourceURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -43922,50 +52026,18 @@ public EducationOrganizationInstitutionTelephone() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + [DomainSignature, IgnoreMember] + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInstitutionTelephone.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentDerivativeSourceURI.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int InstitutionTelephoneNumberTypeDescriptorId - { - get - { - if (_institutionTelephoneNumberTypeDescriptorId == default(int)) - _institutionTelephoneNumberTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptor); - - return _institutionTelephoneNumberTypeDescriptorId; - } - set - { - _institutionTelephoneNumberTypeDescriptorId = value; - _institutionTelephoneNumberTypeDescriptor = null; - } - } - - private int _institutionTelephoneNumberTypeDescriptorId; - private string _institutionTelephoneNumberTypeDescriptor; - - public virtual string InstitutionTelephoneNumberTypeDescriptor - { - get - { - if (_institutionTelephoneNumberTypeDescriptor == null) - _institutionTelephoneNumberTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("InstitutionTelephoneNumberTypeDescriptor", _institutionTelephoneNumberTypeDescriptorId); - - return _institutionTelephoneNumberTypeDescriptor; - } - set - { - _institutionTelephoneNumberTypeDescriptor = value; - _institutionTelephoneNumberTypeDescriptorId = default(int); - } - } + [Key(1)] + public virtual string DerivativeSourceURI { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43976,7 +52048,6 @@ public virtual string InstitutionTelephoneNumberTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string TelephoneNumber { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -43989,14 +52060,27 @@ public virtual string InstitutionTelephoneNumberTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContentDerivativeSourceURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -44015,7 +52099,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContentDerivativeSourceURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -44031,7 +52155,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "InstitutionTelephoneNumberTypeDescriptor", new LookupColumnDetails { PropertyName = "InstitutionTelephoneNumberTypeDescriptorId", LookupTypeName = "InstitutionTelephoneNumberTypeDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -44043,10 +52166,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("InstitutionTelephoneNumberTypeDescriptorId", InstitutionTelephoneNumberTypeDescriptorId); + keyValues.Add("DerivativeSourceURI", DerivativeSourceURI); return keyValues; } @@ -44110,36 +52233,37 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationInstitutionTelephone) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentDerivativeSourceURI) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.EducationOrganizationInternationalAddress table of the EducationOrganization aggregate in the ODS database. + /// A class which represents the edfi.EducationContentLanguage table of the EducationContent aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class EducationOrganizationInternationalAddress : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IEducationOrganizationInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class EducationContentLanguage : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IEducationContentLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public EducationOrganizationInternationalAddress() + public EducationContentLanguage() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -44147,48 +52271,50 @@ public EducationOrganizationInternationalAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual EducationOrganization EducationOrganization { get; set; } + [DomainSignature, IgnoreMember] + public virtual EducationContent EducationContent { get; set; } - Entities.Common.EdFi.IEducationOrganization IEducationOrganizationInternationalAddress.EducationOrganization + Entities.Common.EdFi.IEducationContent IEducationContentLanguage.EducationContent { - get { return EducationOrganization; } - set { EducationOrganization = (EducationOrganization) value; } + get { return EducationContent; } + set { EducationContent = (EducationContent) value; } } [DomainSignature] - public virtual int AddressTypeDescriptorId + [Key(1)] + public virtual int LanguageDescriptorId { get { - if (_addressTypeDescriptorId == default(int)) - _addressTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("AddressTypeDescriptor", _addressTypeDescriptor); + if (_languageDescriptorId == default(int)) + _languageDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("LanguageDescriptor", _languageDescriptor); - return _addressTypeDescriptorId; + return _languageDescriptorId; } set { - _addressTypeDescriptorId = value; - _addressTypeDescriptor = null; + _languageDescriptorId = value; + _languageDescriptor = null; } } - private int _addressTypeDescriptorId; - private string _addressTypeDescriptor; + private int _languageDescriptorId; + private string _languageDescriptor; - public virtual string AddressTypeDescriptor + [IgnoreMember] + public virtual string LanguageDescriptor { get { - if (_addressTypeDescriptor == null) - _addressTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("AddressTypeDescriptor", _addressTypeDescriptorId); + if (_languageDescriptor == null) + _languageDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("LanguageDescriptor", _languageDescriptorId); - return _addressTypeDescriptor; + return _languageDescriptor; } set { - _addressTypeDescriptor = value; - _addressTypeDescriptorId = default(int); + _languageDescriptor = value; + _languageDescriptorId = default(int); } } // ------------------------------------------------------------- @@ -44201,84 +52327,6 @@ public virtual string AddressTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string AddressLine1 { get; set; } - public virtual string AddressLine2 { get; set; } - public virtual string AddressLine3 { get; set; } - public virtual string AddressLine4 { get; set; } - public virtual DateTime? BeginDate - { - get { return _beginDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _beginDate = null; - } else - { - var given = (DateTime) value; - _beginDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _beginDate; - - public virtual int CountryDescriptorId - { - get - { - if (_countryDescriptorId == default(int)) - _countryDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("CountryDescriptor", _countryDescriptor); - - return _countryDescriptorId; - } - set - { - _countryDescriptorId = value; - _countryDescriptor = null; - } - } - - private int _countryDescriptorId; - private string _countryDescriptor; - - public virtual string CountryDescriptor - { - get - { - if (_countryDescriptor == null) - _countryDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("CountryDescriptor", _countryDescriptorId); - - return _countryDescriptor; - } - set - { - _countryDescriptor = value; - _countryDescriptorId = default(int); - } - } - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else - { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _endDate; - - public virtual string Latitude { get; set; } - public virtual string Longitude { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -44291,14 +52339,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationContent", "EducationContentLanguage")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -44317,7 +52378,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationContent", "EducationContentLanguage")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -44333,8 +52434,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "AddressTypeDescriptor", new LookupColumnDetails { PropertyName = "AddressTypeDescriptorId", LookupTypeName = "AddressTypeDescriptor"} }, - { "CountryDescriptor", new LookupColumnDetails { PropertyName = "CountryDescriptorId", LookupTypeName = "CountryDescriptor"} }, + { "LanguageDescriptor", new LookupColumnDetails { PropertyName = "LanguageDescriptorId", LookupTypeName = "LanguageDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -44346,10 +52446,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (EducationOrganization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (EducationContent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); + keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); return keyValues; } @@ -44413,17 +52513,17 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress)target); + return this.SynchronizeTo((Entities.Common.EdFi.IEducationContentLanguage)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IEducationOrganizationInternationalAddress) target, null); + this.MapTo((Entities.Common.EdFi.IEducationContentLanguage) target, null); } void IChildEntity.SetParent(object value) { - EducationOrganization = (EducationOrganization) value; + EducationContent = (EducationContent) value; } } } @@ -44439,6 +52539,7 @@ namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationAssociationTypeDescr /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationOrganizationAssociationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEducationOrganizationAssociationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -44447,6 +52548,7 @@ public class EducationOrganizationAssociationTypeDescriptor : DescriptorAggregat // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EducationOrganizationAssociationTypeDescriptorId { get { return base.DescriptorId; } @@ -44618,6 +52720,7 @@ namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationCategoryDescriptorAg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationOrganizationCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEducationOrganizationCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -44626,6 +52729,7 @@ public class EducationOrganizationCategoryDescriptor : DescriptorAggregate.EdFi. // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EducationOrganizationCategoryDescriptorId { get { return base.DescriptorId; } @@ -44797,6 +52901,7 @@ namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationIdentificationSystem /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationOrganizationIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEducationOrganizationIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -44805,6 +52910,7 @@ public class EducationOrganizationIdentificationSystemDescriptor : DescriptorAgg // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EducationOrganizationIdentificationSystemDescriptorId { get { return base.DescriptorId; } @@ -44971,25 +53077,31 @@ namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationInterventionPrescrip /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class EducationOrganizationInterventionPrescriptionAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } + [Key(2)] public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -45056,6 +53168,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationOrganizationInterventionPrescriptionAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -45063,8 +53176,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public EducationOrganizationInterventionPrescriptionAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -45073,10 +53186,13 @@ public EducationOrganizationInterventionPrescriptionAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- @@ -45088,6 +53204,7 @@ public EducationOrganizationInterventionPrescriptionAssociation() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual DateTime? BeginDate { get { return _beginDate; } @@ -45107,6 +53224,7 @@ public virtual DateTime? BeginDate private DateTime? _beginDate; + [Key(10)] public virtual DateTime? EndDate { get { return _endDate; } @@ -45138,14 +53256,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganizationInterventionPrescriptionAssociation", "EducationOrganizationInterventionPrescriptionAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -45164,12 +53295,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganizationInterventionPrescriptionAssociation", "EducationOrganizationInterventionPrescriptionAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -45190,6 +53362,7 @@ string Entities.Common.EdFi.IEducationOrganizationInterventionPrescriptionAssoci set { } } + [Key(14)] public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } /// @@ -45322,13 +53495,14 @@ namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationNetworkAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationOrganizationNetwork : EducationOrganizationAggregate.EdFi.EducationOrganization, Entities.Common.EdFi.IEducationOrganizationNetwork, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public EducationOrganizationNetwork() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -45337,6 +53511,7 @@ public EducationOrganizationNetwork() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual long EducationOrganizationNetworkId { get { return base.EducationOrganizationId; } @@ -45373,6 +53548,7 @@ string IEducationOrganization.WebSite // ============================================================= // Properties // ------------------------------------------------------------- + [Key(17)] public virtual int NetworkPurposeDescriptorId { get @@ -45392,6 +53568,7 @@ public virtual int NetworkPurposeDescriptorId private int _networkPurposeDescriptorId; private string _networkPurposeDescriptor; + [IgnoreMember] public virtual string NetworkPurposeDescriptor { get @@ -45419,14 +53596,27 @@ public virtual string NetworkPurposeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganizationNetwork", "EducationOrganizationNetwork")] + [Key(18)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -45445,7 +53635,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganizationNetwork", "EducationOrganizationNetwork")] + [Key(19)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -45558,24 +53788,29 @@ namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationNetworkAssociationAg /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class EducationOrganizationNetworkAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationNetworkId { get; set; } + [Key(1)] public virtual long MemberEducationOrganizationId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -45641,6 +53876,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationOrganizationNetworkAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IEducationOrganizationNetworkAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -45648,8 +53884,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public EducationOrganizationNetworkAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -45658,8 +53894,10 @@ public EducationOrganizationNetworkAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationNetworkId { get; set; } [DomainSignature] + [Key(7)] public virtual long MemberEducationOrganizationId { get; set; } // ------------------------------------------------------------- @@ -45671,6 +53909,7 @@ public EducationOrganizationNetworkAssociation() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual DateTime? BeginDate { get { return _beginDate; } @@ -45690,6 +53929,7 @@ public virtual DateTime? BeginDate private DateTime? _beginDate; + [Key(9)] public virtual DateTime? EndDate { get { return _endDate; } @@ -45721,14 +53961,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganizationNetworkAssociation", "EducationOrganizationNetworkAssociation")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -45747,12 +54000,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganizationNetworkAssociation", "EducationOrganizationNetworkAssociation")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationNetworkReferenceData { get; set; } /// @@ -45764,6 +54058,7 @@ public IDictionary Extensions set { } } + [Key(13)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MemberEducationOrganizationReferenceData { get; set; } /// @@ -45890,24 +54185,29 @@ namespace EdFi.Ods.Entities.NHibernate.EducationOrganizationPeerAssociationAggre /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class EducationOrganizationPeerAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual long PeerEducationOrganizationId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -45973,6 +54273,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationOrganizationPeerAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IEducationOrganizationPeerAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -45980,8 +54281,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public EducationOrganizationPeerAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -45990,8 +54291,10 @@ public EducationOrganizationPeerAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual long PeerEducationOrganizationId { get; set; } // ------------------------------------------------------------- @@ -46015,14 +54318,27 @@ public EducationOrganizationPeerAssociation() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationOrganizationPeerAssociation", "EducationOrganizationPeerAssociation")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -46041,12 +54357,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationOrganizationPeerAssociation", "EducationOrganizationPeerAssociation")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(10)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -46067,6 +54424,7 @@ string Entities.Common.EdFi.IEducationOrganizationPeerAssociation.EducationOrgan set { } } + [Key(11)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData PeerEducationOrganizationReferenceData { get; set; } /// @@ -46198,6 +54556,7 @@ namespace EdFi.Ods.Entities.NHibernate.EducationPlanDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationPlanDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEducationPlanDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -46206,6 +54565,7 @@ public class EducationPlanDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EducationPlanDescriptorId { get { return base.DescriptorId; } @@ -46377,13 +54737,14 @@ namespace EdFi.Ods.Entities.NHibernate.EducationServiceCenterAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EducationServiceCenter : EducationOrganizationAggregate.EdFi.EducationOrganization, Entities.Common.EdFi.IEducationServiceCenter, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public EducationServiceCenter() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -46392,6 +54753,7 @@ public EducationServiceCenter() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual long EducationServiceCenterId { get { return base.EducationOrganizationId; } @@ -46428,6 +54790,7 @@ string IEducationOrganization.WebSite // ============================================================= // Properties // ------------------------------------------------------------- + [Key(17)] public virtual long? StateEducationAgencyId { get; set; } // ------------------------------------------------------------- @@ -46441,14 +54804,27 @@ string IEducationOrganization.WebSite // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EducationServiceCenter", "EducationServiceCenter")] + [Key(18)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -46467,12 +54843,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EducationServiceCenter", "EducationServiceCenter")] + [Key(19)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(20)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData StateEducationAgencyReferenceData { get; set; } /// @@ -46595,6 +55012,7 @@ namespace EdFi.Ods.Entities.NHibernate.ElectronicMailTypeDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ElectronicMailTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IElectronicMailTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -46603,6 +55021,7 @@ public class ElectronicMailTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ElectronicMailTypeDescriptorId { get { return base.DescriptorId; } @@ -46774,6 +55193,7 @@ namespace EdFi.Ods.Entities.NHibernate.EligibilityDelayReasonDescriptorAggregate /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EligibilityDelayReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEligibilityDelayReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -46782,6 +55202,7 @@ public class EligibilityDelayReasonDescriptor : DescriptorAggregate.EdFi.Descrip // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EligibilityDelayReasonDescriptorId { get { return base.DescriptorId; } @@ -46953,6 +55374,7 @@ namespace EdFi.Ods.Entities.NHibernate.EligibilityEvaluationTypeDescriptorAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EligibilityEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEligibilityEvaluationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -46961,6 +55383,7 @@ public class EligibilityEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Desc // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EligibilityEvaluationTypeDescriptorId { get { return base.DescriptorId; } @@ -47132,6 +55555,7 @@ namespace EdFi.Ods.Entities.NHibernate.EmploymentStatusDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EmploymentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEmploymentStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -47140,6 +55564,7 @@ public class EmploymentStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EmploymentStatusDescriptorId { get { return base.DescriptorId; } @@ -47311,6 +55736,7 @@ namespace EdFi.Ods.Entities.NHibernate.EnrollmentTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EnrollmentTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEnrollmentTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -47319,6 +55745,7 @@ public class EnrollmentTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EnrollmentTypeDescriptorId { get { return base.DescriptorId; } @@ -47490,6 +55917,7 @@ namespace EdFi.Ods.Entities.NHibernate.EntryGradeLevelReasonDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EntryGradeLevelReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEntryGradeLevelReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -47498,6 +55926,7 @@ public class EntryGradeLevelReasonDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EntryGradeLevelReasonDescriptorId { get { return base.DescriptorId; } @@ -47669,6 +56098,7 @@ namespace EdFi.Ods.Entities.NHibernate.EntryTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEntryTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -47677,6 +56107,7 @@ public class EntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EntryTypeDescriptorId { get { return base.DescriptorId; } @@ -47848,6 +56279,7 @@ namespace EdFi.Ods.Entities.NHibernate.EvaluationDelayReasonDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EvaluationDelayReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEvaluationDelayReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -47856,6 +56288,7 @@ public class EvaluationDelayReasonDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EvaluationDelayReasonDescriptorId { get { return base.DescriptorId; } @@ -48022,30 +56455,41 @@ namespace EdFi.Ods.Entities.NHibernate.EvaluationRubricDimensionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class EvaluationRubricDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int EvaluationRubricRating { get; set; } + [Key(1)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(2)] public virtual string ProgramEvaluationElementTitle { get; set; } + [Key(3)] public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + [Key(4)] public virtual string ProgramEvaluationTitle { get; set; } + [Key(5)] public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + [Key(6)] public virtual string ProgramName { get; set; } + [Key(7)] public virtual int ProgramTypeDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(8)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(9)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -48117,6 +56561,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EvaluationRubricDimension : AggregateRootWithCompositeKey, Entities.Common.EdFi.IEvaluationRubricDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -48124,8 +56569,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public EvaluationRubricDimension() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -48134,12 +56579,16 @@ public EvaluationRubricDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int EvaluationRubricRating { get; set; } [DomainSignature] + [Key(7)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual string ProgramEvaluationElementTitle { get; set; } [DomainSignature] + [Key(9)] public virtual int ProgramEvaluationPeriodDescriptorId { get @@ -48159,6 +56608,7 @@ public virtual int ProgramEvaluationPeriodDescriptorId private int _programEvaluationPeriodDescriptorId; private string _programEvaluationPeriodDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationPeriodDescriptor { get @@ -48175,8 +56625,10 @@ public virtual string ProgramEvaluationPeriodDescriptor } } [DomainSignature] + [Key(10)] public virtual string ProgramEvaluationTitle { get; set; } [DomainSignature] + [Key(11)] public virtual int ProgramEvaluationTypeDescriptorId { get @@ -48196,6 +56648,7 @@ public virtual int ProgramEvaluationTypeDescriptorId private int _programEvaluationTypeDescriptorId; private string _programEvaluationTypeDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationTypeDescriptor { get @@ -48212,8 +56665,10 @@ public virtual string ProgramEvaluationTypeDescriptor } } [DomainSignature] + [Key(12)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(13)] public virtual int ProgramTypeDescriptorId { get @@ -48233,6 +56688,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -48258,7 +56714,9 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(14)] public virtual string EvaluationCriterionDescription { get; set; } + [Key(15)] public virtual int? EvaluationRubricRatingLevelDescriptorId { get @@ -48278,6 +56736,7 @@ public virtual int? EvaluationRubricRatingLevelDescriptorId private int? _evaluationRubricRatingLevelDescriptorId; private string _evaluationRubricRatingLevelDescriptor; + [IgnoreMember] public virtual string EvaluationRubricRatingLevelDescriptor { get @@ -48293,6 +56752,7 @@ public virtual string EvaluationRubricRatingLevelDescriptor _evaluationRubricRatingLevelDescriptorId = default(int?); } } + [Key(16)] public virtual int? RubricDimensionSortOrder { get; set; } // ------------------------------------------------------------- @@ -48306,14 +56766,27 @@ public virtual string EvaluationRubricRatingLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "EvaluationRubricDimension", "EvaluationRubricDimension")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -48332,12 +56805,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "EvaluationRubricDimension", "EvaluationRubricDimension")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(19)] public virtual NHibernate.ProgramEvaluationElementAggregate.EdFi.ProgramEvaluationElementReferenceData ProgramEvaluationElementReferenceData { get; set; } /// @@ -48479,6 +56993,7 @@ namespace EdFi.Ods.Entities.NHibernate.EventCircumstanceDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class EventCircumstanceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IEventCircumstanceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -48487,6 +57002,7 @@ public class EventCircumstanceDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int EventCircumstanceDescriptorId { get { return base.DescriptorId; } @@ -48658,6 +57174,7 @@ namespace EdFi.Ods.Entities.NHibernate.ExitWithdrawTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ExitWithdrawTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IExitWithdrawTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -48666,6 +57183,7 @@ public class ExitWithdrawTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ExitWithdrawTypeDescriptorId { get { return base.DescriptorId; } @@ -48832,25 +57350,31 @@ namespace EdFi.Ods.Entities.NHibernate.FeederSchoolAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class FeederSchoolAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual long FeederSchoolId { get; set; } + [Key(2)] public virtual long SchoolId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -48917,6 +57441,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class FeederSchoolAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IFeederSchoolAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -48924,8 +57449,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public FeederSchoolAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -48934,6 +57459,7 @@ public FeederSchoolAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -48944,8 +57470,10 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual long FeederSchoolId { get; set; } [DomainSignature] + [Key(8)] public virtual long SchoolId { get; set; } // ------------------------------------------------------------- @@ -48957,6 +57485,7 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual DateTime? EndDate { get { return _endDate; } @@ -48976,6 +57505,7 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(10)] public virtual string FeederRelationshipDescription { get; set; } // ------------------------------------------------------------- @@ -48989,14 +57519,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "FeederSchoolAssociation", "FeederSchoolAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -49015,533 +57558,83 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData FeederSchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the FeederSchool resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolResourceId - { - get { return FeederSchoolReferenceData?.Id; } - set { } - } - - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - - /// - /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IFeederSchoolAssociation.SchoolResourceId - { - get { return SchoolReferenceData?.Id; } - set { } - } - - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("FeederSchoolId", FeederSchoolId); - keyValues.Add("SchoolId", SchoolId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (entry.Value is string) - { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) - { - return false; - } - } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IFeederSchoolAssociation)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IFeederSchoolAssociation) target, null); - } - - } -} -// Aggregate: FinancialCollectionDescriptor - -namespace EdFi.Ods.Entities.NHibernate.FinancialCollectionDescriptorAggregate.EdFi -{ -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.FinancialCollectionDescriptor table of the FinancialCollectionDescriptor aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class FinancialCollectionDescriptor : DescriptorAggregate.EdFi.Descriptor, - Entities.Common.EdFi.IFinancialCollectionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor - { - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual int FinancialCollectionDescriptorId - { - get { return base.DescriptorId; } - set { base.DescriptorId = value; } - } - - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - string IDescriptor.CodeValue - { - get { return CodeValue; } - set { CodeValue = value; } - } - string IDescriptor.Description - { - get { return Description; } - set { Description = value; } - } - DateTime? IDescriptor.EffectiveBeginDate - { - get { return EffectiveBeginDate; } - set { EffectiveBeginDate = value; } - } - DateTime? IDescriptor.EffectiveEndDate - { - get { return EffectiveEndDate; } - set { EffectiveEndDate = value; } - } - string IDescriptor.Namespace - { - get { return Namespace; } - set { Namespace = value; } - } - string IDescriptor.ShortDescription - { - get { return ShortDescription; } - set { ShortDescription = value; } - } - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Reference Data - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // Provide lookup property map - private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - }; - - Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty - { - get { return _idPropertyByLookupProperty; } - } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("FinancialCollectionDescriptorId", FinancialCollectionDescriptorId); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); + private IDictionary _aggregateExtensions; - foreach (DictionaryEntry entry in theseKeys) + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "FeederSchoolAssociation", "FeederSchoolAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get { - if (entry.Value is string) + foreach (var key in _aggregateExtensions.Keys) { - if (!GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer.Equals((string) entry.Value, (string) thoseKeys[entry.Key])) + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) { - return false; + collection.ReattachAggregateExtension(this, (string) key); } } - else - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - if (entry.Value is string) - { - hashCode.Add(entry.Value as string, GeneratedArtifactStaticDependencies.DatabaseEngineSpecificStringComparer); - } - else - { - hashCode.Add(entry.Value); - } - } - - return hashCode.ToHashCode(); - } - #endregion - bool ISynchronizable.Synchronize(object target) - { - return this.SynchronizeTo((Entities.Common.EdFi.IFinancialCollectionDescriptor)target); - } - - void IMappable.Map(object target) - { - this.MapTo((Entities.Common.EdFi.IFinancialCollectionDescriptor) target, null); - } - - } -} -// Aggregate: FunctionDimension - -namespace EdFi.Ods.Entities.NHibernate.FunctionDimensionAggregate.EdFi -{ - /// - /// Represents a read-only reference to the entity. - /// - public class FunctionDimensionReferenceData : IHasPrimaryKeyValues - { - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - public virtual string Code { get; set; } - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - /// - /// The id of the referenced entity (used as the resource identifier in the API). - /// - public virtual Guid? Id { get; set; } - - /// - /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity - /// when that entity has been derived; otherwise null. - /// - public virtual string Discriminator { get; set; } - - // Provide primary key information - OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() - { - // Initialize a new dictionary to hold the key values - var keyValues = new OrderedDictionary(); - - // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); - - return keyValues; - } - - #region Overrides for Equals() and GetHashCode() - public override bool Equals(object obj) - { - var compareTo = obj as IHasPrimaryKeyValues; - - if (ReferenceEquals(this, compareTo)) - return true; - - if (compareTo == null) - return false; - - var theseKeys = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - var thoseKeys = compareTo.GetPrimaryKeyValues(); - - foreach (DictionaryEntry entry in theseKeys) - { - if (!entry.Value.Equals(thoseKeys[entry.Key])) - return false; - } - - return true; - } - - public override int GetHashCode() - { - var keyValues = (this as IHasPrimaryKeyValues).GetPrimaryKeyValues(); - - if (keyValues.Count == 0) - return base.GetHashCode(); - - var hashCode = new HashCode(); - - foreach (DictionaryEntry entry in keyValues) - { - hashCode.Add(entry.Value); + return _aggregateExtensions; } - - return hashCode.ToHashCode(); - } - #endregion - } - -// disable warnings for inheritance from classes marked Obsolete within this generated code only -#pragma warning disable 612, 618 - - /// - /// A class which represents the edfi.FunctionDimension table of the FunctionDimension aggregate in the ODS database. - /// - [Schema("edfi")] - [ExcludeFromCodeCoverage] - public class FunctionDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IFunctionDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions - { - public virtual void SuspendReferenceAssignmentCheck() { } - - public FunctionDimension() - { - FunctionDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 - - // ============================================================= - // Primary Key - // ------------------------------------------------------------- - [DomainSignature] - public virtual string Code { get; set; } - [DomainSignature] - public virtual int FiscalYear { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual string CodeName { get; set; } - // ------------------------------------------------------------- - - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; set { - // If the _extensions is null, this is being assigned from the constructor + // If the _aggregateExtensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_aggregateExtensions != null && value != null) { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) + foreach (var key in _aggregateExtensions.Keys) { if (!value.Contains(key)) { - value[key] = _extensions[key]; + value[key] = _aggregateExtensions[key]; } } } - _extensions = value; + _aggregateExtensions = value; } } - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - // ------------------------------------------------------------- - - //============================================================= - // Collections - // ------------------------------------------------------------- + [Key(13)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData FeederSchoolReferenceData { get; set; } - private ICollection _functionDimensionReportingTags; - private ICollection _functionDimensionReportingTagsCovariant; - public virtual ICollection FunctionDimensionReportingTags + /// + /// Read-only property that allows the FeederSchool resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IFeederSchoolAssociation.FeederSchoolResourceId { - get - { - // ------------------------------------------------------------- - // On-demand deserialization logic to attach reverse reference of children - // due to ServiceStack's lack of [OnDeserialized] attribute support. - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _functionDimensionReportingTags) - if (item.FunctionDimension == null) - item.FunctionDimension = this; - // ------------------------------------------------------------- - - return _functionDimensionReportingTags; - } - set - { - _functionDimensionReportingTags = value; - _functionDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); - } + get { return FeederSchoolReferenceData?.Id; } + set { } } - // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IFunctionDimension.FunctionDimensionReportingTags - { - get - { - // ------------------------------------------------------------- - // Back-reference is required by NHibernate for persistence. - // ------------------------------------------------------------- - foreach (var item in _functionDimensionReportingTags) - if (item.FunctionDimension == null) - item.FunctionDimension = this; - // ------------------------------------------------------------- + [Key(14)] + public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } - return _functionDimensionReportingTagsCovariant; - } - set - { - FunctionDimensionReportingTags = new HashSet(value.Cast()); - } + /// + /// Read-only property that allows the School resource identifier value to be mapped to the resource reference. + /// + Guid? Entities.Common.EdFi.IFeederSchoolAssociation.SchoolResourceId + { + get { return SchoolReferenceData?.Id; } + set { } } // ------------------------------------------------------------- + //============================================================= + // Collections + // ------------------------------------------------------------- + // ------------------------------------------------------------- + // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { @@ -49559,8 +57652,9 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("Code", Code); - keyValues.Add("FiscalYear", FiscalYear); + keyValues.Add("BeginDate", BeginDate); + keyValues.Add("FeederSchoolId", FeederSchoolId); + keyValues.Add("SchoolId", SchoolId); return keyValues; } @@ -49624,88 +57718,79 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFeederSchoolAssociation)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFunctionDimension) target, null); + this.MapTo((Entities.Common.EdFi.IFeederSchoolAssociation) target, null); } } +} +// Aggregate: FinancialCollectionDescriptor + +namespace EdFi.Ods.Entities.NHibernate.FinancialCollectionDescriptorAggregate.EdFi +{ // disable warnings for inheritance from classes marked Obsolete within this generated code only #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FunctionDimensionReportingTag table of the FunctionDimension aggregate in the ODS database. + /// A class which represents the edfi.FinancialCollectionDescriptor table of the FinancialCollectionDescriptor aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FunctionDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IFunctionDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class FinancialCollectionDescriptor : DescriptorAggregate.EdFi.Descriptor, + Entities.Common.EdFi.IFinancialCollectionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { - public virtual void SuspendReferenceAssignmentCheck() { } - - public FunctionDimensionReportingTag() - { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); - } -// restore warnings for inheritance from classes marked Obsolete -#pragma warning restore 612, 618 // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual FunctionDimension FunctionDimension { get; set; } - - Entities.Common.EdFi.IFunctionDimension IFunctionDimensionReportingTag.FunctionDimension - { - get { return FunctionDimension; } - set { FunctionDimension = (FunctionDimension) value; } - } - [DomainSignature] - public virtual int ReportingTagDescriptorId - { - get - { - if (_reportingTagDescriptorId == default(int)) - _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - - return _reportingTagDescriptorId; - } - set - { - _reportingTagDescriptorId = value; - _reportingTagDescriptor = null; - } - } - - private int _reportingTagDescriptorId; - private string _reportingTagDescriptor; - - public virtual string ReportingTagDescriptor + [IgnoreMember] + public virtual int FinancialCollectionDescriptorId { - get - { - if (_reportingTagDescriptor == null) - _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - - return _reportingTagDescriptor; - } - set - { - _reportingTagDescriptor = value; - _reportingTagDescriptorId = default(int); - } + get { return base.DescriptorId; } + set { base.DescriptorId = value; } } + // ------------------------------------------------------------- // ============================================================= // Inherited Properties // ------------------------------------------------------------- + string IDescriptor.CodeValue + { + get { return CodeValue; } + set { CodeValue = value; } + } + string IDescriptor.Description + { + get { return Description; } + set { Description = value; } + } + DateTime? IDescriptor.EffectiveBeginDate + { + get { return EffectiveBeginDate; } + set { EffectiveBeginDate = value; } + } + DateTime? IDescriptor.EffectiveEndDate + { + get { return EffectiveEndDate; } + set { EffectiveEndDate = value; } + } + string IDescriptor.Namespace + { + get { return Namespace; } + set { Namespace = value; } + } + string IDescriptor.ShortDescription + { + get { return ShortDescription; } + set { ShortDescription = value; } + } // ------------------------------------------------------------- // ============================================================= @@ -49721,35 +57806,6 @@ public virtual string ReportingTagDescriptor // ============================================================= // Extensions // ------------------------------------------------------------- - private IDictionary _extensions; - - public IDictionary Extensions - { - get => _extensions; - set - { - // If the _extensions is null, this is being assigned from the constructor - // for the first time and no special handling is required - if (_extensions != null) - { - // For extensions that have already been initialized by the extensions factory, - // we need to copy any "implicit" extension object entries over to the incoming - // value dictionary being assigned by NHibernate because it won't have them, - // but they must be there for correct handling of extensions for the API. - foreach (var key in _extensions.Keys) - { - if (!value.Contains(key)) - { - value[key] = _extensions[key]; - } - } - } - - _extensions = value; - } - } - - public IDictionary AggregateExtensions { get; set; } // ------------------------------------------------------------- // ============================================================= @@ -49765,7 +57821,6 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -49776,11 +57831,11 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy // Provide primary key information OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { - // Get parent key values - var keyValues = (FunctionDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + // Initialize a new dictionary to hold the key values + var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); + keyValues.Add("FinancialCollectionDescriptorId", FinancialCollectionDescriptorId); return keyValues; } @@ -49844,45 +57899,46 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFinancialCollectionDescriptor)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFunctionDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IFinancialCollectionDescriptor) target, null); } - void IChildEntity.SetParent(object value) - { - FunctionDimension = (FunctionDimension) value; - } } } -// Aggregate: FundDimension +// Aggregate: FunctionDimension -namespace EdFi.Ods.Entities.NHibernate.FundDimensionAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.FunctionDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class FundDimensionReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class FunctionDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Code { get; set; } + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -49944,20 +58000,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FundDimension table of the FundDimension aggregate in the ODS database. + /// A class which represents the edfi.FunctionDimension table of the FunctionDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FundDimension : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IFundDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class FunctionDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IFunctionDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public FundDimension() + public FunctionDimension() { - FundDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + FunctionDimensionReportingTags = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -49966,8 +58023,10 @@ public FundDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Code { get; set; } [DomainSignature] + [Key(7)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -49979,6 +58038,7 @@ public FundDimension() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual string CodeName { get; set; } // ------------------------------------------------------------- @@ -49992,14 +58052,27 @@ public FundDimension() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "FunctionDimension", "FunctionDimension")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -50018,7 +58091,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "FunctionDimension", "FunctionDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -50030,9 +58143,11 @@ public IDictionary Extensions // Collections // ------------------------------------------------------------- - private ICollection _fundDimensionReportingTags; - private ICollection _fundDimensionReportingTagsCovariant; - public virtual ICollection FundDimensionReportingTags + private ICollection _functionDimensionReportingTags; + private ICollection _functionDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection FunctionDimensionReportingTags { get { @@ -50041,38 +58156,43 @@ public virtual ICollection set) + { + set.Reattach(this, "FunctionDimensionReportingTags"); + } + + foreach (var item in _functionDimensionReportingTags) + if (item.FunctionDimension == null) + item.FunctionDimension = this; // ------------------------------------------------------------- - return _fundDimensionReportingTags; + return _functionDimensionReportingTags; } set { - _fundDimensionReportingTags = value; - _fundDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); + _functionDimensionReportingTags = value; + _functionDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IFundDimension.FundDimensionReportingTags + ICollection Entities.Common.EdFi.IFunctionDimension.FunctionDimensionReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _fundDimensionReportingTags) - if (item.FundDimension == null) - item.FundDimension = this; + foreach (var item in _functionDimensionReportingTags) + if (item.FunctionDimension == null) + item.FunctionDimension = this; // ------------------------------------------------------------- - return _fundDimensionReportingTagsCovariant; + return _functionDimensionReportingTagsCovariant; } set { - FundDimensionReportingTags = new HashSet(value.Cast()); + FunctionDimensionReportingTags = new HashSet(value.Cast()); } } @@ -50160,12 +58280,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFundDimension)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFundDimension) target, null); + this.MapTo((Entities.Common.EdFi.IFunctionDimension) target, null); } } @@ -50173,19 +58293,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.FundDimensionReportingTag table of the FundDimension aggregate in the ODS database. + /// A class which represents the edfi.FunctionDimensionReportingTag table of the FunctionDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class FundDimensionReportingTag : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IFundDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class FunctionDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IFunctionDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public FundDimensionReportingTag() + public FunctionDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -50193,16 +58314,17 @@ public FundDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual FundDimension FundDimension { get; set; } + [DomainSignature, IgnoreMember] + public virtual FunctionDimension FunctionDimension { get; set; } - Entities.Common.EdFi.IFundDimension IFundDimensionReportingTag.FundDimension + Entities.Common.EdFi.IFunctionDimension IFunctionDimensionReportingTag.FunctionDimension { - get { return FundDimension; } - set { FundDimension = (FundDimension) value; } + get { return FunctionDimension; } + set { FunctionDimension = (FunctionDimension) value; } } [DomainSignature] + [Key(1)] public virtual int ReportingTagDescriptorId { get @@ -50222,6 +58344,7 @@ public virtual int ReportingTagDescriptorId private int _reportingTagDescriptorId; private string _reportingTagDescriptor; + [IgnoreMember] public virtual string ReportingTagDescriptor { get @@ -50259,14 +58382,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "FunctionDimension", "FunctionDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -50285,7 +58421,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "FunctionDimension", "FunctionDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -50313,7 +58489,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (FundDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (FunctionDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -50380,49 +58556,50 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IFundDimensionReportingTag)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFunctionDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IFundDimensionReportingTag) target, null); + this.MapTo((Entities.Common.EdFi.IFunctionDimensionReportingTag) target, null); } void IChildEntity.SetParent(object value) { - FundDimension = (FundDimension) value; + FunctionDimension = (FunctionDimension) value; } } } -// Aggregate: GeneralStudentProgramAssociation +// Aggregate: FundDimension -namespace EdFi.Ods.Entities.NHibernate.GeneralStudentProgramAssociationAggregate.EdFi +namespace EdFi.Ods.Entities.NHibernate.FundDimensionAggregate.EdFi { /// - /// Represents a read-only reference to the entity. + /// Represents a read-only reference to the entity. /// - public class GeneralStudentProgramAssociationReferenceData : IHasPrimaryKeyValues + [MessagePackObject] + public class FundDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual DateTime BeginDate { get; set; } - public virtual long EducationOrganizationId { get; set; } - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId { get; set; } - public virtual int StudentUSI { get; set; } + [Key(0)] + public virtual string Code { get; set; } + [Key(1)] + public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -50432,12 +58609,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -50488,18 +58661,21 @@ public override int GetHashCode() #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GeneralStudentProgramAssociation table of the GeneralStudentProgramAssociation aggregate in the ODS database. + /// A class which represents the edfi.FundDimension table of the FundDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GeneralStudentProgramAssociation : AggregateRootWithCompositeKey, - Entities.Common.EdFi.IGeneralStudentProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap + [MessagePackObject] + public class FundDimension : AggregateRootWithCompositeKey, + Entities.Common.EdFi.IFundDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GeneralStudentProgramAssociation() + public FundDimension() { - GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(); + FundDimensionReportingTags = new HashSet(); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -50507,248 +58683,132 @@ public GeneralStudentProgramAssociation() // ============================================================= // Primary Key // ------------------------------------------------------------- - public virtual DateTime BeginDate - { - get { return _beginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _beginDate = new DateTime(value.Year, value.Month, value.Day); } - } + [DomainSignature] + [Key(6)] + public virtual string Code { get; set; } + [DomainSignature] + [Key(7)] + public virtual int FiscalYear { get; set; } + // ------------------------------------------------------------- - private DateTime _beginDate; - - public virtual long EducationOrganizationId { get; set; } - public virtual long ProgramEducationOrganizationId { get; set; } - public virtual string ProgramName { get; set; } - public virtual int ProgramTypeDescriptorId - { - get - { - if (_programTypeDescriptorId == default(int)) - _programTypeDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ProgramTypeDescriptor", _programTypeDescriptor); + // ============================================================= + // Inherited Properties + // ------------------------------------------------------------- + // ------------------------------------------------------------- - return _programTypeDescriptorId; - } - set - { - _programTypeDescriptorId = value; - _programTypeDescriptor = null; - } - } + // ============================================================= + // Properties + // ------------------------------------------------------------- + [Key(8)] + public virtual string CodeName { get; set; } + // ------------------------------------------------------------- - private int _programTypeDescriptorId; - private string _programTypeDescriptor; + // ============================================================= + // One-to-one relationships + // ------------------------------------------------------------- + // ------------------------------------------------------------- - public virtual string ProgramTypeDescriptor + // ============================================================= + // Extensions + // ------------------------------------------------------------- + private IDictionary _extensions; + + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "FundDimension", "FundDimension")] + [Key(9)] + public IDictionary Extensions { - get + get { - if (_programTypeDescriptor == null) - _programTypeDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ProgramTypeDescriptor", _programTypeDescriptorId); - - return _programTypeDescriptor; + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; } set { - _programTypeDescriptor = value; - _programTypeDescriptorId = default(int); - } - } - public virtual int StudentUSI - { - get - { - if (_studentUSI == default(int) && _studentUniqueId != null) + // If the _extensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_extensions != null && value != null) { - if (GeneratedArtifactStaticDependencies.UsiLookupsByUniqueIdContextProvider.Get().UsiByUniqueIdByPersonType.TryGetValue("Student", out var usiByUniqueId) - && usiByUniqueId.TryGetValue(_studentUniqueId, out var usi)) + // For extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" extension object entries over to the incoming + // value dictionary being assigned by NHibernate because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _extensions.Keys) { - _studentUSI = usi; + if (!value.Contains(key)) + { + value[key] = _extensions[key]; + } } } - return _studentUSI; - } - set - { - _studentUSI = value; - GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().AddLookup("Student", value); + _extensions = value; } } - private int _studentUSI; - private string _studentUniqueId; + private IDictionary _aggregateExtensions; - public virtual string StudentUniqueId - { + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "FundDimension", "FundDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { get { - if (_studentUniqueId == null) + foreach (var key in _aggregateExtensions.Keys) { - if (GeneratedArtifactStaticDependencies.UniqueIdLookupsByUsiContextProvider.Get().UniqueIdByUsiByPersonType.TryGetValue("Student", out var uniqueIdByUsi) - && uniqueIdByUsi.TryGetValue(_studentUSI, out var uniqueId)) + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) { - _studentUniqueId = uniqueId; + collection.ReattachAggregateExtension(this, (string) key); } } - return _studentUniqueId; + return _aggregateExtensions; } set { - if (_studentUniqueId != value) - _studentUSI = default(int); - - _studentUniqueId = value; - } - } - // ------------------------------------------------------------- - - // ============================================================= - // Inherited Properties - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Properties - // ------------------------------------------------------------- - public virtual DateTime? EndDate - { - get { return _endDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _endDate = null; - } else + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) { - var given = (DateTime) value; - _endDate = new DateTime(given.Year, given.Month, given.Day); + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } } - } - } - - private DateTime? _endDate; - - public virtual int? ReasonExitedDescriptorId - { - get - { - if (_reasonExitedDescriptorId == default(int?)) - _reasonExitedDescriptorId = string.IsNullOrWhiteSpace(_reasonExitedDescriptor) ? default(int?) : GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReasonExitedDescriptor", _reasonExitedDescriptor); - - return _reasonExitedDescriptorId; - } - set - { - _reasonExitedDescriptorId = value; - _reasonExitedDescriptor = null; - } - } - - private int? _reasonExitedDescriptorId; - private string _reasonExitedDescriptor; - public virtual string ReasonExitedDescriptor - { - get - { - if (_reasonExitedDescriptor == null) - _reasonExitedDescriptor = _reasonExitedDescriptorId == null ? null : GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReasonExitedDescriptor", _reasonExitedDescriptorId.Value); - - return _reasonExitedDescriptor; - } - set - { - _reasonExitedDescriptor = value; - _reasonExitedDescriptorId = default(int?); + _aggregateExtensions = value; } } - public virtual bool? ServedOutsideOfRegularSession { get; set; } - // ------------------------------------------------------------- - // ============================================================= - // One-to-one relationships - // ------------------------------------------------------------- - // ------------------------------------------------------------- - - // ============================================================= - // Extensions - // ------------------------------------------------------------- // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- - public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } - - /// - /// Read-only property that allows the EducationOrganization discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationDiscriminator - { - get { return EducationOrganizationReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the EducationOrganization resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.EducationOrganizationResourceId - { - get { return EducationOrganizationReferenceData?.Id; } - set { } - } - - public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } - - /// - /// Read-only property that allows the Program discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramDiscriminator - { - get { return ProgramReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Program resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.ProgramResourceId - { - get { return ProgramReferenceData?.Id; } - set { } - } - - public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } - - /// - /// Read-only property that allows the Student discriminator value to be mapped to the resource reference. - /// - string Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentDiscriminator - { - get { return StudentReferenceData?.Discriminator; } - set { } - } - - /// - /// Read-only property that allows the Student resource identifier value to be mapped to the resource reference. - /// - Guid? Entities.Common.EdFi.IGeneralStudentProgramAssociation.StudentResourceId - { - get { return StudentReferenceData?.Id; } - set { } - } - // ------------------------------------------------------------- //============================================================= // Collections // ------------------------------------------------------------- - private ICollection _generalStudentProgramAssociationProgramParticipationStatuses; - private ICollection _generalStudentProgramAssociationProgramParticipationStatusesCovariant; - public virtual ICollection GeneralStudentProgramAssociationProgramParticipationStatuses + private ICollection _fundDimensionReportingTags; + private ICollection _fundDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] + public virtual ICollection FundDimensionReportingTags { get { @@ -50757,38 +58817,43 @@ public virtual ICollection set) + { + set.Reattach(this, "FundDimensionReportingTags"); + } + + foreach (var item in _fundDimensionReportingTags) + if (item.FundDimension == null) + item.FundDimension = this; // ------------------------------------------------------------- - return _generalStudentProgramAssociationProgramParticipationStatuses; + return _fundDimensionReportingTags; } set { - _generalStudentProgramAssociationProgramParticipationStatuses = value; - _generalStudentProgramAssociationProgramParticipationStatusesCovariant = new CovariantCollectionAdapter(value); + _fundDimensionReportingTags = value; + _fundDimensionReportingTagsCovariant = new CovariantCollectionAdapter(value); } } // Covariant version, visible only on the interface - ICollection Entities.Common.EdFi.IGeneralStudentProgramAssociation.GeneralStudentProgramAssociationProgramParticipationStatuses + ICollection Entities.Common.EdFi.IFundDimension.FundDimensionReportingTags { get { // ------------------------------------------------------------- // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- - foreach (var item in _generalStudentProgramAssociationProgramParticipationStatuses) - if (item.GeneralStudentProgramAssociation == null) - item.GeneralStudentProgramAssociation = this; + foreach (var item in _fundDimensionReportingTags) + if (item.FundDimension == null) + item.FundDimension = this; // ------------------------------------------------------------- - return _generalStudentProgramAssociationProgramParticipationStatusesCovariant; + return _fundDimensionReportingTagsCovariant; } set { - GeneralStudentProgramAssociationProgramParticipationStatuses = new HashSet(value.Cast()); + FundDimensionReportingTags = new HashSet(value.Cast()); } } @@ -50797,8 +58862,6 @@ public virtual ICollection _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, - { "ReasonExitedDescriptor", new LookupColumnDetails { PropertyName = "ReasonExitedDescriptorId", LookupTypeName = "ReasonExitedDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -50813,12 +58876,8 @@ OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() var keyValues = new OrderedDictionary(); // Add current key values - keyValues.Add("BeginDate", BeginDate); - keyValues.Add("EducationOrganizationId", EducationOrganizationId); - keyValues.Add("ProgramEducationOrganizationId", ProgramEducationOrganizationId); - keyValues.Add("ProgramName", ProgramName); - keyValues.Add("ProgramTypeDescriptorId", ProgramTypeDescriptorId); - keyValues.Add("StudentUSI", StudentUSI); + keyValues.Add("Code", Code); + keyValues.Add("FiscalYear", FiscalYear); return keyValues; } @@ -50882,12 +58941,12 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFundDimension)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociation) target, null); + this.MapTo((Entities.Common.EdFi.IFundDimension) target, null); } } @@ -50895,19 +58954,20 @@ void IMappable.Map(object target) #pragma warning disable 612, 618 /// - /// A class which represents the edfi.GeneralStudentProgramAssociationProgramParticipationStatus table of the GeneralStudentProgramAssociation aggregate in the ODS database. + /// A class which represents the edfi.FundDimensionReportingTag table of the FundDimension aggregate in the ODS database. /// [Schema("edfi")] [ExcludeFromCodeCoverage] - public class GeneralStudentProgramAssociationProgramParticipationStatus : EntityWithCompositeKey, IChildEntity, - Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions + [MessagePackObject] + public class FundDimensionReportingTag : EntityWithCompositeKey, IChildEntity, + Entities.Common.EdFi.IFundDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public virtual void SuspendReferenceAssignmentCheck() { } - public GeneralStudentProgramAssociationProgramParticipationStatus() + public FundDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -50915,60 +58975,52 @@ public GeneralStudentProgramAssociationProgramParticipationStatus() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] - public virtual GeneralStudentProgramAssociation GeneralStudentProgramAssociation { get; set; } + [DomainSignature, IgnoreMember] + public virtual FundDimension FundDimension { get; set; } - Entities.Common.EdFi.IGeneralStudentProgramAssociation IGeneralStudentProgramAssociationProgramParticipationStatus.GeneralStudentProgramAssociation + Entities.Common.EdFi.IFundDimension IFundDimensionReportingTag.FundDimension { - get { return GeneralStudentProgramAssociation; } - set { GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; } + get { return FundDimension; } + set { FundDimension = (FundDimension) value; } } [DomainSignature] - public virtual int ParticipationStatusDescriptorId + [Key(1)] + public virtual int ReportingTagDescriptorId { get { - if (_participationStatusDescriptorId == default(int)) - _participationStatusDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ParticipationStatusDescriptor", _participationStatusDescriptor); + if (_reportingTagDescriptorId == default(int)) + _reportingTagDescriptorId = GeneratedArtifactStaticDependencies.DescriptorResolver.GetDescriptorId("ReportingTagDescriptor", _reportingTagDescriptor); - return _participationStatusDescriptorId; + return _reportingTagDescriptorId; } set { - _participationStatusDescriptorId = value; - _participationStatusDescriptor = null; + _reportingTagDescriptorId = value; + _reportingTagDescriptor = null; } } - private int _participationStatusDescriptorId; - private string _participationStatusDescriptor; + private int _reportingTagDescriptorId; + private string _reportingTagDescriptor; - public virtual string ParticipationStatusDescriptor + [IgnoreMember] + public virtual string ReportingTagDescriptor { get { - if (_participationStatusDescriptor == null) - _participationStatusDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ParticipationStatusDescriptor", _participationStatusDescriptorId); + if (_reportingTagDescriptor == null) + _reportingTagDescriptor = GeneratedArtifactStaticDependencies.DescriptorResolver.GetUri("ReportingTagDescriptor", _reportingTagDescriptorId); - return _participationStatusDescriptor; + return _reportingTagDescriptor; } set { - _participationStatusDescriptor = value; - _participationStatusDescriptorId = default(int); + _reportingTagDescriptor = value; + _reportingTagDescriptorId = default(int); } } - [DomainSignature] - public virtual DateTime StatusBeginDate - { - get { return _statusBeginDate; } - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - set { _statusBeginDate = new DateTime(value.Year, value.Month, value.Day); } - } - - private DateTime _statusBeginDate; - // ------------------------------------------------------------- // ============================================================= @@ -50979,26 +59031,6 @@ public virtual DateTime StatusBeginDate // ============================================================= // Properties // ------------------------------------------------------------- - public virtual string DesignatedBy { get; set; } - public virtual DateTime? StatusEndDate - { - get { return _statusEndDate; } - set - { - //This is only stored as a Date in the DB and NHibernate will retrieve it using the default (local) DateTime.Kind. We must ensure it is set consistently for any equality/change evaluation. - if(value == null) - { - _statusEndDate = null; - } else - { - var given = (DateTime) value; - _statusEndDate = new DateTime(given.Year, given.Month, given.Day); - } - } - } - - private DateTime? _statusEndDate; - // ------------------------------------------------------------- // ============================================================= @@ -51011,14 +59043,27 @@ public virtual DateTime? StatusEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "FundDimension", "FundDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -51037,7 +59082,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "FundDimension", "FundDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -51053,8 +59138,7 @@ public IDictionary Extensions // Provide lookup property map private static readonly Dictionary _idPropertyByLookupProperty = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { - { "ParticipationStatusDescriptor", new LookupColumnDetails { PropertyName = "ParticipationStatusDescriptorId", LookupTypeName = "ParticipationStatusDescriptor"} }, - { "ProgramTypeDescriptor", new LookupColumnDetails { PropertyName = "ProgramTypeDescriptorId", LookupTypeName = "ProgramTypeDescriptor"} }, + { "ReportingTagDescriptor", new LookupColumnDetails { PropertyName = "ReportingTagDescriptorId", LookupTypeName = "ReportingTagDescriptor"} }, }; Dictionary IHasLookupColumnPropertyMap.IdPropertyByLookupProperty @@ -51066,11 +59150,10 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GeneralStudentProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (FundDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values - keyValues.Add("ParticipationStatusDescriptorId", ParticipationStatusDescriptorId); - keyValues.Add("StatusBeginDate", StatusBeginDate); + keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); return keyValues; } @@ -51134,17 +59217,17 @@ public override int GetHashCode() #endregion bool ISynchronizable.Synchronize(object target) { - return this.SynchronizeTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus)target); + return this.SynchronizeTo((Entities.Common.EdFi.IFundDimensionReportingTag)target); } void IMappable.Map(object target) { - this.MapTo((Entities.Common.EdFi.IGeneralStudentProgramAssociationProgramParticipationStatus) target, null); + this.MapTo((Entities.Common.EdFi.IFundDimensionReportingTag) target, null); } void IChildEntity.SetParent(object value) { - GeneralStudentProgramAssociation = (GeneralStudentProgramAssociation) value; + FundDimension = (FundDimension) value; } } } @@ -51155,33 +59238,47 @@ namespace EdFi.Ods.Entities.NHibernate.GradeAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class GradeReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual int GradeTypeDescriptorId { get; set; } + [Key(2)] public virtual int GradingPeriodDescriptorId { get; set; } + [Key(3)] public virtual string GradingPeriodName { get; set; } + [Key(4)] public virtual short GradingPeriodSchoolYear { get; set; } + [Key(5)] public virtual string LocalCourseCode { get; set; } + [Key(6)] public virtual long SchoolId { get; set; } + [Key(7)] public virtual short SchoolYear { get; set; } + [Key(8)] public virtual string SectionIdentifier { get; set; } + [Key(9)] public virtual string SessionName { get; set; } + [Key(10)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(11)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(12)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -51256,6 +59353,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Grade : AggregateRootWithCompositeKey, IHasCascadableKeyValues, Entities.Common.EdFi.IGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -51264,8 +59362,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public Grade() { GradeLearningStandardGrades = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -51274,6 +59372,7 @@ public Grade() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -51284,6 +59383,7 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual int GradeTypeDescriptorId { get @@ -51303,6 +59403,7 @@ public virtual int GradeTypeDescriptorId private int _gradeTypeDescriptorId; private string _gradeTypeDescriptor; + [IgnoreMember] public virtual string GradeTypeDescriptor { get @@ -51319,6 +59420,7 @@ public virtual string GradeTypeDescriptor } } [DomainSignature] + [Key(8)] public virtual int GradingPeriodDescriptorId { get @@ -51338,6 +59440,7 @@ public virtual int GradingPeriodDescriptorId private int _gradingPeriodDescriptorId; private string _gradingPeriodDescriptor; + [IgnoreMember] public virtual string GradingPeriodDescriptor { get @@ -51354,20 +59457,28 @@ public virtual string GradingPeriodDescriptor } } [DomainSignature] + [Key(9)] public virtual string GradingPeriodName { get; set; } [DomainSignature] + [Key(10)] public virtual short GradingPeriodSchoolYear { get; set; } [DomainSignature] + [Key(11)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(12)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(13)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(14)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(15)] public virtual string SessionName { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(16)] public virtual int StudentUSI { get @@ -51393,6 +59504,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -51426,6 +59538,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(17)] public virtual DateTime? CurrentGradeAsOfDate { get { return _currentGradeAsOfDate; } @@ -51445,11 +59558,17 @@ public virtual DateTime? CurrentGradeAsOfDate private DateTime? _currentGradeAsOfDate; + [Key(18)] public virtual bool? CurrentGradeIndicator { get; set; } + [Key(19)] public virtual string DiagnosticStatement { get; set; } + [Key(20)] public virtual string GradeEarnedDescription { get; set; } + [Key(21)] public virtual string LetterGradeEarned { get; set; } + [Key(22)] public virtual decimal? NumericGradeEarned { get; set; } + [Key(23)] public virtual int? PerformanceBaseConversionDescriptorId { get @@ -51469,6 +59588,7 @@ public virtual int? PerformanceBaseConversionDescriptorId private int? _performanceBaseConversionDescriptorId; private string _performanceBaseConversionDescriptor; + [IgnoreMember] public virtual string PerformanceBaseConversionDescriptor { get @@ -51496,14 +59616,27 @@ public virtual string PerformanceBaseConversionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Grade", "Grade")] + [Key(24)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -51522,12 +59655,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Grade", "Grade")] + [Key(25)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(26)] public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// @@ -51548,6 +59722,7 @@ string Entities.Common.EdFi.IGrade.GradingPeriodDiscriminator set { } } + [Key(27)] public virtual NHibernate.StudentSectionAssociationAggregate.EdFi.StudentSectionAssociationReferenceData StudentSectionAssociationReferenceData { get; set; } /// @@ -51576,6 +59751,8 @@ string Entities.Common.EdFi.IGrade.StudentSectionAssociationDiscriminator private ICollection _gradeLearningStandardGrades; private ICollection _gradeLearningStandardGradesCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GradeLearningStandardGrades { get @@ -51585,6 +59762,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GradeLearningStandardGrades"); + } + foreach (var item in _gradeLearningStandardGrades) if (item.Grade == null) item.Grade = this; @@ -51739,6 +59921,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradeLearningStandardGrade : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGradeLearningStandardGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -51746,8 +59929,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GradeLearningStandardGrade() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -51755,7 +59938,7 @@ public GradeLearningStandardGrade() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Grade Grade { get; set; } Entities.Common.EdFi.IGrade IGradeLearningStandardGrade.Grade @@ -51765,6 +59948,7 @@ Entities.Common.EdFi.IGrade IGradeLearningStandardGrade.Grade } [DomainSignature] + [Key(1)] public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- @@ -51776,9 +59960,13 @@ Entities.Common.EdFi.IGrade IGradeLearningStandardGrade.Grade // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string DiagnosticStatement { get; set; } + [Key(3)] public virtual string LetterGradeEarned { get; set; } + [Key(4)] public virtual decimal? NumericGradeEarned { get; set; } + [Key(5)] public virtual int? PerformanceBaseConversionDescriptorId { get @@ -51798,6 +59986,7 @@ public virtual int? PerformanceBaseConversionDescriptorId private int? _performanceBaseConversionDescriptorId; private string _performanceBaseConversionDescriptor; + [IgnoreMember] public virtual string PerformanceBaseConversionDescriptor { get @@ -51825,14 +60014,27 @@ public virtual string PerformanceBaseConversionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Grade", "GradeLearningStandardGrade")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -51851,12 +60053,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Grade", "GradeLearningStandardGrade")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(8)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } /// @@ -51901,7 +60144,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Grade as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Grade as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningStandardId", LearningStandardId); @@ -51989,24 +60232,29 @@ namespace EdFi.Ods.Entities.NHibernate.GradebookEntryAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class GradebookEntryReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string GradebookEntryIdentifier { get; set; } + [Key(1)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -52072,6 +60320,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradebookEntry : AggregateRootWithCompositeKey, IHasCascadableKeyValues, Entities.Common.EdFi.IGradebookEntry, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -52080,8 +60329,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GradebookEntry() { GradebookEntryLearningStandards = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -52090,8 +60339,10 @@ public GradebookEntry() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string GradebookEntryIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -52103,6 +60354,7 @@ public GradebookEntry() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual DateTime DateAssigned { get { return _dateAssigned; } @@ -52112,7 +60364,9 @@ public virtual DateTime DateAssigned private DateTime _dateAssigned; + [Key(9)] public virtual string Description { get; set; } + [Key(10)] public virtual DateTime? DueDate { get { return _dueDate; } @@ -52132,7 +60386,9 @@ public virtual DateTime? DueDate private DateTime? _dueDate; + [Key(11)] public virtual TimeSpan? DueTime { get; set; } + [Key(12)] public virtual int? GradebookEntryTypeDescriptorId { get @@ -52152,6 +60408,7 @@ public virtual int? GradebookEntryTypeDescriptorId private int? _gradebookEntryTypeDescriptorId; private string _gradebookEntryTypeDescriptor; + [IgnoreMember] public virtual string GradebookEntryTypeDescriptor { get @@ -52167,6 +60424,7 @@ public virtual string GradebookEntryTypeDescriptor _gradebookEntryTypeDescriptorId = default(int?); } } + [Key(13)] public virtual int? GradingPeriodDescriptorId { get @@ -52186,6 +60444,7 @@ public virtual int? GradingPeriodDescriptorId private int? _gradingPeriodDescriptorId; private string _gradingPeriodDescriptor; + [IgnoreMember] public virtual string GradingPeriodDescriptor { get @@ -52201,14 +60460,23 @@ public virtual string GradingPeriodDescriptor _gradingPeriodDescriptorId = default(int?); } } + [Key(14)] public virtual string GradingPeriodName { get; set; } + [Key(15)] public virtual string LocalCourseCode { get; set; } + [Key(16)] public virtual decimal? MaxPoints { get; set; } + [Key(17)] public virtual long? SchoolId { get; set; } + [Key(18)] public virtual short? SchoolYear { get; set; } + [Key(19)] public virtual string SectionIdentifier { get; set; } + [Key(20)] public virtual string SessionName { get; set; } + [Key(21)] public virtual string SourceSectionIdentifier { get; set; } + [Key(22)] public virtual string Title { get; set; } // ------------------------------------------------------------- @@ -52222,14 +60490,27 @@ public virtual string GradingPeriodDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GradebookEntry", "GradebookEntry")] + [Key(23)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -52248,12 +60529,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GradebookEntry", "GradebookEntry")] + [Key(24)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(25)] public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// @@ -52274,6 +60596,7 @@ string Entities.Common.EdFi.IGradebookEntry.GradingPeriodDiscriminator set { } } + [Key(26)] public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// @@ -52302,6 +60625,8 @@ string Entities.Common.EdFi.IGradebookEntry.SectionDiscriminator private ICollection _gradebookEntryLearningStandards; private ICollection _gradebookEntryLearningStandardsCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GradebookEntryLearningStandards { get @@ -52311,6 +60636,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GradebookEntryLearningStandards"); + } + foreach (var item in _gradebookEntryLearningStandards) if (item.GradebookEntry == null) item.GradebookEntry = this; @@ -52455,6 +60785,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradebookEntryLearningStandard : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGradebookEntryLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -52462,8 +60793,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GradebookEntryLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -52471,7 +60802,7 @@ public GradebookEntryLearningStandard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GradebookEntry GradebookEntry { get; set; } Entities.Common.EdFi.IGradebookEntry IGradebookEntryLearningStandard.GradebookEntry @@ -52481,6 +60812,7 @@ Entities.Common.EdFi.IGradebookEntry IGradebookEntryLearningStandard.GradebookEn } [DomainSignature] + [Key(1)] public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- @@ -52504,14 +60836,27 @@ Entities.Common.EdFi.IGradebookEntry IGradebookEntryLearningStandard.GradebookEn // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GradebookEntry", "GradebookEntryLearningStandard")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -52530,12 +60875,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GradebookEntry", "GradebookEntryLearningStandard")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } /// @@ -52577,7 +60963,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GradebookEntry as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GradebookEntry as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningStandardId", LearningStandardId); @@ -52670,6 +61056,7 @@ namespace EdFi.Ods.Entities.NHibernate.GradebookEntryTypeDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradebookEntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IGradebookEntryTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -52678,6 +61065,7 @@ public class GradebookEntryTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int GradebookEntryTypeDescriptorId { get { return base.DescriptorId; } @@ -52849,6 +61237,7 @@ namespace EdFi.Ods.Entities.NHibernate.GradeLevelDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradeLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IGradeLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -52857,6 +61246,7 @@ public class GradeLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int GradeLevelDescriptorId { get { return base.DescriptorId; } @@ -53028,6 +61418,7 @@ namespace EdFi.Ods.Entities.NHibernate.GradePointAverageTypeDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradePointAverageTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IGradePointAverageTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -53036,6 +61427,7 @@ public class GradePointAverageTypeDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int GradePointAverageTypeDescriptorId { get { return base.DescriptorId; } @@ -53207,6 +61599,7 @@ namespace EdFi.Ods.Entities.NHibernate.GradeTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IGradeTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -53215,6 +61608,7 @@ public class GradeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int GradeTypeDescriptorId { get { return base.DescriptorId; } @@ -53381,26 +61775,33 @@ namespace EdFi.Ods.Entities.NHibernate.GradingPeriodAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class GradingPeriodReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int GradingPeriodDescriptorId { get; set; } + [Key(1)] public virtual string GradingPeriodName { get; set; } + [Key(2)] public virtual long SchoolId { get; set; } + [Key(3)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -53468,6 +61869,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradingPeriod : AggregateRootWithCompositeKey, Entities.Common.EdFi.IGradingPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -53475,8 +61877,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GradingPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -53485,6 +61887,7 @@ public GradingPeriod() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int GradingPeriodDescriptorId { get @@ -53504,6 +61907,7 @@ public virtual int GradingPeriodDescriptorId private int _gradingPeriodDescriptorId; private string _gradingPeriodDescriptor; + [IgnoreMember] public virtual string GradingPeriodDescriptor { get @@ -53520,10 +61924,13 @@ public virtual string GradingPeriodDescriptor } } [DomainSignature] + [Key(7)] public virtual string GradingPeriodName { get; set; } [DomainSignature] + [Key(8)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(9)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- @@ -53535,6 +61942,7 @@ public virtual string GradingPeriodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -53544,6 +61952,7 @@ public virtual DateTime BeginDate private DateTime _beginDate; + [Key(11)] public virtual DateTime EndDate { get { return _endDate; } @@ -53553,7 +61962,9 @@ public virtual DateTime EndDate private DateTime _endDate; + [Key(12)] public virtual int? PeriodSequence { get; set; } + [Key(13)] public virtual int TotalInstructionalDays { get; set; } // ------------------------------------------------------------- @@ -53567,14 +61978,27 @@ public virtual DateTime EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GradingPeriod", "GradingPeriod")] + [Key(14)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -53593,12 +62017,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GradingPeriod", "GradingPeriod")] + [Key(15)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(16)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// @@ -53610,6 +62075,7 @@ public IDictionary Extensions set { } } + [Key(17)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -53735,6 +62201,7 @@ namespace EdFi.Ods.Entities.NHibernate.GradingPeriodDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GradingPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IGradingPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -53743,6 +62210,7 @@ public class GradingPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int GradingPeriodDescriptorId { get { return base.DescriptorId; } @@ -53909,25 +62377,31 @@ namespace EdFi.Ods.Entities.NHibernate.GraduationPlanAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class GraduationPlanReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual int GraduationPlanTypeDescriptorId { get; set; } + [Key(2)] public virtual short GraduationSchoolYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -53994,6 +62468,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlan : AggregateRootWithCompositeKey, Entities.Common.EdFi.IGraduationPlan, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -54005,8 +62480,8 @@ public GraduationPlan() GraduationPlanCreditsByCreditCategories = new HashSet(); GraduationPlanCreditsBySubjects = new HashSet(); GraduationPlanRequiredAssessments = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -54015,8 +62490,10 @@ public GraduationPlan() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual int GraduationPlanTypeDescriptorId { get @@ -54036,6 +62513,7 @@ public virtual int GraduationPlanTypeDescriptorId private int _graduationPlanTypeDescriptorId; private string _graduationPlanTypeDescriptor; + [IgnoreMember] public virtual string GraduationPlanTypeDescriptor { get @@ -54052,6 +62530,7 @@ public virtual string GraduationPlanTypeDescriptor } } [DomainSignature] + [Key(8)] public virtual short GraduationSchoolYear { get; set; } // ------------------------------------------------------------- @@ -54063,9 +62542,13 @@ public virtual string GraduationPlanTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual bool? IndividualPlan { get; set; } + [Key(10)] public virtual decimal? TotalRequiredCreditConversion { get; set; } + [Key(11)] public virtual decimal TotalRequiredCredits { get; set; } + [Key(12)] public virtual int? TotalRequiredCreditTypeDescriptorId { get @@ -54085,6 +62568,7 @@ public virtual int? TotalRequiredCreditTypeDescriptorId private int? _totalRequiredCreditTypeDescriptorId; private string _totalRequiredCreditTypeDescriptor; + [IgnoreMember] public virtual string TotalRequiredCreditTypeDescriptor { get @@ -54112,14 +62596,27 @@ public virtual string TotalRequiredCreditTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlan")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -54138,12 +62635,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlan")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -54164,6 +62702,7 @@ string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator set { } } + [Key(16)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData GraduationSchoolYearTypeReferenceData { get; set; } /// @@ -54183,6 +62722,8 @@ string Entities.Common.EdFi.IGraduationPlan.EducationOrganizationDiscriminator private ICollection _graduationPlanCreditsByCourses; private ICollection _graduationPlanCreditsByCoursesCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GraduationPlanCreditsByCourses { get @@ -54192,6 +62733,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GraduationPlanCreditsByCourses"); + } + foreach (var item in _graduationPlanCreditsByCourses) if (item.GraduationPlan == null) item.GraduationPlan = this; @@ -54230,6 +62776,8 @@ public virtual ICollection _graduationPlanCreditsByCreditCategories; private ICollection _graduationPlanCreditsByCreditCategoriesCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GraduationPlanCreditsByCreditCategories { get @@ -54239,6 +62787,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GraduationPlanCreditsByCreditCategories"); + } + foreach (var item in _graduationPlanCreditsByCreditCategories) if (item.GraduationPlan == null) item.GraduationPlan = this; @@ -54277,6 +62830,8 @@ public virtual ICollection _graduationPlanCreditsBySubjects; private ICollection _graduationPlanCreditsBySubjectsCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GraduationPlanCreditsBySubjects { get @@ -54286,6 +62841,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GraduationPlanCreditsBySubjects"); + } + foreach (var item in _graduationPlanCreditsBySubjects) if (item.GraduationPlan == null) item.GraduationPlan = this; @@ -54324,6 +62884,8 @@ public virtual ICollection _graduationPlanRequiredAssessments; private ICollection _graduationPlanRequiredAssessmentsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GraduationPlanRequiredAssessments { get @@ -54333,6 +62895,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GraduationPlanRequiredAssessments"); + } + foreach (var item in _graduationPlanRequiredAssessments) if (item.GraduationPlan == null) item.GraduationPlan = this; @@ -54472,6 +63039,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanCreditsByCourse : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGraduationPlanCreditsByCourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -54480,8 +63048,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GraduationPlanCreditsByCourse() { GraduationPlanCreditsByCourseCourses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -54489,7 +63057,7 @@ public GraduationPlanCreditsByCourse() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GraduationPlan GraduationPlan { get; set; } Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPlan @@ -54499,6 +63067,7 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPl } [DomainSignature] + [Key(1)] public virtual string CourseSetName { get; set; } // ------------------------------------------------------------- @@ -54510,8 +63079,11 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCourse.GraduationPl // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? CreditConversion { get; set; } + [Key(3)] public virtual decimal Credits { get; set; } + [Key(4)] public virtual int? CreditTypeDescriptorId { get @@ -54531,6 +63103,7 @@ public virtual int? CreditTypeDescriptorId private int? _creditTypeDescriptorId; private string _creditTypeDescriptor; + [IgnoreMember] public virtual string CreditTypeDescriptor { get @@ -54546,6 +63119,7 @@ public virtual string CreditTypeDescriptor _creditTypeDescriptorId = default(int?); } } + [Key(5)] public virtual int? WhenTakenGradeLevelDescriptorId { get @@ -54565,6 +63139,7 @@ public virtual int? WhenTakenGradeLevelDescriptorId private int? _whenTakenGradeLevelDescriptorId; private string _whenTakenGradeLevelDescriptor; + [IgnoreMember] public virtual string WhenTakenGradeLevelDescriptor { get @@ -54592,14 +63167,27 @@ public virtual string WhenTakenGradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsByCourse")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -54618,7 +63206,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsByCourse")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -54632,6 +63260,8 @@ public IDictionary Extensions private ICollection _graduationPlanCreditsByCourseCourses; private ICollection _graduationPlanCreditsByCourseCoursesCovariant; + [Key(8)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GraduationPlanCreditsByCourseCourses { get @@ -54641,6 +63271,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GraduationPlanCreditsByCourseCourses"); + } + foreach (var item in _graduationPlanCreditsByCourseCourses) if (item.GraduationPlanCreditsByCourse == null) item.GraduationPlanCreditsByCourse = this; @@ -54695,7 +63330,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GraduationPlan as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CourseSetName", CourseSetName); @@ -54783,6 +63418,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanCreditsByCourseCourse : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGraduationPlanCreditsByCourseCourse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -54790,8 +63426,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GraduationPlanCreditsByCourseCourse() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -54799,7 +63435,7 @@ public GraduationPlanCreditsByCourseCourse() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GraduationPlanCreditsByCourse GraduationPlanCreditsByCourse { get; set; } Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCourseCourse.GraduationPlanCreditsByCourse @@ -54809,8 +63445,10 @@ Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCour } [DomainSignature] + [Key(1)] public virtual string CourseCode { get; set; } [DomainSignature] + [Key(2)] public virtual long CourseEducationOrganizationId { get; set; } // ------------------------------------------------------------- @@ -54834,14 +63472,27 @@ Entities.Common.EdFi.IGraduationPlanCreditsByCourse IGraduationPlanCreditsByCour // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsByCourseCourse")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -54860,12 +63511,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsByCourseCourse")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } /// @@ -54908,7 +63600,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlanCreditsByCourse as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GraduationPlanCreditsByCourse as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CourseCode", CourseCode); @@ -54997,6 +63689,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanCreditsByCreditCategory : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGraduationPlanCreditsByCreditCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -55004,8 +63697,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GraduationPlanCreditsByCreditCategory() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -55013,7 +63706,7 @@ public GraduationPlanCreditsByCreditCategory() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GraduationPlan GraduationPlan { get; set; } Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCreditCategory.GraduationPlan @@ -55023,6 +63716,7 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsByCreditCategory.Grad } [DomainSignature] + [Key(1)] public virtual int CreditCategoryDescriptorId { get @@ -55042,6 +63736,7 @@ public virtual int CreditCategoryDescriptorId private int _creditCategoryDescriptorId; private string _creditCategoryDescriptor; + [IgnoreMember] public virtual string CreditCategoryDescriptor { get @@ -55067,8 +63762,11 @@ public virtual string CreditCategoryDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? CreditConversion { get; set; } + [Key(3)] public virtual decimal Credits { get; set; } + [Key(4)] public virtual int? CreditTypeDescriptorId { get @@ -55088,6 +63786,7 @@ public virtual int? CreditTypeDescriptorId private int? _creditTypeDescriptorId; private string _creditTypeDescriptor; + [IgnoreMember] public virtual string CreditTypeDescriptor { get @@ -55115,14 +63814,27 @@ public virtual string CreditTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsByCreditCategory")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -55141,7 +63853,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsByCreditCategory")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -55171,7 +63923,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GraduationPlan as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CreditCategoryDescriptorId", CreditCategoryDescriptorId); @@ -55259,6 +64011,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanCreditsBySubject : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGraduationPlanCreditsBySubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -55266,8 +64019,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GraduationPlanCreditsBySubject() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -55275,7 +64028,7 @@ public GraduationPlanCreditsBySubject() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GraduationPlan GraduationPlan { get; set; } Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsBySubject.GraduationPlan @@ -55285,6 +64038,7 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanCreditsBySubject.GraduationP } [DomainSignature] + [Key(1)] public virtual int AcademicSubjectDescriptorId { get @@ -55304,6 +64058,7 @@ public virtual int AcademicSubjectDescriptorId private int _academicSubjectDescriptorId; private string _academicSubjectDescriptor; + [IgnoreMember] public virtual string AcademicSubjectDescriptor { get @@ -55329,8 +64084,11 @@ public virtual string AcademicSubjectDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? CreditConversion { get; set; } + [Key(3)] public virtual decimal Credits { get; set; } + [Key(4)] public virtual int? CreditTypeDescriptorId { get @@ -55350,6 +64108,7 @@ public virtual int? CreditTypeDescriptorId private int? _creditTypeDescriptorId; private string _creditTypeDescriptor; + [IgnoreMember] public virtual string CreditTypeDescriptor { get @@ -55377,14 +64136,27 @@ public virtual string CreditTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsBySubject")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -55403,7 +64175,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanCreditsBySubject")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -55433,7 +64245,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GraduationPlan as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); @@ -55521,6 +64333,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanRequiredAssessment : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGraduationPlanRequiredAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -55530,8 +64343,8 @@ public GraduationPlanRequiredAssessment() { GraduationPlanRequiredAssessmentPerformanceLevelPersistentList = new HashSet(); GraduationPlanRequiredAssessmentScores = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -55539,7 +64352,7 @@ public GraduationPlanRequiredAssessment() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GraduationPlan GraduationPlan { get; set; } Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.GraduationPlan @@ -55549,8 +64362,10 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.Graduatio } [DomainSignature] + [Key(1)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] + [Key(2)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -55567,6 +64382,7 @@ Entities.Common.EdFi.IGraduationPlan IGraduationPlanRequiredAssessment.Graduatio // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + [IgnoreMember] public virtual Entities.NHibernate.GraduationPlanAggregate.EdFi.GraduationPlanRequiredAssessmentPerformanceLevel GraduationPlanRequiredAssessmentPerformanceLevel { get @@ -55603,6 +64419,8 @@ Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel Entities. private ICollection _graduationPlanRequiredAssessmentPerformanceLevelPersistentList; + [Key(3)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GraduationPlanRequiredAssessmentPerformanceLevelPersistentList { get @@ -55612,6 +64430,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GraduationPlanRequiredAssessmentPerformanceLevel"); + } + foreach (var item in _graduationPlanRequiredAssessmentPerformanceLevelPersistentList) if (item.GraduationPlanRequiredAssessment == null) item.GraduationPlanRequiredAssessment = this; @@ -55632,14 +64455,27 @@ public virtual ICollection _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -55658,12 +64494,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanRequiredAssessment")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } /// @@ -55692,6 +64569,8 @@ string Entities.Common.EdFi.IGraduationPlanRequiredAssessment.AssessmentDiscrimi private ICollection _graduationPlanRequiredAssessmentScores; private ICollection _graduationPlanRequiredAssessmentScoresCovariant; + [Key(7)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection GraduationPlanRequiredAssessmentScores { get @@ -55701,6 +64580,11 @@ public virtual ICollection set) + { + set.Reattach(this, "GraduationPlanRequiredAssessmentScores"); + } + foreach (var item in _graduationPlanRequiredAssessmentScores) if (item.GraduationPlanRequiredAssessment == null) item.GraduationPlanRequiredAssessment = this; @@ -55753,7 +64637,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlan as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GraduationPlan as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentIdentifier", AssessmentIdentifier); @@ -55842,6 +64726,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanRequiredAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGraduationPlanRequiredAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -55849,8 +64734,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GraduationPlanRequiredAssessmentPerformanceLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -55858,7 +64743,7 @@ public GraduationPlanRequiredAssessmentPerformanceLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { get; set; } Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentPerformanceLevel.GraduationPlanRequiredAssessment @@ -55877,6 +64762,7 @@ Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAs // ============================================================= // Properties // ------------------------------------------------------------- + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -55896,6 +64782,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -55911,8 +64798,11 @@ public virtual string AssessmentReportingMethodDescriptor _assessmentReportingMethodDescriptorId = default(int); } } + [Key(2)] public virtual string MaximumScore { get; set; } + [Key(3)] public virtual string MinimumScore { get; set; } + [Key(4)] public virtual int PerformanceLevelDescriptorId { get @@ -55932,6 +64822,7 @@ public virtual int PerformanceLevelDescriptorId private int _performanceLevelDescriptorId; private string _performanceLevelDescriptor; + [IgnoreMember] public virtual string PerformanceLevelDescriptor { get @@ -55947,7 +64838,9 @@ public virtual string PerformanceLevelDescriptor _performanceLevelDescriptorId = default(int); } } + [Key(5)] public virtual string PerformanceLevelIndicatorName { get; set; } + [Key(6)] public virtual int? ResultDatatypeTypeDescriptorId { get @@ -55967,6 +64860,7 @@ public virtual int? ResultDatatypeTypeDescriptorId private int? _resultDatatypeTypeDescriptorId; private string _resultDatatypeTypeDescriptor; + [IgnoreMember] public virtual string ResultDatatypeTypeDescriptor { get @@ -55994,14 +64888,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanRequiredAssessmentPerformanceLevel")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -56020,7 +64927,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanRequiredAssessmentPerformanceLevel")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -56051,7 +64998,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values @@ -56138,6 +65085,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanRequiredAssessmentScore : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IGraduationPlanRequiredAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -56145,8 +65093,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public GraduationPlanRequiredAssessmentScore() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -56154,7 +65102,7 @@ public GraduationPlanRequiredAssessmentScore() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual GraduationPlanRequiredAssessment GraduationPlanRequiredAssessment { get; set; } Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAssessmentScore.GraduationPlanRequiredAssessment @@ -56164,6 +65112,7 @@ Entities.Common.EdFi.IGraduationPlanRequiredAssessment IGraduationPlanRequiredAs } [DomainSignature] + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -56183,6 +65132,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -56208,8 +65158,11 @@ public virtual string AssessmentReportingMethodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string MaximumScore { get; set; } + [Key(3)] public virtual string MinimumScore { get; set; } + [Key(4)] public virtual int? ResultDatatypeTypeDescriptorId { get @@ -56229,6 +65182,7 @@ public virtual int? ResultDatatypeTypeDescriptorId private int? _resultDatatypeTypeDescriptorId; private string _resultDatatypeTypeDescriptor; + [IgnoreMember] public virtual string ResultDatatypeTypeDescriptor { get @@ -56256,14 +65210,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanRequiredAssessmentScore")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -56282,7 +65249,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "GraduationPlan", "GraduationPlanRequiredAssessmentScore")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -56312,7 +65319,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (GraduationPlanRequiredAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -56405,6 +65412,7 @@ namespace EdFi.Ods.Entities.NHibernate.GraduationPlanTypeDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GraduationPlanTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IGraduationPlanTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -56413,6 +65421,7 @@ public class GraduationPlanTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int GraduationPlanTypeDescriptorId { get { return base.DescriptorId; } @@ -56584,6 +65593,7 @@ namespace EdFi.Ods.Entities.NHibernate.GunFreeSchoolsActReportingStatusDescripto /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class GunFreeSchoolsActReportingStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IGunFreeSchoolsActReportingStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -56592,6 +65602,7 @@ public class GunFreeSchoolsActReportingStatusDescriptor : DescriptorAggregate.Ed // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int GunFreeSchoolsActReportingStatusDescriptorId { get { return base.DescriptorId; } @@ -56763,6 +65774,7 @@ namespace EdFi.Ods.Entities.NHibernate.HomelessPrimaryNighttimeResidenceDescript /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class HomelessPrimaryNighttimeResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IHomelessPrimaryNighttimeResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -56771,6 +65783,7 @@ public class HomelessPrimaryNighttimeResidenceDescriptor : DescriptorAggregate.E // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int HomelessPrimaryNighttimeResidenceDescriptorId { get { return base.DescriptorId; } @@ -56942,6 +65955,7 @@ namespace EdFi.Ods.Entities.NHibernate.HomelessProgramServiceDescriptorAggregate /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class HomelessProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IHomelessProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -56950,6 +65964,7 @@ public class HomelessProgramServiceDescriptor : DescriptorAggregate.EdFi.Descrip // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int HomelessProgramServiceDescriptorId { get { return base.DescriptorId; } @@ -57121,6 +66136,7 @@ namespace EdFi.Ods.Entities.NHibernate.IDEAPartDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class IDEAPartDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IIDEAPartDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -57129,6 +66145,7 @@ public class IDEAPartDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int IDEAPartDescriptorId { get { return base.DescriptorId; } @@ -57300,6 +66317,7 @@ namespace EdFi.Ods.Entities.NHibernate.IdentificationDocumentUseDescriptorAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class IdentificationDocumentUseDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IIdentificationDocumentUseDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -57308,6 +66326,7 @@ public class IdentificationDocumentUseDescriptor : DescriptorAggregate.EdFi.Desc // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int IdentificationDocumentUseDescriptorId { get { return base.DescriptorId; } @@ -57479,6 +66498,7 @@ namespace EdFi.Ods.Entities.NHibernate.ImmunizationTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ImmunizationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IImmunizationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -57487,6 +66507,7 @@ public class ImmunizationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ImmunizationTypeDescriptorId { get { return base.DescriptorId; } @@ -57658,6 +66679,7 @@ namespace EdFi.Ods.Entities.NHibernate.IncidentLocationDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class IncidentLocationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IIncidentLocationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -57666,6 +66688,7 @@ public class IncidentLocationDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int IncidentLocationDescriptorId { get { return base.DescriptorId; } @@ -57837,6 +66860,7 @@ namespace EdFi.Ods.Entities.NHibernate.IndicatorDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class IndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -57845,6 +66869,7 @@ public class IndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int IndicatorDescriptorId { get { return base.DescriptorId; } @@ -58016,6 +67041,7 @@ namespace EdFi.Ods.Entities.NHibernate.IndicatorGroupDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class IndicatorGroupDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IIndicatorGroupDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -58024,6 +67050,7 @@ public class IndicatorGroupDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int IndicatorGroupDescriptorId { get { return base.DescriptorId; } @@ -58195,6 +67222,7 @@ namespace EdFi.Ods.Entities.NHibernate.IndicatorLevelDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class IndicatorLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IIndicatorLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -58203,6 +67231,7 @@ public class IndicatorLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int IndicatorLevelDescriptorId { get { return base.DescriptorId; } @@ -58374,6 +67403,7 @@ namespace EdFi.Ods.Entities.NHibernate.InstitutionTelephoneNumberTypeDescriptorA /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InstitutionTelephoneNumberTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IInstitutionTelephoneNumberTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -58382,6 +67412,7 @@ public class InstitutionTelephoneNumberTypeDescriptor : DescriptorAggregate.EdFi // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int InstitutionTelephoneNumberTypeDescriptorId { get { return base.DescriptorId; } @@ -58553,6 +67584,7 @@ namespace EdFi.Ods.Entities.NHibernate.InteractivityStyleDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InteractivityStyleDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IInteractivityStyleDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -58561,6 +67593,7 @@ public class InteractivityStyleDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int InteractivityStyleDescriptorId { get { return base.DescriptorId; } @@ -58732,6 +67765,7 @@ namespace EdFi.Ods.Entities.NHibernate.InternetAccessDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InternetAccessDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IInternetAccessDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -58740,6 +67774,7 @@ public class InternetAccessDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int InternetAccessDescriptorId { get { return base.DescriptorId; } @@ -58911,6 +67946,7 @@ namespace EdFi.Ods.Entities.NHibernate.InternetAccessTypeInResidenceDescriptorAg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InternetAccessTypeInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IInternetAccessTypeInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -58919,6 +67955,7 @@ public class InternetAccessTypeInResidenceDescriptor : DescriptorAggregate.EdFi. // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int InternetAccessTypeInResidenceDescriptorId { get { return base.DescriptorId; } @@ -59090,6 +68127,7 @@ namespace EdFi.Ods.Entities.NHibernate.InternetPerformanceInResidenceDescriptorA /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InternetPerformanceInResidenceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IInternetPerformanceInResidenceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -59098,6 +68136,7 @@ public class InternetPerformanceInResidenceDescriptor : DescriptorAggregate.EdFi // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int InternetPerformanceInResidenceDescriptorId { get { return base.DescriptorId; } @@ -59264,24 +68303,29 @@ namespace EdFi.Ods.Entities.NHibernate.InterventionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class InterventionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string InterventionIdentificationCode { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -59347,6 +68391,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Intervention : AggregateRootWithCompositeKey, Entities.Common.EdFi.IIntervention, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -59364,8 +68409,8 @@ public Intervention() InterventionPopulationServeds = new HashSet(); InterventionStaffs = new HashSet(); InterventionURIs = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -59374,8 +68419,10 @@ public Intervention() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string InterventionIdentificationCode { get; set; } // ------------------------------------------------------------- @@ -59387,6 +68434,7 @@ public Intervention() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -59396,6 +68444,7 @@ public virtual DateTime BeginDate private DateTime _beginDate; + [Key(9)] public virtual int DeliveryMethodDescriptorId { get @@ -59415,6 +68464,7 @@ public virtual int DeliveryMethodDescriptorId private int _deliveryMethodDescriptorId; private string _deliveryMethodDescriptor; + [IgnoreMember] public virtual string DeliveryMethodDescriptor { get @@ -59430,6 +68480,7 @@ public virtual string DeliveryMethodDescriptor _deliveryMethodDescriptorId = default(int); } } + [Key(10)] public virtual DateTime? EndDate { get { return _endDate; } @@ -59449,6 +68500,7 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(11)] public virtual int InterventionClassDescriptorId { get @@ -59468,6 +68520,7 @@ public virtual int InterventionClassDescriptorId private int _interventionClassDescriptorId; private string _interventionClassDescriptor; + [IgnoreMember] public virtual string InterventionClassDescriptor { get @@ -59483,8 +68536,11 @@ public virtual string InterventionClassDescriptor _interventionClassDescriptorId = default(int); } } + [Key(12)] public virtual int? MaxDosage { get; set; } + [Key(13)] public virtual int? MinDosage { get; set; } + [Key(14)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -59498,14 +68554,27 @@ public virtual string InterventionClassDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "Intervention")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -59524,12 +68593,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "Intervention")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -59558,6 +68668,8 @@ string Entities.Common.EdFi.IIntervention.EducationOrganizationDiscriminator private ICollection _interventionAppropriateGradeLevels; private ICollection _interventionAppropriateGradeLevelsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionAppropriateGradeLevels { get @@ -59567,6 +68679,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionAppropriateGradeLevels"); + } + foreach (var item in _interventionAppropriateGradeLevels) if (item.Intervention == null) item.Intervention = this; @@ -59605,6 +68722,8 @@ public virtual ICollection _interventionAppropriateSexes; private ICollection _interventionAppropriateSexesCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionAppropriateSexes { get @@ -59614,6 +68733,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionAppropriateSexes"); + } + foreach (var item in _interventionAppropriateSexes) if (item.Intervention == null) item.Intervention = this; @@ -59652,6 +68776,8 @@ public virtual ICollection _interventionDiagnoses; private ICollection _interventionDiagnosesCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionDiagnoses { get @@ -59661,6 +68787,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionDiagnoses"); + } + foreach (var item in _interventionDiagnoses) if (item.Intervention == null) item.Intervention = this; @@ -59699,6 +68830,8 @@ public virtual ICollection _interventionEducationContents; private ICollection _interventionEducationContentsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionEducationContents { get @@ -59708,6 +68841,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionEducationContents"); + } + foreach (var item in _interventionEducationContents) if (item.Intervention == null) item.Intervention = this; @@ -59746,6 +68884,8 @@ public virtual ICollection _interventionInterventionPrescriptions; private ICollection _interventionInterventionPrescriptionsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionInterventionPrescriptions { get @@ -59755,6 +68895,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionInterventionPrescriptions"); + } + foreach (var item in _interventionInterventionPrescriptions) if (item.Intervention == null) item.Intervention = this; @@ -59793,6 +68938,8 @@ public virtual ICollection _interventionLearningResourceMetadataURIs; private ICollection _interventionLearningResourceMetadataURIsCovariant; + [Key(23)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionLearningResourceMetadataURIs { get @@ -59802,6 +68949,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionLearningResourceMetadataURIs"); + } + foreach (var item in _interventionLearningResourceMetadataURIs) if (item.Intervention == null) item.Intervention = this; @@ -59840,6 +68992,8 @@ public virtual ICollection _interventionMeetingTimes; private ICollection _interventionMeetingTimesCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionMeetingTimes { get @@ -59849,6 +69003,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionMeetingTimes"); + } + foreach (var item in _interventionMeetingTimes) if (item.Intervention == null) item.Intervention = this; @@ -59887,6 +69046,8 @@ public virtual ICollection _interventionPopulationServeds; private ICollection _interventionPopulationServedsCovariant; + [Key(25)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPopulationServeds { get @@ -59896,6 +69057,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPopulationServeds"); + } + foreach (var item in _interventionPopulationServeds) if (item.Intervention == null) item.Intervention = this; @@ -59934,6 +69100,8 @@ public virtual ICollection _interventionStaffs; private ICollection _interventionStaffsCovariant; + [Key(26)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStaffs { get @@ -59943,6 +69111,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStaffs"); + } + foreach (var item in _interventionStaffs) if (item.Intervention == null) item.Intervention = this; @@ -59981,6 +69154,8 @@ public virtual ICollection _interventionURIs; private ICollection _interventionURIsCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionURIs { get @@ -59990,6 +69165,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionURIs"); + } + foreach (var item in _interventionURIs) if (item.Intervention == null) item.Intervention = this; @@ -60128,6 +69308,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -60135,8 +69316,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionAppropriateGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -60144,7 +69325,7 @@ public InterventionAppropriateGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionAppropriateGradeLevel.Intervention @@ -60154,6 +69335,7 @@ Entities.Common.EdFi.IIntervention IInterventionAppropriateGradeLevel.Interventi } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -60173,6 +69355,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -60210,14 +69393,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionAppropriateGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -60236,7 +69432,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionAppropriateGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -60264,7 +69500,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -60352,6 +69588,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionAppropriateSex : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -60359,8 +69596,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionAppropriateSex() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -60368,7 +69605,7 @@ public InterventionAppropriateSex() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionAppropriateSex.Intervention @@ -60378,6 +69615,7 @@ Entities.Common.EdFi.IIntervention IInterventionAppropriateSex.Intervention } [DomainSignature] + [Key(1)] public virtual int SexDescriptorId { get @@ -60397,6 +69635,7 @@ public virtual int SexDescriptorId private int _sexDescriptorId; private string _sexDescriptor; + [IgnoreMember] public virtual string SexDescriptor { get @@ -60434,14 +69673,27 @@ public virtual string SexDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionAppropriateSex")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -60460,7 +69712,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionAppropriateSex")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -60488,7 +69780,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SexDescriptorId", SexDescriptorId); @@ -60576,6 +69868,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionDiagnosis : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionDiagnosis, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -60583,8 +69876,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionDiagnosis() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -60592,7 +69885,7 @@ public InterventionDiagnosis() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionDiagnosis.Intervention @@ -60602,6 +69895,7 @@ Entities.Common.EdFi.IIntervention IInterventionDiagnosis.Intervention } [DomainSignature] + [Key(1)] public virtual int DiagnosisDescriptorId { get @@ -60621,6 +69915,7 @@ public virtual int DiagnosisDescriptorId private int _diagnosisDescriptorId; private string _diagnosisDescriptor; + [IgnoreMember] public virtual string DiagnosisDescriptor { get @@ -60658,14 +69953,27 @@ public virtual string DiagnosisDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionDiagnosis")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -60684,7 +69992,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionDiagnosis")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -60712,7 +70060,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); @@ -60800,6 +70148,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionEducationContent : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -60807,8 +70156,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionEducationContent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -60816,7 +70165,7 @@ public InterventionEducationContent() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention @@ -60826,6 +70175,7 @@ Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention } [DomainSignature] + [Key(1)] public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- @@ -60849,14 +70199,27 @@ Entities.Common.EdFi.IIntervention IInterventionEducationContent.Intervention // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionEducationContent")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -60875,12 +70238,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionEducationContent")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } /// @@ -60922,7 +70326,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ContentIdentifier", ContentIdentifier); @@ -61010,6 +70414,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionInterventionPrescription : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionInterventionPrescription, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -61017,8 +70422,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionInterventionPrescription() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61026,7 +70431,7 @@ public InterventionInterventionPrescription() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Intervention @@ -61036,8 +70441,10 @@ Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Interve } [DomainSignature] + [Key(1)] public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } [DomainSignature] + [Key(2)] public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- @@ -61061,14 +70468,27 @@ Entities.Common.EdFi.IIntervention IInterventionInterventionPrescription.Interve // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionInterventionPrescription")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -61087,12 +70507,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionInterventionPrescription")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } /// @@ -61134,7 +70595,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("InterventionPrescriptionEducationOrganizationId", InterventionPrescriptionEducationOrganizationId); @@ -61223,6 +70684,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -61230,8 +70692,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionLearningResourceMetadataURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61239,7 +70701,7 @@ public InterventionLearningResourceMetadataURI() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Intervention @@ -61249,6 +70711,7 @@ Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Inte } [DomainSignature] + [Key(1)] public virtual string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- @@ -61272,14 +70735,27 @@ Entities.Common.EdFi.IIntervention IInterventionLearningResourceMetadataURI.Inte // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionLearningResourceMetadataURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -61298,7 +70774,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionLearningResourceMetadataURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -61325,7 +70841,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); @@ -61413,6 +70929,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionMeetingTime : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionMeetingTime, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -61420,8 +70937,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionMeetingTime() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61429,7 +70946,7 @@ public InterventionMeetingTime() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention @@ -61439,8 +70956,10 @@ Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention } [DomainSignature] + [Key(1)] public virtual TimeSpan EndTime { get; set; } [DomainSignature] + [Key(2)] public virtual TimeSpan StartTime { get; set; } // ------------------------------------------------------------- @@ -61464,14 +70983,27 @@ Entities.Common.EdFi.IIntervention IInterventionMeetingTime.Intervention // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionMeetingTime")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -61490,7 +71022,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionMeetingTime")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -61517,7 +71089,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("EndTime", EndTime); @@ -61606,6 +71178,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPopulationServed : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -61613,8 +71186,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPopulationServed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61622,7 +71195,7 @@ public InterventionPopulationServed() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionPopulationServed.Intervention @@ -61632,6 +71205,7 @@ Entities.Common.EdFi.IIntervention IInterventionPopulationServed.Intervention } [DomainSignature] + [Key(1)] public virtual int PopulationServedDescriptorId { get @@ -61651,6 +71225,7 @@ public virtual int PopulationServedDescriptorId private int _populationServedDescriptorId; private string _populationServedDescriptor; + [IgnoreMember] public virtual string PopulationServedDescriptor { get @@ -61688,14 +71263,27 @@ public virtual string PopulationServedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionPopulationServed")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -61714,7 +71302,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionPopulationServed")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -61742,7 +71370,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); @@ -61830,6 +71458,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStaff : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -61837,8 +71466,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStaff() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -61846,7 +71475,7 @@ public InterventionStaff() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionStaff.Intervention @@ -61856,6 +71485,7 @@ Entities.Common.EdFi.IIntervention IInterventionStaff.Intervention } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(1)] public virtual int StaffUSI { get @@ -61881,6 +71511,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -61926,14 +71557,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionStaff")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -61952,12 +71596,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionStaff")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -61999,7 +71684,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("StaffUSI", StaffUSI); @@ -62087,6 +71772,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionURI : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -62094,8 +71780,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -62103,7 +71789,7 @@ public InterventionURI() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Intervention Intervention { get; set; } Entities.Common.EdFi.IIntervention IInterventionURI.Intervention @@ -62113,6 +71799,7 @@ Entities.Common.EdFi.IIntervention IInterventionURI.Intervention } [DomainSignature] + [Key(1)] public virtual string URI { get; set; } // ------------------------------------------------------------- @@ -62136,14 +71823,27 @@ Entities.Common.EdFi.IIntervention IInterventionURI.Intervention // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Intervention", "InterventionURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -62162,7 +71862,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Intervention", "InterventionURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -62189,7 +71929,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Intervention as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Intervention as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("URI", URI); @@ -62282,6 +72022,7 @@ namespace EdFi.Ods.Entities.NHibernate.InterventionClassDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionClassDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IInterventionClassDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -62290,6 +72031,7 @@ public class InterventionClassDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int InterventionClassDescriptorId { get { return base.DescriptorId; } @@ -62461,6 +72203,7 @@ namespace EdFi.Ods.Entities.NHibernate.InterventionEffectivenessRatingDescriptor /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionEffectivenessRatingDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IInterventionEffectivenessRatingDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -62469,6 +72212,7 @@ public class InterventionEffectivenessRatingDescriptor : DescriptorAggregate.EdF // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int InterventionEffectivenessRatingDescriptorId { get { return base.DescriptorId; } @@ -62635,24 +72379,29 @@ namespace EdFi.Ods.Entities.NHibernate.InterventionPrescriptionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class InterventionPrescriptionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -62718,6 +72467,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescription : AggregateRootWithCompositeKey, Entities.Common.EdFi.IInterventionPrescription, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -62732,8 +72482,8 @@ public InterventionPrescription() InterventionPrescriptionLearningResourceMetadataURIs = new HashSet(); InterventionPrescriptionPopulationServeds = new HashSet(); InterventionPrescriptionURIs = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -62742,8 +72492,10 @@ public InterventionPrescription() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string InterventionPrescriptionIdentificationCode { get; set; } // ------------------------------------------------------------- @@ -62755,6 +72507,7 @@ public InterventionPrescription() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual int DeliveryMethodDescriptorId { get @@ -62774,6 +72527,7 @@ public virtual int DeliveryMethodDescriptorId private int _deliveryMethodDescriptorId; private string _deliveryMethodDescriptor; + [IgnoreMember] public virtual string DeliveryMethodDescriptor { get @@ -62789,6 +72543,7 @@ public virtual string DeliveryMethodDescriptor _deliveryMethodDescriptorId = default(int); } } + [Key(9)] public virtual int InterventionClassDescriptorId { get @@ -62808,6 +72563,7 @@ public virtual int InterventionClassDescriptorId private int _interventionClassDescriptorId; private string _interventionClassDescriptor; + [IgnoreMember] public virtual string InterventionClassDescriptor { get @@ -62823,8 +72579,11 @@ public virtual string InterventionClassDescriptor _interventionClassDescriptorId = default(int); } } + [Key(10)] public virtual int? MaxDosage { get; set; } + [Key(11)] public virtual int? MinDosage { get; set; } + [Key(12)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -62838,14 +72597,27 @@ public virtual string InterventionClassDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescription")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -62864,12 +72636,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescription")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -62898,6 +72711,8 @@ string Entities.Common.EdFi.IInterventionPrescription.EducationOrganizationDiscr private ICollection _interventionPrescriptionAppropriateGradeLevels; private ICollection _interventionPrescriptionAppropriateGradeLevelsCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPrescriptionAppropriateGradeLevels { get @@ -62907,6 +72722,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPrescriptionAppropriateGradeLevels"); + } + foreach (var item in _interventionPrescriptionAppropriateGradeLevels) if (item.InterventionPrescription == null) item.InterventionPrescription = this; @@ -62945,6 +72765,8 @@ public virtual ICollection _interventionPrescriptionAppropriateSexes; private ICollection _interventionPrescriptionAppropriateSexesCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPrescriptionAppropriateSexes { get @@ -62954,6 +72776,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPrescriptionAppropriateSexes"); + } + foreach (var item in _interventionPrescriptionAppropriateSexes) if (item.InterventionPrescription == null) item.InterventionPrescription = this; @@ -62992,6 +72819,8 @@ public virtual ICollection _interventionPrescriptionDiagnoses; private ICollection _interventionPrescriptionDiagnosesCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPrescriptionDiagnoses { get @@ -63001,6 +72830,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPrescriptionDiagnoses"); + } + foreach (var item in _interventionPrescriptionDiagnoses) if (item.InterventionPrescription == null) item.InterventionPrescription = this; @@ -63039,6 +72873,8 @@ public virtual ICollection _interventionPrescriptionEducationContents; private ICollection _interventionPrescriptionEducationContentsCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPrescriptionEducationContents { get @@ -63048,6 +72884,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPrescriptionEducationContents"); + } + foreach (var item in _interventionPrescriptionEducationContents) if (item.InterventionPrescription == null) item.InterventionPrescription = this; @@ -63086,6 +72927,8 @@ public virtual ICollection _interventionPrescriptionLearningResourceMetadataURIs; private ICollection _interventionPrescriptionLearningResourceMetadataURIsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPrescriptionLearningResourceMetadataURIs { get @@ -63095,6 +72938,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPrescriptionLearningResourceMetadataURIs"); + } + foreach (var item in _interventionPrescriptionLearningResourceMetadataURIs) if (item.InterventionPrescription == null) item.InterventionPrescription = this; @@ -63133,6 +72981,8 @@ public virtual ICollection _interventionPrescriptionPopulationServeds; private ICollection _interventionPrescriptionPopulationServedsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPrescriptionPopulationServeds { get @@ -63142,6 +72992,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPrescriptionPopulationServeds"); + } + foreach (var item in _interventionPrescriptionPopulationServeds) if (item.InterventionPrescription == null) item.InterventionPrescription = this; @@ -63180,6 +73035,8 @@ public virtual ICollection _interventionPrescriptionURIs; private ICollection _interventionPrescriptionURIsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionPrescriptionURIs { get @@ -63189,6 +73046,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionPrescriptionURIs"); + } + foreach (var item in _interventionPrescriptionURIs) if (item.InterventionPrescription == null) item.InterventionPrescription = this; @@ -63327,6 +73189,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescriptionAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPrescriptionAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -63334,8 +73197,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPrescriptionAppropriateGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -63343,7 +73206,7 @@ public InterventionPrescriptionAppropriateGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionPrescription InterventionPrescription { get; set; } Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateGradeLevel.InterventionPrescription @@ -63353,6 +73216,7 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropri } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -63372,6 +73236,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -63409,14 +73274,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionAppropriateGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -63435,7 +73313,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionAppropriateGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -63463,7 +73381,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -63551,6 +73469,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescriptionAppropriateSex : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPrescriptionAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -63558,8 +73477,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPrescriptionAppropriateSex() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -63567,7 +73486,7 @@ public InterventionPrescriptionAppropriateSex() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionPrescription InterventionPrescription { get; set; } Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropriateSex.InterventionPrescription @@ -63577,6 +73496,7 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionAppropri } [DomainSignature] + [Key(1)] public virtual int SexDescriptorId { get @@ -63596,6 +73516,7 @@ public virtual int SexDescriptorId private int _sexDescriptorId; private string _sexDescriptor; + [IgnoreMember] public virtual string SexDescriptor { get @@ -63633,14 +73554,27 @@ public virtual string SexDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionAppropriateSex")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -63659,7 +73593,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionAppropriateSex")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -63687,7 +73661,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SexDescriptorId", SexDescriptorId); @@ -63775,6 +73749,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescriptionDiagnosis : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPrescriptionDiagnosis, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -63782,8 +73757,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPrescriptionDiagnosis() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -63791,7 +73766,7 @@ public InterventionPrescriptionDiagnosis() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionPrescription InterventionPrescription { get; set; } Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionDiagnosis.InterventionPrescription @@ -63801,6 +73776,7 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionDiagnosi } [DomainSignature] + [Key(1)] public virtual int DiagnosisDescriptorId { get @@ -63820,6 +73796,7 @@ public virtual int DiagnosisDescriptorId private int _diagnosisDescriptorId; private string _diagnosisDescriptor; + [IgnoreMember] public virtual string DiagnosisDescriptor { get @@ -63857,14 +73834,27 @@ public virtual string DiagnosisDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionDiagnosis")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -63883,7 +73873,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionDiagnosis")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -63911,7 +73941,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); @@ -63999,6 +74029,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescriptionEducationContent : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPrescriptionEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -64006,8 +74037,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPrescriptionEducationContent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64015,7 +74046,7 @@ public InterventionPrescriptionEducationContent() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionPrescription InterventionPrescription { get; set; } Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionEducationContent.InterventionPrescription @@ -64025,6 +74056,7 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionEducatio } [DomainSignature] + [Key(1)] public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- @@ -64048,14 +74080,27 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionEducatio // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionEducationContent")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -64074,12 +74119,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionEducationContent")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } /// @@ -64121,7 +74207,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ContentIdentifier", ContentIdentifier); @@ -64209,6 +74295,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescriptionLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPrescriptionLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -64216,8 +74303,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPrescriptionLearningResourceMetadataURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64225,7 +74312,7 @@ public InterventionPrescriptionLearningResourceMetadataURI() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionPrescription InterventionPrescription { get; set; } Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionLearningResourceMetadataURI.InterventionPrescription @@ -64235,6 +74322,7 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionLearning } [DomainSignature] + [Key(1)] public virtual string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- @@ -64258,14 +74346,27 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionLearning // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionLearningResourceMetadataURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -64284,7 +74385,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionLearningResourceMetadataURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -64311,7 +74452,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); @@ -64399,6 +74540,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescriptionPopulationServed : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPrescriptionPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -64406,8 +74548,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPrescriptionPopulationServed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64415,7 +74557,7 @@ public InterventionPrescriptionPopulationServed() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionPrescription InterventionPrescription { get; set; } Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionPopulationServed.InterventionPrescription @@ -64425,6 +74567,7 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionPopulati } [DomainSignature] + [Key(1)] public virtual int PopulationServedDescriptorId { get @@ -64444,6 +74587,7 @@ public virtual int PopulationServedDescriptorId private int _populationServedDescriptorId; private string _populationServedDescriptor; + [IgnoreMember] public virtual string PopulationServedDescriptor { get @@ -64481,14 +74625,27 @@ public virtual string PopulationServedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionPopulationServed")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -64507,7 +74664,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionPopulationServed")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -64535,7 +74732,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); @@ -64623,6 +74820,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionPrescriptionURI : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionPrescriptionURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -64630,8 +74828,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionPrescriptionURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64639,7 +74837,7 @@ public InterventionPrescriptionURI() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionPrescription InterventionPrescription { get; set; } Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.InterventionPrescription @@ -64649,6 +74847,7 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.Inte } [DomainSignature] + [Key(1)] public virtual string URI { get; set; } // ------------------------------------------------------------- @@ -64672,14 +74871,27 @@ Entities.Common.EdFi.IInterventionPrescription IInterventionPrescriptionURI.Inte // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -64698,7 +74910,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionPrescription", "InterventionPrescriptionURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -64725,7 +74977,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionPrescription as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionPrescription as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("URI", URI); @@ -64813,24 +75065,29 @@ namespace EdFi.Ods.Entities.NHibernate.InterventionStudyAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class InterventionStudyReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string InterventionStudyIdentificationCode { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -64896,6 +75153,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudy : AggregateRootWithCompositeKey, Entities.Common.EdFi.IInterventionStudy, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -64911,8 +75169,8 @@ public InterventionStudy() InterventionStudyPopulationServeds = new HashSet(); InterventionStudyStateAbbreviations = new HashSet(); InterventionStudyURIs = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -64921,8 +75179,10 @@ public InterventionStudy() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string InterventionStudyIdentificationCode { get; set; } // ------------------------------------------------------------- @@ -64934,6 +75194,7 @@ public InterventionStudy() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual int DeliveryMethodDescriptorId { get @@ -64953,6 +75214,7 @@ public virtual int DeliveryMethodDescriptorId private int _deliveryMethodDescriptorId; private string _deliveryMethodDescriptor; + [IgnoreMember] public virtual string DeliveryMethodDescriptor { get @@ -64968,6 +75230,7 @@ public virtual string DeliveryMethodDescriptor _deliveryMethodDescriptorId = default(int); } } + [Key(9)] public virtual int InterventionClassDescriptorId { get @@ -64987,6 +75250,7 @@ public virtual int InterventionClassDescriptorId private int _interventionClassDescriptorId; private string _interventionClassDescriptor; + [IgnoreMember] public virtual string InterventionClassDescriptor { get @@ -65002,8 +75266,11 @@ public virtual string InterventionClassDescriptor _interventionClassDescriptorId = default(int); } } + [Key(10)] public virtual long InterventionPrescriptionEducationOrganizationId { get; set; } + [Key(11)] public virtual string InterventionPrescriptionIdentificationCode { get; set; } + [Key(12)] public virtual int Participants { get; set; } // ------------------------------------------------------------- @@ -65017,14 +75284,27 @@ public virtual string InterventionClassDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudy")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -65043,12 +75323,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudy")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -65069,6 +75390,7 @@ string Entities.Common.EdFi.IInterventionStudy.EducationOrganizationDiscriminato set { } } + [Key(16)] public virtual NHibernate.InterventionPrescriptionAggregate.EdFi.InterventionPrescriptionReferenceData InterventionPrescriptionReferenceData { get; set; } /// @@ -65097,6 +75419,8 @@ string Entities.Common.EdFi.IInterventionStudy.InterventionPrescriptionDiscrimin private ICollection _interventionStudyAppropriateGradeLevels; private ICollection _interventionStudyAppropriateGradeLevelsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyAppropriateGradeLevels { get @@ -65106,6 +75430,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyAppropriateGradeLevels"); + } + foreach (var item in _interventionStudyAppropriateGradeLevels) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65144,6 +75473,8 @@ public virtual ICollection _interventionStudyAppropriateSexes; private ICollection _interventionStudyAppropriateSexesCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyAppropriateSexes { get @@ -65153,6 +75484,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyAppropriateSexes"); + } + foreach (var item in _interventionStudyAppropriateSexes) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65191,6 +75527,8 @@ public virtual ICollection _interventionStudyEducationContents; private ICollection _interventionStudyEducationContentsCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyEducationContents { get @@ -65200,6 +75538,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyEducationContents"); + } + foreach (var item in _interventionStudyEducationContents) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65238,6 +75581,8 @@ public virtual ICollection _interventionStudyInterventionEffectivenesses; private ICollection _interventionStudyInterventionEffectivenessesCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyInterventionEffectivenesses { get @@ -65247,6 +75592,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyInterventionEffectivenesses"); + } + foreach (var item in _interventionStudyInterventionEffectivenesses) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65285,6 +75635,8 @@ public virtual ICollection _interventionStudyLearningResourceMetadataURIs; private ICollection _interventionStudyLearningResourceMetadataURIsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyLearningResourceMetadataURIs { get @@ -65294,6 +75646,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyLearningResourceMetadataURIs"); + } + foreach (var item in _interventionStudyLearningResourceMetadataURIs) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65332,6 +75689,8 @@ public virtual ICollection _interventionStudyPopulationServeds; private ICollection _interventionStudyPopulationServedsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyPopulationServeds { get @@ -65341,6 +75700,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyPopulationServeds"); + } + foreach (var item in _interventionStudyPopulationServeds) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65379,6 +75743,8 @@ public virtual ICollection _interventionStudyStateAbbreviations; private ICollection _interventionStudyStateAbbreviationsCovariant; + [Key(23)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyStateAbbreviations { get @@ -65388,6 +75754,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyStateAbbreviations"); + } + foreach (var item in _interventionStudyStateAbbreviations) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65426,6 +75797,8 @@ public virtual ICollection _interventionStudyURIs; private ICollection _interventionStudyURIsCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection InterventionStudyURIs { get @@ -65435,6 +75808,11 @@ public virtual ICollection set) + { + set.Reattach(this, "InterventionStudyURIs"); + } + foreach (var item in _interventionStudyURIs) if (item.InterventionStudy == null) item.InterventionStudy = this; @@ -65573,6 +75951,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyAppropriateGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyAppropriateGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -65580,8 +75959,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyAppropriateGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -65589,7 +75968,7 @@ public InterventionStudyAppropriateGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateGradeLevel.InterventionStudy @@ -65599,6 +75978,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateGradeLevel. } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -65618,6 +75998,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -65655,14 +76036,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyAppropriateGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -65681,7 +76075,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyAppropriateGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -65709,7 +76143,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -65797,6 +76231,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyAppropriateSex : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyAppropriateSex, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -65804,8 +76239,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyAppropriateSex() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -65813,7 +76248,7 @@ public InterventionStudyAppropriateSex() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateSex.InterventionStudy @@ -65823,6 +76258,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyAppropriateSex.Interve } [DomainSignature] + [Key(1)] public virtual int SexDescriptorId { get @@ -65842,6 +76278,7 @@ public virtual int SexDescriptorId private int _sexDescriptorId; private string _sexDescriptor; + [IgnoreMember] public virtual string SexDescriptor { get @@ -65879,14 +76316,27 @@ public virtual string SexDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyAppropriateSex")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -65905,7 +76355,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyAppropriateSex")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -65933,7 +76423,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SexDescriptorId", SexDescriptorId); @@ -66021,6 +76511,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyEducationContent : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyEducationContent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -66028,8 +76519,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyEducationContent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66037,7 +76528,7 @@ public InterventionStudyEducationContent() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyEducationContent.InterventionStudy @@ -66047,6 +76538,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyEducationContent.Inter } [DomainSignature] + [Key(1)] public virtual string ContentIdentifier { get; set; } // ------------------------------------------------------------- @@ -66070,14 +76562,27 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyEducationContent.Inter // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyEducationContent")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -66096,12 +76601,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyEducationContent")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.EducationContentAggregate.EdFi.EducationContentReferenceData EducationContentReferenceData { get; set; } /// @@ -66143,7 +76689,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ContentIdentifier", ContentIdentifier); @@ -66231,6 +76777,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyInterventionEffectiveness : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyInterventionEffectiveness, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -66238,8 +76785,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyInterventionEffectiveness() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66247,7 +76794,7 @@ public InterventionStudyInterventionEffectiveness() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyInterventionEffectiveness.InterventionStudy @@ -66257,6 +76804,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyInterventionEffectiven } [DomainSignature] + [Key(1)] public virtual int DiagnosisDescriptorId { get @@ -66276,6 +76824,7 @@ public virtual int DiagnosisDescriptorId private int _diagnosisDescriptorId; private string _diagnosisDescriptor; + [IgnoreMember] public virtual string DiagnosisDescriptor { get @@ -66292,6 +76841,7 @@ public virtual string DiagnosisDescriptor } } [DomainSignature] + [Key(2)] public virtual int GradeLevelDescriptorId { get @@ -66311,6 +76861,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -66327,6 +76878,7 @@ public virtual string GradeLevelDescriptor } } [DomainSignature] + [Key(3)] public virtual int PopulationServedDescriptorId { get @@ -66346,6 +76898,7 @@ public virtual int PopulationServedDescriptorId private int _populationServedDescriptorId; private string _populationServedDescriptor; + [IgnoreMember] public virtual string PopulationServedDescriptor { get @@ -66371,7 +76924,9 @@ public virtual string PopulationServedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(4)] public virtual int? ImprovementIndex { get; set; } + [Key(5)] public virtual int InterventionEffectivenessRatingDescriptorId { get @@ -66391,6 +76946,7 @@ public virtual int InterventionEffectivenessRatingDescriptorId private int _interventionEffectivenessRatingDescriptorId; private string _interventionEffectivenessRatingDescriptor; + [IgnoreMember] public virtual string InterventionEffectivenessRatingDescriptor { get @@ -66418,14 +76974,27 @@ public virtual string InterventionEffectivenessRatingDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyInterventionEffectiveness")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -66444,7 +77013,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyInterventionEffectiveness")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -66475,7 +77084,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); @@ -66565,6 +77174,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyLearningResourceMetadataURI : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyLearningResourceMetadataURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -66572,8 +77182,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyLearningResourceMetadataURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66581,7 +77191,7 @@ public InterventionStudyLearningResourceMetadataURI() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyLearningResourceMetadataURI.InterventionStudy @@ -66591,6 +77201,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyLearningResourceMetada } [DomainSignature] + [Key(1)] public virtual string LearningResourceMetadataURI { get; set; } // ------------------------------------------------------------- @@ -66614,14 +77225,27 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyLearningResourceMetada // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyLearningResourceMetadataURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -66640,7 +77264,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyLearningResourceMetadataURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -66667,7 +77331,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningResourceMetadataURI", LearningResourceMetadataURI); @@ -66755,6 +77419,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyPopulationServed : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyPopulationServed, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -66762,8 +77427,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyPopulationServed() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66771,7 +77436,7 @@ public InterventionStudyPopulationServed() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyPopulationServed.InterventionStudy @@ -66781,6 +77446,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyPopulationServed.Inter } [DomainSignature] + [Key(1)] public virtual int PopulationServedDescriptorId { get @@ -66800,6 +77466,7 @@ public virtual int PopulationServedDescriptorId private int _populationServedDescriptorId; private string _populationServedDescriptor; + [IgnoreMember] public virtual string PopulationServedDescriptor { get @@ -66837,14 +77504,27 @@ public virtual string PopulationServedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyPopulationServed")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -66863,7 +77543,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyPopulationServed")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -66891,7 +77611,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("PopulationServedDescriptorId", PopulationServedDescriptorId); @@ -66979,6 +77699,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyStateAbbreviation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyStateAbbreviation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -66986,8 +77707,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyStateAbbreviation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -66995,7 +77716,7 @@ public InterventionStudyStateAbbreviation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyStateAbbreviation.InterventionStudy @@ -67005,6 +77726,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyStateAbbreviation.Inte } [DomainSignature] + [Key(1)] public virtual int StateAbbreviationDescriptorId { get @@ -67024,6 +77746,7 @@ public virtual int StateAbbreviationDescriptorId private int _stateAbbreviationDescriptorId; private string _stateAbbreviationDescriptor; + [IgnoreMember] public virtual string StateAbbreviationDescriptor { get @@ -67061,14 +77784,27 @@ public virtual string StateAbbreviationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyStateAbbreviation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -67087,7 +77823,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyStateAbbreviation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -67115,7 +77891,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("StateAbbreviationDescriptorId", StateAbbreviationDescriptorId); @@ -67203,6 +77979,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class InterventionStudyURI : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IInterventionStudyURI, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -67210,8 +77987,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public InterventionStudyURI() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -67219,7 +77996,7 @@ public InterventionStudyURI() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual InterventionStudy InterventionStudy { get; set; } Entities.Common.EdFi.IInterventionStudy IInterventionStudyURI.InterventionStudy @@ -67229,6 +78006,7 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyURI.InterventionStudy } [DomainSignature] + [Key(1)] public virtual string URI { get; set; } // ------------------------------------------------------------- @@ -67252,14 +78030,27 @@ Entities.Common.EdFi.IInterventionStudy IInterventionStudyURI.InterventionStudy // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyURI")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -67278,7 +78069,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "InterventionStudy", "InterventionStudyURI")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -67305,7 +78136,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (InterventionStudy as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (InterventionStudy as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("URI", URI); @@ -67398,6 +78229,7 @@ namespace EdFi.Ods.Entities.NHibernate.LanguageDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LanguageDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILanguageDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -67406,6 +78238,7 @@ public class LanguageDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LanguageDescriptorId { get { return base.DescriptorId; } @@ -67577,6 +78410,7 @@ namespace EdFi.Ods.Entities.NHibernate.LanguageInstructionProgramServiceDescript /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LanguageInstructionProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILanguageInstructionProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -67585,6 +78419,7 @@ public class LanguageInstructionProgramServiceDescriptor : DescriptorAggregate.E // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LanguageInstructionProgramServiceDescriptorId { get { return base.DescriptorId; } @@ -67756,6 +78591,7 @@ namespace EdFi.Ods.Entities.NHibernate.LanguageUseDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LanguageUseDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILanguageUseDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -67764,6 +78600,7 @@ public class LanguageUseDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LanguageUseDescriptorId { get { return base.DescriptorId; } @@ -67930,23 +78767,27 @@ namespace EdFi.Ods.Entities.NHibernate.LearningStandardAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LearningStandardReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(1)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(2)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -68011,6 +78852,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandard : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -68022,8 +78864,8 @@ public LearningStandard() LearningStandardAcademicSubjects = new HashSet(); LearningStandardGradeLevels = new HashSet(); LearningStandardIdentificationCodes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -68032,6 +78874,7 @@ public LearningStandard() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- @@ -68043,8 +78886,11 @@ public LearningStandard() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(7)] public virtual string CourseTitle { get; set; } + [Key(8)] public virtual string Description { get; set; } + [Key(9)] public virtual int? LearningStandardCategoryDescriptorId { get @@ -68064,6 +78910,7 @@ public virtual int? LearningStandardCategoryDescriptorId private int? _learningStandardCategoryDescriptorId; private string _learningStandardCategoryDescriptor; + [IgnoreMember] public virtual string LearningStandardCategoryDescriptor { get @@ -68079,7 +78926,9 @@ public virtual string LearningStandardCategoryDescriptor _learningStandardCategoryDescriptorId = default(int?); } } + [Key(10)] public virtual string LearningStandardItemCode { get; set; } + [Key(11)] public virtual int? LearningStandardScopeDescriptorId { get @@ -68099,6 +78948,7 @@ public virtual int? LearningStandardScopeDescriptorId private int? _learningStandardScopeDescriptorId; private string _learningStandardScopeDescriptor; + [IgnoreMember] public virtual string LearningStandardScopeDescriptor { get @@ -68114,15 +78964,20 @@ public virtual string LearningStandardScopeDescriptor _learningStandardScopeDescriptorId = default(int?); } } + [Key(12)] public virtual string Namespace { get; set; } + [Key(13)] public virtual string ParentLearningStandardId { get; set; } + [Key(14)] public virtual string SuccessCriteria { get; set; } + [Key(15)] public virtual string URI { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + [IgnoreMember] public virtual Entities.NHibernate.LearningStandardAggregate.EdFi.LearningStandardContentStandard LearningStandardContentStandard { get @@ -68159,6 +79014,8 @@ Entities.Common.EdFi.ILearningStandardContentStandard Entities.Common.EdFi.ILear private ICollection _learningStandardContentStandardPersistentList; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LearningStandardContentStandardPersistentList { get @@ -68168,6 +79025,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LearningStandardContentStandard"); + } + foreach (var item in _learningStandardContentStandardPersistentList) if (item.LearningStandard == null) item.LearningStandard = this; @@ -68188,14 +79050,27 @@ public virtual ICollection _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -68214,12 +79089,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LearningStandard", "LearningStandard")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(19)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData ParentLearningStandardReferenceData { get; set; } /// @@ -68248,6 +79164,8 @@ string Entities.Common.EdFi.ILearningStandard.ParentLearningStandardDiscriminato private ICollection _learningStandardAcademicSubjects; private ICollection _learningStandardAcademicSubjectsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LearningStandardAcademicSubjects { get @@ -68257,6 +79175,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LearningStandardAcademicSubjects"); + } + foreach (var item in _learningStandardAcademicSubjects) if (item.LearningStandard == null) item.LearningStandard = this; @@ -68295,6 +79218,8 @@ public virtual ICollection _learningStandardGradeLevels; private ICollection _learningStandardGradeLevelsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LearningStandardGradeLevels { get @@ -68304,6 +79229,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LearningStandardGradeLevels"); + } + foreach (var item in _learningStandardGradeLevels) if (item.LearningStandard == null) item.LearningStandard = this; @@ -68342,6 +79272,8 @@ public virtual ICollection _learningStandardIdentificationCodes; private ICollection _learningStandardIdentificationCodesCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LearningStandardIdentificationCodes { get @@ -68351,6 +79283,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LearningStandardIdentificationCodes"); + } + foreach (var item in _learningStandardIdentificationCodes) if (item.LearningStandard == null) item.LearningStandard = this; @@ -68488,6 +79425,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardAcademicSubject : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILearningStandardAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -68495,8 +79433,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LearningStandardAcademicSubject() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -68504,7 +79442,7 @@ public LearningStandardAcademicSubject() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LearningStandard LearningStandard { get; set; } Entities.Common.EdFi.ILearningStandard ILearningStandardAcademicSubject.LearningStandard @@ -68514,6 +79452,7 @@ Entities.Common.EdFi.ILearningStandard ILearningStandardAcademicSubject.Learning } [DomainSignature] + [Key(1)] public virtual int AcademicSubjectDescriptorId { get @@ -68533,6 +79472,7 @@ public virtual int AcademicSubjectDescriptorId private int _academicSubjectDescriptorId; private string _academicSubjectDescriptor; + [IgnoreMember] public virtual string AcademicSubjectDescriptor { get @@ -68570,14 +79510,27 @@ public virtual string AcademicSubjectDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardAcademicSubject")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -68596,7 +79549,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardAcademicSubject")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -68624,7 +79617,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LearningStandard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); @@ -68712,6 +79705,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardContentStandard : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILearningStandardContentStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -68720,8 +79714,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LearningStandardContentStandard() { LearningStandardContentStandardAuthors = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -68729,7 +79723,7 @@ public LearningStandardContentStandard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LearningStandard LearningStandard { get; set; } Entities.Common.EdFi.ILearningStandard ILearningStandardContentStandard.LearningStandard @@ -68748,6 +79742,7 @@ Entities.Common.EdFi.ILearningStandard ILearningStandardContentStandard.Learning // ============================================================= // Properties // ------------------------------------------------------------- + [Key(1)] public virtual DateTime? BeginDate { get { return _beginDate; } @@ -68767,6 +79762,7 @@ public virtual DateTime? BeginDate private DateTime? _beginDate; + [Key(2)] public virtual DateTime? EndDate { get { return _endDate; } @@ -68786,7 +79782,9 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(3)] public virtual long? MandatingEducationOrganizationId { get; set; } + [Key(4)] public virtual DateTime? PublicationDate { get { return _publicationDate; } @@ -68806,6 +79804,7 @@ public virtual DateTime? PublicationDate private DateTime? _publicationDate; + [Key(5)] public virtual int? PublicationStatusDescriptorId { get @@ -68825,6 +79824,7 @@ public virtual int? PublicationStatusDescriptorId private int? _publicationStatusDescriptorId; private string _publicationStatusDescriptor; + [IgnoreMember] public virtual string PublicationStatusDescriptor { get @@ -68840,9 +79840,13 @@ public virtual string PublicationStatusDescriptor _publicationStatusDescriptorId = default(int?); } } + [Key(6)] public virtual short? PublicationYear { get; set; } + [Key(7)] public virtual string Title { get; set; } + [Key(8)] public virtual string URI { get; set; } + [Key(9)] public virtual string Version { get; set; } // ------------------------------------------------------------- @@ -68856,14 +79860,27 @@ public virtual string PublicationStatusDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardContentStandard")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -68882,12 +79899,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardContentStandard")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData MandatingEducationOrganizationReferenceData { get; set; } /// @@ -68916,6 +79974,8 @@ string Entities.Common.EdFi.ILearningStandardContentStandard.MandatingEducationO private ICollection _learningStandardContentStandardAuthors; private ICollection _learningStandardContentStandardAuthorsCovariant; + [Key(13)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LearningStandardContentStandardAuthors { get @@ -68925,6 +79985,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LearningStandardContentStandardAuthors"); + } + foreach (var item in _learningStandardContentStandardAuthors) if (item.LearningStandardContentStandard == null) item.LearningStandardContentStandard = this; @@ -68977,7 +80042,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LearningStandard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values @@ -69064,6 +80129,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardContentStandardAuthor : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILearningStandardContentStandardAuthor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -69071,8 +80137,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LearningStandardContentStandardAuthor() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -69080,7 +80146,7 @@ public LearningStandardContentStandardAuthor() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LearningStandardContentStandard LearningStandardContentStandard { get; set; } Entities.Common.EdFi.ILearningStandardContentStandard ILearningStandardContentStandardAuthor.LearningStandardContentStandard @@ -69090,6 +80156,7 @@ Entities.Common.EdFi.ILearningStandardContentStandard ILearningStandardContentSt } [DomainSignature] + [Key(1)] public virtual string Author { get; set; } // ------------------------------------------------------------- @@ -69113,14 +80180,27 @@ Entities.Common.EdFi.ILearningStandardContentStandard ILearningStandardContentSt // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardContentStandardAuthor")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -69139,7 +80219,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardContentStandardAuthor")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -69166,7 +80286,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandardContentStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LearningStandardContentStandard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("Author", Author); @@ -69254,6 +80374,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILearningStandardGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -69261,8 +80382,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LearningStandardGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -69270,7 +80391,7 @@ public LearningStandardGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LearningStandard LearningStandard { get; set; } Entities.Common.EdFi.ILearningStandard ILearningStandardGradeLevel.LearningStandard @@ -69280,6 +80401,7 @@ Entities.Common.EdFi.ILearningStandard ILearningStandardGradeLevel.LearningStand } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -69299,6 +80421,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -69336,14 +80459,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -69362,7 +80498,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -69390,7 +80566,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LearningStandard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -69478,6 +80654,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardIdentificationCode : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILearningStandardIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -69485,8 +80662,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LearningStandardIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -69494,7 +80671,7 @@ public LearningStandardIdentificationCode() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LearningStandard LearningStandard { get; set; } Entities.Common.EdFi.ILearningStandard ILearningStandardIdentificationCode.LearningStandard @@ -69504,8 +80681,10 @@ Entities.Common.EdFi.ILearningStandard ILearningStandardIdentificationCode.Learn } [DomainSignature] + [Key(1)] public virtual string ContentStandardName { get; set; } [DomainSignature] + [Key(2)] public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- @@ -69529,14 +80708,27 @@ Entities.Common.EdFi.ILearningStandard ILearningStandardIdentificationCode.Learn // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardIdentificationCode")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -69555,7 +80747,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LearningStandard", "LearningStandardIdentificationCode")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -69582,7 +80814,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LearningStandard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LearningStandard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ContentStandardName", ContentStandardName); @@ -69676,6 +80908,7 @@ namespace EdFi.Ods.Entities.NHibernate.LearningStandardCategoryDescriptorAggrega /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILearningStandardCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -69684,6 +80917,7 @@ public class LearningStandardCategoryDescriptor : DescriptorAggregate.EdFi.Descr // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LearningStandardCategoryDescriptorId { get { return base.DescriptorId; } @@ -69850,25 +81084,31 @@ namespace EdFi.Ods.Entities.NHibernate.LearningStandardEquivalenceAssociationAgg /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LearningStandardEquivalenceAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual string SourceLearningStandardId { get; set; } + [Key(2)] public virtual string TargetLearningStandardId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -69935,6 +81175,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardEquivalenceAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILearningStandardEquivalenceAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -69942,8 +81183,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LearningStandardEquivalenceAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -69952,10 +81193,13 @@ public LearningStandardEquivalenceAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(7)] public virtual string SourceLearningStandardId { get; set; } [DomainSignature] + [Key(8)] public virtual string TargetLearningStandardId { get; set; } // ------------------------------------------------------------- @@ -69967,6 +81211,7 @@ public LearningStandardEquivalenceAssociation() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual DateTime? EffectiveDate { get { return _effectiveDate; } @@ -69986,7 +81231,9 @@ public virtual DateTime? EffectiveDate private DateTime? _effectiveDate; + [Key(10)] public virtual string LearningStandardEquivalenceStrengthDescription { get; set; } + [Key(11)] public virtual int? LearningStandardEquivalenceStrengthDescriptorId { get @@ -70006,6 +81253,7 @@ public virtual int? LearningStandardEquivalenceStrengthDescriptorId private int? _learningStandardEquivalenceStrengthDescriptorId; private string _learningStandardEquivalenceStrengthDescriptor; + [IgnoreMember] public virtual string LearningStandardEquivalenceStrengthDescriptor { get @@ -70033,14 +81281,27 @@ public virtual string LearningStandardEquivalenceStrengthDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LearningStandardEquivalenceAssociation", "LearningStandardEquivalenceAssociation")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -70059,12 +81320,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LearningStandardEquivalenceAssociation", "LearningStandardEquivalenceAssociation")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData SourceLearningStandardReferenceData { get; set; } /// @@ -70085,6 +81387,7 @@ string Entities.Common.EdFi.ILearningStandardEquivalenceAssociation.SourceLearni set { } } + [Key(15)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData TargetLearningStandardReferenceData { get; set; } /// @@ -70218,6 +81521,7 @@ namespace EdFi.Ods.Entities.NHibernate.LearningStandardEquivalenceStrengthDescri /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardEquivalenceStrengthDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILearningStandardEquivalenceStrengthDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -70226,6 +81530,7 @@ public class LearningStandardEquivalenceStrengthDescriptor : DescriptorAggregate // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LearningStandardEquivalenceStrengthDescriptorId { get { return base.DescriptorId; } @@ -70397,6 +81702,7 @@ namespace EdFi.Ods.Entities.NHibernate.LearningStandardScopeDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LearningStandardScopeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILearningStandardScopeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -70405,6 +81711,7 @@ public class LearningStandardScopeDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LearningStandardScopeDescriptorId { get { return base.DescriptorId; } @@ -70576,6 +81883,7 @@ namespace EdFi.Ods.Entities.NHibernate.LevelOfEducationDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LevelOfEducationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILevelOfEducationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -70584,6 +81892,7 @@ public class LevelOfEducationDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LevelOfEducationDescriptorId { get { return base.DescriptorId; } @@ -70755,6 +82064,7 @@ namespace EdFi.Ods.Entities.NHibernate.LicenseStatusDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LicenseStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILicenseStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -70763,6 +82073,7 @@ public class LicenseStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LicenseStatusDescriptorId { get { return base.DescriptorId; } @@ -70934,6 +82245,7 @@ namespace EdFi.Ods.Entities.NHibernate.LicenseTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LicenseTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILicenseTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -70942,6 +82254,7 @@ public class LicenseTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LicenseTypeDescriptorId { get { return base.DescriptorId; } @@ -71113,6 +82426,7 @@ namespace EdFi.Ods.Entities.NHibernate.LimitedEnglishProficiencyDescriptorAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LimitedEnglishProficiencyDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILimitedEnglishProficiencyDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -71121,6 +82435,7 @@ public class LimitedEnglishProficiencyDescriptor : DescriptorAggregate.EdFi.Desc // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LimitedEnglishProficiencyDescriptorId { get { return base.DescriptorId; } @@ -71287,25 +82602,31 @@ namespace EdFi.Ods.Entities.NHibernate.LocalAccountAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LocalAccountReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AccountIdentifier { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -71372,6 +82693,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalAccount : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILocalAccount, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -71380,8 +82702,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalAccount() { LocalAccountReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -71390,10 +82712,13 @@ public LocalAccount() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AccountIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -71405,8 +82730,11 @@ public LocalAccount() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual string AccountName { get; set; } + [Key(10)] public virtual long ChartOfAccountEducationOrganizationId { get; set; } + [Key(11)] public virtual string ChartOfAccountIdentifier { get; set; } // ------------------------------------------------------------- @@ -71420,14 +82748,27 @@ public LocalAccount() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalAccount", "LocalAccount")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -71446,12 +82787,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalAccount", "LocalAccount")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.ChartOfAccountAggregate.EdFi.ChartOfAccountReferenceData ChartOfAccountReferenceData { get; set; } /// @@ -71472,6 +82854,7 @@ string Entities.Common.EdFi.ILocalAccount.ChartOfAccountDiscriminator set { } } + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -71500,6 +82883,8 @@ string Entities.Common.EdFi.ILocalAccount.EducationOrganizationDiscriminator private ICollection _localAccountReportingTags; private ICollection _localAccountReportingTagsCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LocalAccountReportingTags { get @@ -71509,6 +82894,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LocalAccountReportingTags"); + } + foreach (var item in _localAccountReportingTags) if (item.LocalAccount == null) item.LocalAccount = this; @@ -71646,6 +83036,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalAccountReportingTag : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILocalAccountReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -71653,8 +83044,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalAccountReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -71662,7 +83053,7 @@ public LocalAccountReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LocalAccount LocalAccount { get; set; } Entities.Common.EdFi.ILocalAccount ILocalAccountReportingTag.LocalAccount @@ -71672,6 +83063,7 @@ Entities.Common.EdFi.ILocalAccount ILocalAccountReportingTag.LocalAccount } [DomainSignature] + [Key(1)] public virtual int ReportingTagDescriptorId { get @@ -71691,6 +83083,7 @@ public virtual int ReportingTagDescriptorId private int _reportingTagDescriptorId; private string _reportingTagDescriptor; + [IgnoreMember] public virtual string ReportingTagDescriptor { get @@ -71716,6 +83109,7 @@ public virtual string ReportingTagDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string TagValue { get; set; } // ------------------------------------------------------------- @@ -71729,14 +83123,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalAccount", "LocalAccountReportingTag")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -71755,7 +83162,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalAccount", "LocalAccountReportingTag")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -71783,7 +83230,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LocalAccount as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LocalAccount as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -71871,26 +83318,33 @@ namespace EdFi.Ods.Entities.NHibernate.LocalActualAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LocalActualReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AccountIdentifier { get; set; } + [Key(1)] public virtual DateTime AsOfDate { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -71958,6 +83412,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalActual : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILocalActual, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -71965,8 +83420,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalActual() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -71975,8 +83430,10 @@ public LocalActual() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AccountIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual DateTime AsOfDate { get { return _asOfDate; } @@ -71987,8 +83444,10 @@ public virtual DateTime AsOfDate private DateTime _asOfDate; [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -72000,7 +83459,9 @@ public virtual DateTime AsOfDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual decimal Amount { get; set; } + [Key(11)] public virtual int? FinancialCollectionDescriptorId { get @@ -72020,6 +83481,7 @@ public virtual int? FinancialCollectionDescriptorId private int? _financialCollectionDescriptorId; private string _financialCollectionDescriptor; + [IgnoreMember] public virtual string FinancialCollectionDescriptor { get @@ -72047,14 +83509,27 @@ public virtual string FinancialCollectionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalActual", "LocalActual")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -72073,12 +83548,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalActual", "LocalActual")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } /// @@ -72208,26 +83724,33 @@ namespace EdFi.Ods.Entities.NHibernate.LocalBudgetAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LocalBudgetReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AccountIdentifier { get; set; } + [Key(1)] public virtual DateTime AsOfDate { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -72295,6 +83818,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalBudget : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILocalBudget, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -72302,8 +83826,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalBudget() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -72312,8 +83836,10 @@ public LocalBudget() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AccountIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual DateTime AsOfDate { get { return _asOfDate; } @@ -72324,8 +83850,10 @@ public virtual DateTime AsOfDate private DateTime _asOfDate; [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -72337,7 +83865,9 @@ public virtual DateTime AsOfDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual decimal Amount { get; set; } + [Key(11)] public virtual int? FinancialCollectionDescriptorId { get @@ -72357,6 +83887,7 @@ public virtual int? FinancialCollectionDescriptorId private int? _financialCollectionDescriptorId; private string _financialCollectionDescriptor; + [IgnoreMember] public virtual string FinancialCollectionDescriptor { get @@ -72384,14 +83915,27 @@ public virtual string FinancialCollectionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalBudget", "LocalBudget")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -72410,12 +83954,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalBudget", "LocalBudget")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } /// @@ -72545,27 +84130,35 @@ namespace EdFi.Ods.Entities.NHibernate.LocalContractedStaffAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LocalContractedStaffReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AccountIdentifier { get; set; } + [Key(1)] public virtual DateTime AsOfDate { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual int FiscalYear { get; set; } + [Key(4)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -72634,6 +84227,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalContractedStaff : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILocalContractedStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -72641,8 +84235,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalContractedStaff() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -72651,8 +84245,10 @@ public LocalContractedStaff() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AccountIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual DateTime AsOfDate { get { return _asOfDate; } @@ -72663,10 +84259,13 @@ public virtual DateTime AsOfDate private DateTime _asOfDate; [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual int FiscalYear { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(10)] public virtual int StaffUSI { get @@ -72692,6 +84291,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -72725,7 +84325,9 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(11)] public virtual decimal Amount { get; set; } + [Key(12)] public virtual int? FinancialCollectionDescriptorId { get @@ -72745,6 +84347,7 @@ public virtual int? FinancialCollectionDescriptorId private int? _financialCollectionDescriptorId; private string _financialCollectionDescriptor; + [IgnoreMember] public virtual string FinancialCollectionDescriptor { get @@ -72772,14 +84375,27 @@ public virtual string FinancialCollectionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalContractedStaff", "LocalContractedStaff")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -72798,12 +84414,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalContractedStaff", "LocalContractedStaff")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } /// @@ -72824,6 +84481,7 @@ string Entities.Common.EdFi.ILocalContractedStaff.LocalAccountDiscriminator set { } } + [Key(16)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -72959,6 +84617,7 @@ namespace EdFi.Ods.Entities.NHibernate.LocaleDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocaleDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILocaleDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -72967,6 +84626,7 @@ public class LocaleDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LocaleDescriptorId { get { return base.DescriptorId; } @@ -73138,6 +84798,7 @@ namespace EdFi.Ods.Entities.NHibernate.LocalEducationAgencyAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalEducationAgency : EducationOrganizationAggregate.EdFi.EducationOrganization, Entities.Common.EdFi.ILocalEducationAgency, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -73145,8 +84806,8 @@ public LocalEducationAgency() { LocalEducationAgencyAccountabilities = new HashSet(); LocalEducationAgencyFederalFunds = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -73155,6 +84816,7 @@ public LocalEducationAgency() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual long LocalEducationAgencyId { get { return base.EducationOrganizationId; } @@ -73191,6 +84853,7 @@ string IEducationOrganization.WebSite // ============================================================= // Properties // ------------------------------------------------------------- + [Key(17)] public virtual int? CharterStatusDescriptorId { get @@ -73210,6 +84873,7 @@ public virtual int? CharterStatusDescriptorId private int? _charterStatusDescriptorId; private string _charterStatusDescriptor; + [IgnoreMember] public virtual string CharterStatusDescriptor { get @@ -73225,7 +84889,9 @@ public virtual string CharterStatusDescriptor _charterStatusDescriptorId = default(int?); } } + [Key(18)] public virtual long? EducationServiceCenterId { get; set; } + [Key(19)] public virtual int LocalEducationAgencyCategoryDescriptorId { get @@ -73245,6 +84911,7 @@ public virtual int LocalEducationAgencyCategoryDescriptorId private int _localEducationAgencyCategoryDescriptorId; private string _localEducationAgencyCategoryDescriptor; + [IgnoreMember] public virtual string LocalEducationAgencyCategoryDescriptor { get @@ -73260,7 +84927,9 @@ public virtual string LocalEducationAgencyCategoryDescriptor _localEducationAgencyCategoryDescriptorId = default(int); } } + [Key(20)] public virtual long? ParentLocalEducationAgencyId { get; set; } + [Key(21)] public virtual long? StateEducationAgencyId { get; set; } // ------------------------------------------------------------- @@ -73274,14 +84943,27 @@ public virtual string LocalEducationAgencyCategoryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalEducationAgency", "LocalEducationAgency")] + [Key(22)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -73300,12 +84982,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalEducationAgency", "LocalEducationAgency")] + [Key(23)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(24)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationServiceCenterReferenceData { get; set; } /// @@ -73317,6 +85040,7 @@ public IDictionary Extensions set { } } + [Key(25)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParentLocalEducationAgencyReferenceData { get; set; } /// @@ -73328,6 +85052,7 @@ public IDictionary Extensions set { } } + [Key(26)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData StateEducationAgencyReferenceData { get; set; } /// @@ -73347,6 +85072,8 @@ public IDictionary Extensions private ICollection _localEducationAgencyAccountabilities; private ICollection _localEducationAgencyAccountabilitiesCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LocalEducationAgencyAccountabilities { get @@ -73356,6 +85083,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LocalEducationAgencyAccountabilities"); + } + foreach (var item in _localEducationAgencyAccountabilities) if (item.LocalEducationAgency == null) item.LocalEducationAgency = this; @@ -73394,6 +85126,8 @@ public virtual ICollection _localEducationAgencyFederalFunds; private ICollection _localEducationAgencyFederalFundsCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection LocalEducationAgencyFederalFunds { get @@ -73403,6 +85137,11 @@ public virtual ICollection set) + { + set.Reattach(this, "LocalEducationAgencyFederalFunds"); + } + foreach (var item in _localEducationAgencyFederalFunds) if (item.LocalEducationAgency == null) item.LocalEducationAgency = this; @@ -73541,6 +85280,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalEducationAgencyAccountability : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILocalEducationAgencyAccountability, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -73548,8 +85288,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalEducationAgencyAccountability() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -73557,7 +85297,7 @@ public LocalEducationAgencyAccountability() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LocalEducationAgency LocalEducationAgency { get; set; } Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyAccountability.LocalEducationAgency @@ -73567,6 +85307,7 @@ Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyAccountability.L } [DomainSignature] + [Key(1)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- @@ -73578,6 +85319,7 @@ Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyAccountability.L // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? GunFreeSchoolsActReportingStatusDescriptorId { get @@ -73597,6 +85339,7 @@ public virtual int? GunFreeSchoolsActReportingStatusDescriptorId private int? _gunFreeSchoolsActReportingStatusDescriptorId; private string _gunFreeSchoolsActReportingStatusDescriptor; + [IgnoreMember] public virtual string GunFreeSchoolsActReportingStatusDescriptor { get @@ -73612,6 +85355,7 @@ public virtual string GunFreeSchoolsActReportingStatusDescriptor _gunFreeSchoolsActReportingStatusDescriptorId = default(int?); } } + [Key(3)] public virtual int? SchoolChoiceImplementStatusDescriptorId { get @@ -73631,6 +85375,7 @@ public virtual int? SchoolChoiceImplementStatusDescriptorId private int? _schoolChoiceImplementStatusDescriptorId; private string _schoolChoiceImplementStatusDescriptor; + [IgnoreMember] public virtual string SchoolChoiceImplementStatusDescriptor { get @@ -73658,14 +85403,27 @@ public virtual string SchoolChoiceImplementStatusDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalEducationAgency", "LocalEducationAgencyAccountability")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -73684,12 +85442,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalEducationAgency", "LocalEducationAgencyAccountability")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -73724,7 +85523,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SchoolYear", SchoolYear); @@ -73812,6 +85611,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalEducationAgencyFederalFunds : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ILocalEducationAgencyFederalFunds, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -73819,8 +85619,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalEducationAgencyFederalFunds() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -73828,7 +85628,7 @@ public LocalEducationAgencyFederalFunds() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual LocalEducationAgency LocalEducationAgency { get; set; } Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.LocalEducationAgency @@ -73838,6 +85638,7 @@ Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.Loc } [DomainSignature] + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -73849,13 +85650,21 @@ Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.Loc // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? InnovativeDollarsSpent { get; set; } + [Key(3)] public virtual decimal? InnovativeDollarsSpentStrategicPriorities { get; set; } + [Key(4)] public virtual decimal? InnovativeProgramsFundsReceived { get; set; } + [Key(5)] public virtual decimal? SchoolImprovementAllocation { get; set; } + [Key(6)] public virtual decimal? SchoolImprovementReservedFundsPercentage { get; set; } + [Key(7)] public virtual decimal? StateAssessmentAdministrationFunding { get; set; } + [Key(8)] public virtual decimal? SupplementalEducationalServicesFundsSpent { get; set; } + [Key(9)] public virtual decimal? SupplementalEducationalServicesPerPupilExpenditure { get; set; } // ------------------------------------------------------------- @@ -73869,14 +85678,27 @@ Entities.Common.EdFi.ILocalEducationAgency ILocalEducationAgencyFederalFunds.Loc // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalEducationAgency", "LocalEducationAgencyFederalFunds")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -73895,7 +85717,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalEducationAgency", "LocalEducationAgencyFederalFunds")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -73922,7 +85784,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (LocalEducationAgency as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("FiscalYear", FiscalYear); @@ -74015,6 +85877,7 @@ namespace EdFi.Ods.Entities.NHibernate.LocalEducationAgencyCategoryDescriptorAgg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalEducationAgencyCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ILocalEducationAgencyCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -74023,6 +85886,7 @@ public class LocalEducationAgencyCategoryDescriptor : DescriptorAggregate.EdFi.D // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int LocalEducationAgencyCategoryDescriptorId { get { return base.DescriptorId; } @@ -74189,26 +86053,33 @@ namespace EdFi.Ods.Entities.NHibernate.LocalEncumbranceAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LocalEncumbranceReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AccountIdentifier { get; set; } + [Key(1)] public virtual DateTime AsOfDate { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -74276,6 +86147,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalEncumbrance : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILocalEncumbrance, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -74283,8 +86155,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalEncumbrance() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -74293,8 +86165,10 @@ public LocalEncumbrance() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AccountIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual DateTime AsOfDate { get { return _asOfDate; } @@ -74305,8 +86179,10 @@ public virtual DateTime AsOfDate private DateTime _asOfDate; [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -74318,7 +86194,9 @@ public virtual DateTime AsOfDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual decimal Amount { get; set; } + [Key(11)] public virtual int? FinancialCollectionDescriptorId { get @@ -74338,6 +86216,7 @@ public virtual int? FinancialCollectionDescriptorId private int? _financialCollectionDescriptorId; private string _financialCollectionDescriptor; + [IgnoreMember] public virtual string FinancialCollectionDescriptor { get @@ -74365,14 +86244,27 @@ public virtual string FinancialCollectionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalEncumbrance", "LocalEncumbrance")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -74391,12 +86283,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalEncumbrance", "LocalEncumbrance")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } /// @@ -74526,27 +86459,35 @@ namespace EdFi.Ods.Entities.NHibernate.LocalPayrollAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LocalPayrollReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AccountIdentifier { get; set; } + [Key(1)] public virtual DateTime AsOfDate { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual int FiscalYear { get; set; } + [Key(4)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -74615,6 +86556,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class LocalPayroll : AggregateRootWithCompositeKey, Entities.Common.EdFi.ILocalPayroll, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -74622,8 +86564,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public LocalPayroll() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -74632,8 +86574,10 @@ public LocalPayroll() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AccountIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual DateTime AsOfDate { get { return _asOfDate; } @@ -74644,10 +86588,13 @@ public virtual DateTime AsOfDate private DateTime _asOfDate; [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual int FiscalYear { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(10)] public virtual int StaffUSI { get @@ -74673,6 +86620,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -74706,7 +86654,9 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(11)] public virtual decimal Amount { get; set; } + [Key(12)] public virtual int? FinancialCollectionDescriptorId { get @@ -74726,6 +86676,7 @@ public virtual int? FinancialCollectionDescriptorId private int? _financialCollectionDescriptorId; private string _financialCollectionDescriptor; + [IgnoreMember] public virtual string FinancialCollectionDescriptor { get @@ -74753,14 +86704,27 @@ public virtual string FinancialCollectionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "LocalPayroll", "LocalPayroll")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -74779,12 +86743,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "LocalPayroll", "LocalPayroll")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.LocalAccountAggregate.EdFi.LocalAccountReferenceData LocalAccountReferenceData { get; set; } /// @@ -74805,6 +86810,7 @@ string Entities.Common.EdFi.ILocalPayroll.LocalAccountDiscriminator set { } } + [Key(16)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -74935,24 +86941,29 @@ namespace EdFi.Ods.Entities.NHibernate.LocationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class LocationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string ClassroomIdentificationCode { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -75018,6 +87029,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Location : AggregateRootWithCompositeKey, IHasCascadableKeyValues, Entities.Common.EdFi.ILocation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -75025,8 +87037,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public Location() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -75035,8 +87047,10 @@ public Location() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string ClassroomIdentificationCode { get; set; } [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } // ------------------------------------------------------------- @@ -75048,7 +87062,9 @@ public Location() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual int? MaximumNumberOfSeats { get; set; } + [Key(9)] public virtual int? OptimalNumberOfSeats { get; set; } // ------------------------------------------------------------- @@ -75062,14 +87078,27 @@ public Location() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Location", "Location")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -75088,12 +87117,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Location", "Location")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// @@ -75222,6 +87292,7 @@ namespace EdFi.Ods.Entities.NHibernate.MagnetSpecialProgramEmphasisSchoolDescrip /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class MagnetSpecialProgramEmphasisSchoolDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IMagnetSpecialProgramEmphasisSchoolDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -75230,6 +87301,7 @@ public class MagnetSpecialProgramEmphasisSchoolDescriptor : DescriptorAggregate. // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int MagnetSpecialProgramEmphasisSchoolDescriptorId { get { return base.DescriptorId; } @@ -75401,6 +87473,7 @@ namespace EdFi.Ods.Entities.NHibernate.MediumOfInstructionDescriptorAggregate.Ed /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class MediumOfInstructionDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IMediumOfInstructionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -75409,6 +87482,7 @@ public class MediumOfInstructionDescriptor : DescriptorAggregate.EdFi.Descriptor // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int MediumOfInstructionDescriptorId { get { return base.DescriptorId; } @@ -75580,6 +87654,7 @@ namespace EdFi.Ods.Entities.NHibernate.MethodCreditEarnedDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class MethodCreditEarnedDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IMethodCreditEarnedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -75588,6 +87663,7 @@ public class MethodCreditEarnedDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int MethodCreditEarnedDescriptorId { get { return base.DescriptorId; } @@ -75759,6 +87835,7 @@ namespace EdFi.Ods.Entities.NHibernate.MigrantEducationProgramServiceDescriptorA /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class MigrantEducationProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IMigrantEducationProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -75767,6 +87844,7 @@ public class MigrantEducationProgramServiceDescriptor : DescriptorAggregate.EdFi // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int MigrantEducationProgramServiceDescriptorId { get { return base.DescriptorId; } @@ -75938,6 +88016,7 @@ namespace EdFi.Ods.Entities.NHibernate.ModelEntityDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ModelEntityDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IModelEntityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -75946,6 +88025,7 @@ public class ModelEntityDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ModelEntityDescriptorId { get { return base.DescriptorId; } @@ -76117,6 +88197,7 @@ namespace EdFi.Ods.Entities.NHibernate.MonitoredDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class MonitoredDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IMonitoredDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -76125,6 +88206,7 @@ public class MonitoredDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int MonitoredDescriptorId { get { return base.DescriptorId; } @@ -76296,6 +88378,7 @@ namespace EdFi.Ods.Entities.NHibernate.NeglectedOrDelinquentProgramDescriptorAgg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class NeglectedOrDelinquentProgramDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.INeglectedOrDelinquentProgramDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -76304,6 +88387,7 @@ public class NeglectedOrDelinquentProgramDescriptor : DescriptorAggregate.EdFi.D // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int NeglectedOrDelinquentProgramDescriptorId { get { return base.DescriptorId; } @@ -76475,6 +88559,7 @@ namespace EdFi.Ods.Entities.NHibernate.NeglectedOrDelinquentProgramServiceDescri /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class NeglectedOrDelinquentProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.INeglectedOrDelinquentProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -76483,6 +88568,7 @@ public class NeglectedOrDelinquentProgramServiceDescriptor : DescriptorAggregate // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int NeglectedOrDelinquentProgramServiceDescriptorId { get { return base.DescriptorId; } @@ -76654,6 +88740,7 @@ namespace EdFi.Ods.Entities.NHibernate.NetworkPurposeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class NetworkPurposeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.INetworkPurposeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -76662,6 +88749,7 @@ public class NetworkPurposeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int NetworkPurposeDescriptorId { get { return base.DescriptorId; } @@ -76833,6 +88921,7 @@ namespace EdFi.Ods.Entities.NHibernate.NonMedicalImmunizationExemptionDescriptor /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class NonMedicalImmunizationExemptionDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.INonMedicalImmunizationExemptionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -76841,6 +88930,7 @@ public class NonMedicalImmunizationExemptionDescriptor : DescriptorAggregate.EdF // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int NonMedicalImmunizationExemptionDescriptorId { get { return base.DescriptorId; } @@ -77007,24 +89097,29 @@ namespace EdFi.Ods.Entities.NHibernate.ObjectDimensionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ObjectDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Code { get; set; } + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -77090,6 +89185,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ObjectDimension : AggregateRootWithCompositeKey, Entities.Common.EdFi.IObjectDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -77098,8 +89194,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ObjectDimension() { ObjectDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -77108,8 +89204,10 @@ public ObjectDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Code { get; set; } [DomainSignature] + [Key(7)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -77121,6 +89219,7 @@ public ObjectDimension() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual string CodeName { get; set; } // ------------------------------------------------------------- @@ -77134,14 +89233,27 @@ public ObjectDimension() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ObjectDimension", "ObjectDimension")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -77160,7 +89272,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ObjectDimension", "ObjectDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -77174,6 +89326,8 @@ public IDictionary Extensions private ICollection _objectDimensionReportingTags; private ICollection _objectDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ObjectDimensionReportingTags { get @@ -77183,6 +89337,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ObjectDimensionReportingTags"); + } + foreach (var item in _objectDimensionReportingTags) if (item.ObjectDimension == null) item.ObjectDimension = this; @@ -77319,6 +89478,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ObjectDimensionReportingTag : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IObjectDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -77326,8 +89486,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ObjectDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -77335,7 +89495,7 @@ public ObjectDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ObjectDimension ObjectDimension { get; set; } Entities.Common.EdFi.IObjectDimension IObjectDimensionReportingTag.ObjectDimension @@ -77345,6 +89505,7 @@ Entities.Common.EdFi.IObjectDimension IObjectDimensionReportingTag.ObjectDimensi } [DomainSignature] + [Key(1)] public virtual int ReportingTagDescriptorId { get @@ -77364,6 +89525,7 @@ public virtual int ReportingTagDescriptorId private int _reportingTagDescriptorId; private string _reportingTagDescriptor; + [IgnoreMember] public virtual string ReportingTagDescriptor { get @@ -77401,14 +89563,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ObjectDimension", "ObjectDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -77427,7 +89602,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ObjectDimension", "ObjectDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -77455,7 +89670,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ObjectDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ObjectDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -77543,25 +89758,31 @@ namespace EdFi.Ods.Entities.NHibernate.ObjectiveAssessmentAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ObjectiveAssessmentReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AssessmentIdentifier { get; set; } + [Key(1)] public virtual string IdentificationCode { get; set; } + [Key(2)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -77628,6 +89849,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ObjectiveAssessment : AggregateRootWithCompositeKey, Entities.Common.EdFi.IObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -77639,8 +89861,8 @@ public ObjectiveAssessment() ObjectiveAssessmentLearningStandards = new HashSet(); ObjectiveAssessmentPerformanceLevels = new HashSet(); ObjectiveAssessmentScores = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -77649,10 +89871,13 @@ public ObjectiveAssessment() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string IdentificationCode { get; set; } [DomainSignature] + [Key(8)] public virtual string Namespace { get; set; } // ------------------------------------------------------------- @@ -77664,6 +89889,7 @@ public ObjectiveAssessment() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual int? AcademicSubjectDescriptorId { get @@ -77683,6 +89909,7 @@ public virtual int? AcademicSubjectDescriptorId private int? _academicSubjectDescriptorId; private string _academicSubjectDescriptor; + [IgnoreMember] public virtual string AcademicSubjectDescriptor { get @@ -77698,10 +89925,15 @@ public virtual string AcademicSubjectDescriptor _academicSubjectDescriptorId = default(int?); } } + [Key(10)] public virtual string Description { get; set; } + [Key(11)] public virtual decimal? MaxRawScore { get; set; } + [Key(12)] public virtual string Nomenclature { get; set; } + [Key(13)] public virtual string ParentIdentificationCode { get; set; } + [Key(14)] public virtual decimal? PercentOfAssessment { get; set; } // ------------------------------------------------------------- @@ -77715,14 +89947,27 @@ public virtual string AcademicSubjectDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessment")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -77741,12 +89986,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessment")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } /// @@ -77767,6 +90053,7 @@ string Entities.Common.EdFi.IObjectiveAssessment.AssessmentDiscriminator set { } } + [Key(18)] public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ParentObjectiveAssessmentReferenceData { get; set; } /// @@ -77795,6 +90082,8 @@ string Entities.Common.EdFi.IObjectiveAssessment.ParentObjectiveAssessmentDiscri private ICollection _objectiveAssessmentAssessmentItems; private ICollection _objectiveAssessmentAssessmentItemsCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ObjectiveAssessmentAssessmentItems { get @@ -77804,6 +90093,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ObjectiveAssessmentAssessmentItems"); + } + foreach (var item in _objectiveAssessmentAssessmentItems) if (item.ObjectiveAssessment == null) item.ObjectiveAssessment = this; @@ -77842,6 +90136,8 @@ public virtual ICollection _objectiveAssessmentLearningStandards; private ICollection _objectiveAssessmentLearningStandardsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ObjectiveAssessmentLearningStandards { get @@ -77851,6 +90147,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ObjectiveAssessmentLearningStandards"); + } + foreach (var item in _objectiveAssessmentLearningStandards) if (item.ObjectiveAssessment == null) item.ObjectiveAssessment = this; @@ -77889,6 +90190,8 @@ public virtual ICollection _objectiveAssessmentPerformanceLevels; private ICollection _objectiveAssessmentPerformanceLevelsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ObjectiveAssessmentPerformanceLevels { get @@ -77898,6 +90201,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ObjectiveAssessmentPerformanceLevels"); + } + foreach (var item in _objectiveAssessmentPerformanceLevels) if (item.ObjectiveAssessment == null) item.ObjectiveAssessment = this; @@ -77936,6 +90244,8 @@ public virtual ICollection _objectiveAssessmentScores; private ICollection _objectiveAssessmentScoresCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ObjectiveAssessmentScores { get @@ -77945,6 +90255,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ObjectiveAssessmentScores"); + } + foreach (var item in _objectiveAssessmentScores) if (item.ObjectiveAssessment == null) item.ObjectiveAssessment = this; @@ -78083,6 +90398,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ObjectiveAssessmentAssessmentItem : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IObjectiveAssessmentAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -78090,8 +90406,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ObjectiveAssessmentAssessmentItem() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -78099,7 +90415,7 @@ public ObjectiveAssessmentAssessmentItem() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.ObjectiveAssessment @@ -78109,6 +90425,7 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.Obj } [DomainSignature] + [Key(1)] public virtual string AssessmentItemIdentificationCode { get; set; } // ------------------------------------------------------------- @@ -78132,14 +90449,27 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentAssessmentItem.Obj // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentAssessmentItem")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -78158,12 +90488,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentAssessmentItem")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.AssessmentItemAggregate.EdFi.AssessmentItemReferenceData AssessmentItemReferenceData { get; set; } /// @@ -78205,7 +90576,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentItemIdentificationCode", AssessmentItemIdentificationCode); @@ -78293,6 +90664,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ObjectiveAssessmentLearningStandard : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IObjectiveAssessmentLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -78300,8 +90672,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ObjectiveAssessmentLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -78309,7 +90681,7 @@ public ObjectiveAssessmentLearningStandard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.ObjectiveAssessment @@ -78319,6 +90691,7 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.O } [DomainSignature] + [Key(1)] public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- @@ -78342,14 +90715,27 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentLearningStandard.O // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentLearningStandard")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -78368,12 +90754,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentLearningStandard")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } /// @@ -78415,7 +90842,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningStandardId", LearningStandardId); @@ -78503,6 +90930,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ObjectiveAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IObjectiveAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -78510,8 +90938,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ObjectiveAssessmentPerformanceLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -78519,7 +90947,7 @@ public ObjectiveAssessmentPerformanceLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentPerformanceLevel.ObjectiveAssessment @@ -78529,6 +90957,7 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentPerformanceLevel.O } [DomainSignature] + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -78548,6 +90977,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -78564,6 +90994,7 @@ public virtual string AssessmentReportingMethodDescriptor } } [DomainSignature] + [Key(2)] public virtual int PerformanceLevelDescriptorId { get @@ -78583,6 +91014,7 @@ public virtual int PerformanceLevelDescriptorId private int _performanceLevelDescriptorId; private string _performanceLevelDescriptor; + [IgnoreMember] public virtual string PerformanceLevelDescriptor { get @@ -78608,9 +91040,13 @@ public virtual string PerformanceLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual string MaximumScore { get; set; } + [Key(4)] public virtual string MinimumScore { get; set; } + [Key(5)] public virtual string PerformanceLevelIndicatorName { get; set; } + [Key(6)] public virtual int? ResultDatatypeTypeDescriptorId { get @@ -78630,6 +91066,7 @@ public virtual int? ResultDatatypeTypeDescriptorId private int? _resultDatatypeTypeDescriptorId; private string _resultDatatypeTypeDescriptor; + [IgnoreMember] public virtual string ResultDatatypeTypeDescriptor { get @@ -78657,14 +91094,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentPerformanceLevel")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -78683,7 +91133,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentPerformanceLevel")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -78713,7 +91203,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -78802,6 +91292,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ObjectiveAssessmentScore : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IObjectiveAssessmentScore, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -78809,8 +91300,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ObjectiveAssessmentScore() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -78818,7 +91309,7 @@ public ObjectiveAssessmentScore() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ObjectiveAssessment ObjectiveAssessment { get; set; } Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentScore.ObjectiveAssessment @@ -78828,6 +91319,7 @@ Entities.Common.EdFi.IObjectiveAssessment IObjectiveAssessmentScore.ObjectiveAss } [DomainSignature] + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -78847,6 +91339,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -78872,8 +91365,11 @@ public virtual string AssessmentReportingMethodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string MaximumScore { get; set; } + [Key(3)] public virtual string MinimumScore { get; set; } + [Key(4)] public virtual int? ResultDatatypeTypeDescriptorId { get @@ -78893,6 +91389,7 @@ public virtual int? ResultDatatypeTypeDescriptorId private int? _resultDatatypeTypeDescriptorId; private string _resultDatatypeTypeDescriptor; + [IgnoreMember] public virtual string ResultDatatypeTypeDescriptor { get @@ -78920,14 +91417,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentScore")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -78946,7 +91456,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ObjectiveAssessment", "ObjectiveAssessmentScore")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -78975,7 +91525,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ObjectiveAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -79063,24 +91613,29 @@ namespace EdFi.Ods.Entities.NHibernate.OpenStaffPositionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class OpenStaffPositionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string RequisitionNumber { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -79146,6 +91701,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OpenStaffPosition : AggregateRootWithCompositeKey, Entities.Common.EdFi.IOpenStaffPosition, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -79155,8 +91711,8 @@ public OpenStaffPosition() { OpenStaffPositionAcademicSubjects = new HashSet(); OpenStaffPositionInstructionalGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -79165,8 +91721,10 @@ public OpenStaffPosition() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string RequisitionNumber { get; set; } // ------------------------------------------------------------- @@ -79178,6 +91736,7 @@ public OpenStaffPosition() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual DateTime DatePosted { get { return _datePosted; } @@ -79187,6 +91746,7 @@ public virtual DateTime DatePosted private DateTime _datePosted; + [Key(9)] public virtual DateTime? DatePostingRemoved { get { return _datePostingRemoved; } @@ -79206,6 +91766,7 @@ public virtual DateTime? DatePostingRemoved private DateTime? _datePostingRemoved; + [Key(10)] public virtual int EmploymentStatusDescriptorId { get @@ -79225,6 +91786,7 @@ public virtual int EmploymentStatusDescriptorId private int _employmentStatusDescriptorId; private string _employmentStatusDescriptor; + [IgnoreMember] public virtual string EmploymentStatusDescriptor { get @@ -79240,7 +91802,9 @@ public virtual string EmploymentStatusDescriptor _employmentStatusDescriptorId = default(int); } } + [Key(11)] public virtual string PositionTitle { get; set; } + [Key(12)] public virtual int? PostingResultDescriptorId { get @@ -79260,6 +91824,7 @@ public virtual int? PostingResultDescriptorId private int? _postingResultDescriptorId; private string _postingResultDescriptor; + [IgnoreMember] public virtual string PostingResultDescriptor { get @@ -79275,6 +91840,7 @@ public virtual string PostingResultDescriptor _postingResultDescriptorId = default(int?); } } + [Key(13)] public virtual int? ProgramAssignmentDescriptorId { get @@ -79294,6 +91860,7 @@ public virtual int? ProgramAssignmentDescriptorId private int? _programAssignmentDescriptorId; private string _programAssignmentDescriptor; + [IgnoreMember] public virtual string ProgramAssignmentDescriptor { get @@ -79309,6 +91876,7 @@ public virtual string ProgramAssignmentDescriptor _programAssignmentDescriptorId = default(int?); } } + [Key(14)] public virtual int StaffClassificationDescriptorId { get @@ -79328,6 +91896,7 @@ public virtual int StaffClassificationDescriptorId private int _staffClassificationDescriptorId; private string _staffClassificationDescriptor; + [IgnoreMember] public virtual string StaffClassificationDescriptor { get @@ -79355,14 +91924,27 @@ public virtual string StaffClassificationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "OpenStaffPosition", "OpenStaffPosition")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -79381,12 +91963,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "OpenStaffPosition", "OpenStaffPosition")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -79415,6 +92038,8 @@ string Entities.Common.EdFi.IOpenStaffPosition.EducationOrganizationDiscriminato private ICollection _openStaffPositionAcademicSubjects; private ICollection _openStaffPositionAcademicSubjectsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection OpenStaffPositionAcademicSubjects { get @@ -79424,6 +92049,11 @@ public virtual ICollection set) + { + set.Reattach(this, "OpenStaffPositionAcademicSubjects"); + } + foreach (var item in _openStaffPositionAcademicSubjects) if (item.OpenStaffPosition == null) item.OpenStaffPosition = this; @@ -79462,6 +92092,8 @@ public virtual ICollection _openStaffPositionInstructionalGradeLevels; private ICollection _openStaffPositionInstructionalGradeLevelsCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection OpenStaffPositionInstructionalGradeLevels { get @@ -79471,6 +92103,11 @@ public virtual ICollection set) + { + set.Reattach(this, "OpenStaffPositionInstructionalGradeLevels"); + } + foreach (var item in _openStaffPositionInstructionalGradeLevels) if (item.OpenStaffPosition == null) item.OpenStaffPosition = this; @@ -79611,6 +92248,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OpenStaffPositionAcademicSubject : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IOpenStaffPositionAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -79618,8 +92256,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public OpenStaffPositionAcademicSubject() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -79627,7 +92265,7 @@ public OpenStaffPositionAcademicSubject() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual OpenStaffPosition OpenStaffPosition { get; set; } Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionAcademicSubject.OpenStaffPosition @@ -79637,6 +92275,7 @@ Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionAcademicSubject.OpenSt } [DomainSignature] + [Key(1)] public virtual int AcademicSubjectDescriptorId { get @@ -79656,6 +92295,7 @@ public virtual int AcademicSubjectDescriptorId private int _academicSubjectDescriptorId; private string _academicSubjectDescriptor; + [IgnoreMember] public virtual string AcademicSubjectDescriptor { get @@ -79693,14 +92333,27 @@ public virtual string AcademicSubjectDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "OpenStaffPosition", "OpenStaffPositionAcademicSubject")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -79719,7 +92372,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "OpenStaffPosition", "OpenStaffPositionAcademicSubject")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -79747,7 +92440,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); @@ -79835,6 +92528,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OpenStaffPositionInstructionalGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IOpenStaffPositionInstructionalGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -79842,8 +92536,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public OpenStaffPositionInstructionalGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -79851,7 +92545,7 @@ public OpenStaffPositionInstructionalGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual OpenStaffPosition OpenStaffPosition { get; set; } Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionInstructionalGradeLevel.OpenStaffPosition @@ -79861,6 +92555,7 @@ Entities.Common.EdFi.IOpenStaffPosition IOpenStaffPositionInstructionalGradeLeve } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -79880,6 +92575,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -79917,14 +92613,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "OpenStaffPosition", "OpenStaffPositionInstructionalGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -79943,7 +92652,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "OpenStaffPosition", "OpenStaffPositionInstructionalGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -79971,7 +92720,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (OpenStaffPosition as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -80064,6 +92813,7 @@ namespace EdFi.Ods.Entities.NHibernate.OperationalStatusDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OperationalStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IOperationalStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -80072,6 +92822,7 @@ public class OperationalStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int OperationalStatusDescriptorId { get { return base.DescriptorId; } @@ -80238,24 +92989,29 @@ namespace EdFi.Ods.Entities.NHibernate.OperationalUnitDimensionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class OperationalUnitDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Code { get; set; } + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -80321,6 +93077,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OperationalUnitDimension : AggregateRootWithCompositeKey, Entities.Common.EdFi.IOperationalUnitDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -80329,8 +93086,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public OperationalUnitDimension() { OperationalUnitDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -80339,8 +93096,10 @@ public OperationalUnitDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Code { get; set; } [DomainSignature] + [Key(7)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -80352,6 +93111,7 @@ public OperationalUnitDimension() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual string CodeName { get; set; } // ------------------------------------------------------------- @@ -80365,14 +93125,27 @@ public OperationalUnitDimension() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "OperationalUnitDimension", "OperationalUnitDimension")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -80391,7 +93164,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "OperationalUnitDimension", "OperationalUnitDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -80405,6 +93218,8 @@ public IDictionary Extensions private ICollection _operationalUnitDimensionReportingTags; private ICollection _operationalUnitDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection OperationalUnitDimensionReportingTags { get @@ -80414,6 +93229,11 @@ public virtual ICollection set) + { + set.Reattach(this, "OperationalUnitDimensionReportingTags"); + } + foreach (var item in _operationalUnitDimensionReportingTags) if (item.OperationalUnitDimension == null) item.OperationalUnitDimension = this; @@ -80550,6 +93370,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OperationalUnitDimensionReportingTag : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IOperationalUnitDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -80557,8 +93378,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public OperationalUnitDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -80566,7 +93387,7 @@ public OperationalUnitDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual OperationalUnitDimension OperationalUnitDimension { get; set; } Entities.Common.EdFi.IOperationalUnitDimension IOperationalUnitDimensionReportingTag.OperationalUnitDimension @@ -80576,6 +93397,7 @@ Entities.Common.EdFi.IOperationalUnitDimension IOperationalUnitDimensionReportin } [DomainSignature] + [Key(1)] public virtual int ReportingTagDescriptorId { get @@ -80595,6 +93417,7 @@ public virtual int ReportingTagDescriptorId private int _reportingTagDescriptorId; private string _reportingTagDescriptor; + [IgnoreMember] public virtual string ReportingTagDescriptor { get @@ -80632,14 +93455,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "OperationalUnitDimension", "OperationalUnitDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -80658,7 +93494,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "OperationalUnitDimension", "OperationalUnitDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -80686,7 +93562,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (OperationalUnitDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (OperationalUnitDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -80779,13 +93655,14 @@ namespace EdFi.Ods.Entities.NHibernate.OrganizationDepartmentAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OrganizationDepartment : EducationOrganizationAggregate.EdFi.EducationOrganization, Entities.Common.EdFi.IOrganizationDepartment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public OrganizationDepartment() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -80794,6 +93671,7 @@ public OrganizationDepartment() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual long OrganizationDepartmentId { get { return base.EducationOrganizationId; } @@ -80830,6 +93708,7 @@ string IEducationOrganization.WebSite // ============================================================= // Properties // ------------------------------------------------------------- + [Key(17)] public virtual int? AcademicSubjectDescriptorId { get @@ -80849,6 +93728,7 @@ public virtual int? AcademicSubjectDescriptorId private int? _academicSubjectDescriptorId; private string _academicSubjectDescriptor; + [IgnoreMember] public virtual string AcademicSubjectDescriptor { get @@ -80864,6 +93744,7 @@ public virtual string AcademicSubjectDescriptor _academicSubjectDescriptorId = default(int?); } } + [Key(18)] public virtual long? ParentEducationOrganizationId { get; set; } // ------------------------------------------------------------- @@ -80877,14 +93758,27 @@ public virtual string AcademicSubjectDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "OrganizationDepartment", "OrganizationDepartment")] + [Key(19)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -80903,12 +93797,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "OrganizationDepartment", "OrganizationDepartment")] + [Key(20)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(21)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ParentEducationOrganizationReferenceData { get; set; } /// @@ -81041,6 +93976,7 @@ namespace EdFi.Ods.Entities.NHibernate.OtherNameTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class OtherNameTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IOtherNameTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -81049,6 +93985,7 @@ public class OtherNameTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int OtherNameTypeDescriptorId { get { return base.DescriptorId; } @@ -81220,6 +94157,7 @@ namespace EdFi.Ods.Entities.NHibernate.ParticipationDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ParticipationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IParticipationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -81228,6 +94166,7 @@ public class ParticipationDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ParticipationDescriptorId { get { return base.DescriptorId; } @@ -81399,6 +94338,7 @@ namespace EdFi.Ods.Entities.NHibernate.ParticipationStatusDescriptorAggregate.Ed /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ParticipationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IParticipationStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -81407,6 +94347,7 @@ public class ParticipationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ParticipationStatusDescriptorId { get { return base.DescriptorId; } @@ -81578,6 +94519,7 @@ namespace EdFi.Ods.Entities.NHibernate.PerformanceBaseConversionDescriptorAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PerformanceBaseConversionDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPerformanceBaseConversionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -81586,6 +94528,7 @@ public class PerformanceBaseConversionDescriptor : DescriptorAggregate.EdFi.Desc // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PerformanceBaseConversionDescriptorId { get { return base.DescriptorId; } @@ -81757,6 +94700,7 @@ namespace EdFi.Ods.Entities.NHibernate.PerformanceLevelDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PerformanceLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPerformanceLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -81765,6 +94709,7 @@ public class PerformanceLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PerformanceLevelDescriptorId { get { return base.DescriptorId; } @@ -81931,24 +94876,29 @@ namespace EdFi.Ods.Entities.NHibernate.PersonAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class PersonReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string PersonId { get; set; } + [Key(1)] public virtual int SourceSystemDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -82014,6 +94964,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Person : AggregateRootWithCompositeKey, Entities.Common.EdFi.IPerson, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -82021,8 +94972,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public Person() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -82031,8 +94982,10 @@ public Person() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string PersonId { get; set; } [DomainSignature] + [Key(7)] public virtual int SourceSystemDescriptorId { get @@ -82052,6 +95005,7 @@ public virtual int SourceSystemDescriptorId private int _sourceSystemDescriptorId; private string _sourceSystemDescriptor; + [IgnoreMember] public virtual string SourceSystemDescriptor { get @@ -82089,14 +95043,27 @@ public virtual string SourceSystemDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Person", "Person")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -82115,7 +95082,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Person", "Person")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -82233,6 +95240,7 @@ namespace EdFi.Ods.Entities.NHibernate.PersonalInformationVerificationDescriptor /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PersonalInformationVerificationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPersonalInformationVerificationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -82241,6 +95249,7 @@ public class PersonalInformationVerificationDescriptor : DescriptorAggregate.EdF // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PersonalInformationVerificationDescriptorId { get { return base.DescriptorId; } @@ -82412,6 +95421,7 @@ namespace EdFi.Ods.Entities.NHibernate.PlatformTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PlatformTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPlatformTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -82420,6 +95430,7 @@ public class PlatformTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PlatformTypeDescriptorId { get { return base.DescriptorId; } @@ -82591,6 +95602,7 @@ namespace EdFi.Ods.Entities.NHibernate.PopulationServedDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PopulationServedDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPopulationServedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -82599,6 +95611,7 @@ public class PopulationServedDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PopulationServedDescriptorId { get { return base.DescriptorId; } @@ -82770,6 +95783,7 @@ namespace EdFi.Ods.Entities.NHibernate.PostingResultDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PostingResultDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPostingResultDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -82778,6 +95792,7 @@ public class PostingResultDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PostingResultDescriptorId { get { return base.DescriptorId; } @@ -82944,25 +95959,31 @@ namespace EdFi.Ods.Entities.NHibernate.PostSecondaryEventAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class PostSecondaryEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime EventDate { get; set; } + [Key(1)] public virtual int PostSecondaryEventCategoryDescriptorId { get; set; } + [Key(2)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -83029,6 +96050,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PostSecondaryEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.IPostSecondaryEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -83036,8 +96058,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public PostSecondaryEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -83046,6 +96068,7 @@ public PostSecondaryEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime EventDate { get { return _eventDate; } @@ -83056,6 +96079,7 @@ public virtual DateTime EventDate private DateTime _eventDate; [DomainSignature] + [Key(7)] public virtual int PostSecondaryEventCategoryDescriptorId { get @@ -83075,6 +96099,7 @@ public virtual int PostSecondaryEventCategoryDescriptorId private int _postSecondaryEventCategoryDescriptorId; private string _postSecondaryEventCategoryDescriptor; + [IgnoreMember] public virtual string PostSecondaryEventCategoryDescriptor { get @@ -83091,6 +96116,7 @@ public virtual string PostSecondaryEventCategoryDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] public virtual int StudentUSI { get @@ -83116,6 +96142,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -83149,6 +96176,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual long? PostSecondaryInstitutionId { get; set; } // ------------------------------------------------------------- @@ -83162,14 +96190,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "PostSecondaryEvent", "PostSecondaryEvent")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -83188,12 +96229,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "PostSecondaryEvent", "PostSecondaryEvent")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData PostSecondaryInstitutionReferenceData { get; set; } /// @@ -83205,6 +96287,7 @@ public IDictionary Extensions set { } } + [Key(13)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -83338,6 +96421,7 @@ namespace EdFi.Ods.Entities.NHibernate.PostSecondaryEventCategoryDescriptorAggre /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PostSecondaryEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPostSecondaryEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -83346,6 +96430,7 @@ public class PostSecondaryEventCategoryDescriptor : DescriptorAggregate.EdFi.Des // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PostSecondaryEventCategoryDescriptorId { get { return base.DescriptorId; } @@ -83517,14 +96602,15 @@ namespace EdFi.Ods.Entities.NHibernate.PostSecondaryInstitutionAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PostSecondaryInstitution : EducationOrganizationAggregate.EdFi.EducationOrganization, Entities.Common.EdFi.IPostSecondaryInstitution, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public PostSecondaryInstitution() { PostSecondaryInstitutionMediumOfInstructions = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -83533,6 +96619,7 @@ public PostSecondaryInstitution() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual long PostSecondaryInstitutionId { get { return base.EducationOrganizationId; } @@ -83569,6 +96656,7 @@ string IEducationOrganization.WebSite // ============================================================= // Properties // ------------------------------------------------------------- + [Key(17)] public virtual int? AdministrativeFundingControlDescriptorId { get @@ -83588,6 +96676,7 @@ public virtual int? AdministrativeFundingControlDescriptorId private int? _administrativeFundingControlDescriptorId; private string _administrativeFundingControlDescriptor; + [IgnoreMember] public virtual string AdministrativeFundingControlDescriptor { get @@ -83603,6 +96692,7 @@ public virtual string AdministrativeFundingControlDescriptor _administrativeFundingControlDescriptorId = default(int?); } } + [Key(18)] public virtual int? PostSecondaryInstitutionLevelDescriptorId { get @@ -83622,6 +96712,7 @@ public virtual int? PostSecondaryInstitutionLevelDescriptorId private int? _postSecondaryInstitutionLevelDescriptorId; private string _postSecondaryInstitutionLevelDescriptor; + [IgnoreMember] public virtual string PostSecondaryInstitutionLevelDescriptor { get @@ -83649,14 +96740,27 @@ public virtual string PostSecondaryInstitutionLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "PostSecondaryInstitution", "PostSecondaryInstitution")] + [Key(19)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -83675,7 +96779,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "PostSecondaryInstitution", "PostSecondaryInstitution")] + [Key(20)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -83689,6 +96833,8 @@ public IDictionary Extensions private ICollection _postSecondaryInstitutionMediumOfInstructions; private ICollection _postSecondaryInstitutionMediumOfInstructionsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection PostSecondaryInstitutionMediumOfInstructions { get @@ -83698,6 +96844,11 @@ public virtual ICollection set) + { + set.Reattach(this, "PostSecondaryInstitutionMediumOfInstructions"); + } + foreach (var item in _postSecondaryInstitutionMediumOfInstructions) if (item.PostSecondaryInstitution == null) item.PostSecondaryInstitution = this; @@ -83836,6 +96987,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PostSecondaryInstitutionMediumOfInstruction : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IPostSecondaryInstitutionMediumOfInstruction, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -83843,8 +96995,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public PostSecondaryInstitutionMediumOfInstruction() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -83852,7 +97004,7 @@ public PostSecondaryInstitutionMediumOfInstruction() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual PostSecondaryInstitution PostSecondaryInstitution { get; set; } Entities.Common.EdFi.IPostSecondaryInstitution IPostSecondaryInstitutionMediumOfInstruction.PostSecondaryInstitution @@ -83862,6 +97014,7 @@ Entities.Common.EdFi.IPostSecondaryInstitution IPostSecondaryInstitutionMediumOf } [DomainSignature] + [Key(1)] public virtual int MediumOfInstructionDescriptorId { get @@ -83881,6 +97034,7 @@ public virtual int MediumOfInstructionDescriptorId private int _mediumOfInstructionDescriptorId; private string _mediumOfInstructionDescriptor; + [IgnoreMember] public virtual string MediumOfInstructionDescriptor { get @@ -83918,14 +97072,27 @@ public virtual string MediumOfInstructionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "PostSecondaryInstitution", "PostSecondaryInstitutionMediumOfInstruction")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -83944,7 +97111,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "PostSecondaryInstitution", "PostSecondaryInstitutionMediumOfInstruction")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -83972,7 +97179,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (PostSecondaryInstitution as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (PostSecondaryInstitution as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("MediumOfInstructionDescriptorId", MediumOfInstructionDescriptorId); @@ -84065,6 +97272,7 @@ namespace EdFi.Ods.Entities.NHibernate.PostSecondaryInstitutionLevelDescriptorAg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PostSecondaryInstitutionLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPostSecondaryInstitutionLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -84073,6 +97281,7 @@ public class PostSecondaryInstitutionLevelDescriptor : DescriptorAggregate.EdFi. // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PostSecondaryInstitutionLevelDescriptorId { get { return base.DescriptorId; } @@ -84244,6 +97453,7 @@ namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceAccessDescriptorAggr /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PrimaryLearningDeviceAccessDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPrimaryLearningDeviceAccessDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -84252,6 +97462,7 @@ public class PrimaryLearningDeviceAccessDescriptor : DescriptorAggregate.EdFi.De // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PrimaryLearningDeviceAccessDescriptorId { get { return base.DescriptorId; } @@ -84423,6 +97634,7 @@ namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceAwayFromSchoolDescri /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PrimaryLearningDeviceAwayFromSchoolDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPrimaryLearningDeviceAwayFromSchoolDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -84431,6 +97643,7 @@ public class PrimaryLearningDeviceAwayFromSchoolDescriptor : DescriptorAggregate // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PrimaryLearningDeviceAwayFromSchoolDescriptorId { get { return base.DescriptorId; } @@ -84602,6 +97815,7 @@ namespace EdFi.Ods.Entities.NHibernate.PrimaryLearningDeviceProviderDescriptorAg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PrimaryLearningDeviceProviderDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPrimaryLearningDeviceProviderDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -84610,6 +97824,7 @@ public class PrimaryLearningDeviceProviderDescriptor : DescriptorAggregate.EdFi. // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PrimaryLearningDeviceProviderDescriptorId { get { return base.DescriptorId; } @@ -84781,6 +97996,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProficiencyDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProficiencyDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProficiencyDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -84789,6 +98005,7 @@ public class ProficiencyDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProficiencyDescriptorId { get { return base.DescriptorId; } @@ -84955,25 +98172,31 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ProgramReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string ProgramName { get; set; } + [Key(2)] public virtual int ProgramTypeDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -85040,6 +98263,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Program : AggregateRootWithCompositeKey, Entities.Common.EdFi.IProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -85050,8 +98274,8 @@ public Program() ProgramCharacteristics = new HashSet(); ProgramLearningStandards = new HashSet(); ProgramSponsors = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -85060,10 +98284,13 @@ public Program() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(8)] public virtual int ProgramTypeDescriptorId { get @@ -85083,6 +98310,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -85108,6 +98336,7 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual string ProgramId { get; set; } // ------------------------------------------------------------- @@ -85121,14 +98350,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Program", "Program")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -85147,12 +98389,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Program", "Program")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -85181,6 +98464,8 @@ string Entities.Common.EdFi.IProgram.EducationOrganizationDiscriminator private ICollection _programCharacteristics; private ICollection _programCharacteristicsCovariant; + [Key(13)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProgramCharacteristics { get @@ -85190,6 +98475,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProgramCharacteristics"); + } + foreach (var item in _programCharacteristics) if (item.Program == null) item.Program = this; @@ -85228,6 +98518,8 @@ public virtual ICollection _programLearningStandards; private ICollection _programLearningStandardsCovariant; + [Key(14)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProgramLearningStandards { get @@ -85237,6 +98529,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProgramLearningStandards"); + } + foreach (var item in _programLearningStandards) if (item.Program == null) item.Program = this; @@ -85275,6 +98572,8 @@ public virtual ICollection _programSponsors; private ICollection _programSponsorsCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProgramSponsors { get @@ -85284,6 +98583,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProgramSponsors"); + } + foreach (var item in _programSponsors) if (item.Program == null) item.Program = this; @@ -85422,6 +98726,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramCharacteristic : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProgramCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -85429,8 +98734,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -85438,7 +98743,7 @@ public ProgramCharacteristic() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Program Program { get; set; } Entities.Common.EdFi.IProgram IProgramCharacteristic.Program @@ -85448,6 +98753,7 @@ Entities.Common.EdFi.IProgram IProgramCharacteristic.Program } [DomainSignature] + [Key(1)] public virtual int ProgramCharacteristicDescriptorId { get @@ -85467,6 +98773,7 @@ public virtual int ProgramCharacteristicDescriptorId private int _programCharacteristicDescriptorId; private string _programCharacteristicDescriptor; + [IgnoreMember] public virtual string ProgramCharacteristicDescriptor { get @@ -85504,14 +98811,27 @@ public virtual string ProgramCharacteristicDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Program", "ProgramCharacteristic")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -85530,7 +98850,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Program", "ProgramCharacteristic")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -85559,7 +98919,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Program as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ProgramCharacteristicDescriptorId", ProgramCharacteristicDescriptorId); @@ -85647,6 +99007,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramLearningStandard : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProgramLearningStandard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -85654,8 +99015,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramLearningStandard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -85663,7 +99024,7 @@ public ProgramLearningStandard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Program Program { get; set; } Entities.Common.EdFi.IProgram IProgramLearningStandard.Program @@ -85673,6 +99034,7 @@ Entities.Common.EdFi.IProgram IProgramLearningStandard.Program } [DomainSignature] + [Key(1)] public virtual string LearningStandardId { get; set; } // ------------------------------------------------------------- @@ -85696,14 +99058,27 @@ Entities.Common.EdFi.IProgram IProgramLearningStandard.Program // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Program", "ProgramLearningStandard")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -85722,12 +99097,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Program", "ProgramLearningStandard")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.LearningStandardAggregate.EdFi.LearningStandardReferenceData LearningStandardReferenceData { get; set; } /// @@ -85770,7 +99186,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Program as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LearningStandardId", LearningStandardId); @@ -85858,6 +99274,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramSponsor : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProgramSponsor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -85865,8 +99282,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramSponsor() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -85874,7 +99291,7 @@ public ProgramSponsor() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Program Program { get; set; } Entities.Common.EdFi.IProgram IProgramSponsor.Program @@ -85884,6 +99301,7 @@ Entities.Common.EdFi.IProgram IProgramSponsor.Program } [DomainSignature] + [Key(1)] public virtual int ProgramSponsorDescriptorId { get @@ -85903,6 +99321,7 @@ public virtual int ProgramSponsorDescriptorId private int _programSponsorDescriptorId; private string _programSponsorDescriptor; + [IgnoreMember] public virtual string ProgramSponsorDescriptor { get @@ -85940,14 +99359,27 @@ public virtual string ProgramSponsorDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Program", "ProgramSponsor")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -85966,7 +99398,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Program", "ProgramSponsor")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -85995,7 +99467,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Program as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Program as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ProgramSponsorDescriptorId", ProgramSponsorDescriptorId); @@ -86088,6 +99560,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramAssignmentDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramAssignmentDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgramAssignmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -86096,6 +99569,7 @@ public class ProgramAssignmentDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgramAssignmentDescriptorId { get { return base.DescriptorId; } @@ -86267,6 +99741,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramCharacteristicDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgramCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -86275,6 +99750,7 @@ public class ProgramCharacteristicDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgramCharacteristicDescriptorId { get { return base.DescriptorId; } @@ -86441,24 +99917,29 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramDimensionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ProgramDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Code { get; set; } + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -86524,6 +100005,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramDimension : AggregateRootWithCompositeKey, Entities.Common.EdFi.IProgramDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -86532,8 +100014,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramDimension() { ProgramDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -86542,8 +100024,10 @@ public ProgramDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Code { get; set; } [DomainSignature] + [Key(7)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -86555,6 +100039,7 @@ public ProgramDimension() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual string CodeName { get; set; } // ------------------------------------------------------------- @@ -86568,14 +100053,27 @@ public ProgramDimension() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramDimension", "ProgramDimension")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -86594,7 +100092,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramDimension", "ProgramDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -86608,6 +100146,8 @@ public IDictionary Extensions private ICollection _programDimensionReportingTags; private ICollection _programDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProgramDimensionReportingTags { get @@ -86617,6 +100157,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProgramDimensionReportingTags"); + } + foreach (var item in _programDimensionReportingTags) if (item.ProgramDimension == null) item.ProgramDimension = this; @@ -86753,6 +100298,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramDimensionReportingTag : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProgramDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -86760,8 +100306,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -86769,7 +100315,7 @@ public ProgramDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ProgramDimension ProgramDimension { get; set; } Entities.Common.EdFi.IProgramDimension IProgramDimensionReportingTag.ProgramDimension @@ -86779,6 +100325,7 @@ Entities.Common.EdFi.IProgramDimension IProgramDimensionReportingTag.ProgramDime } [DomainSignature] + [Key(1)] public virtual int ReportingTagDescriptorId { get @@ -86798,6 +100345,7 @@ public virtual int ReportingTagDescriptorId private int _reportingTagDescriptorId; private string _reportingTagDescriptor; + [IgnoreMember] public virtual string ReportingTagDescriptor { get @@ -86835,14 +100383,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramDimension", "ProgramDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -86861,7 +100422,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramDimension", "ProgramDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -86889,7 +100490,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProgramDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ProgramDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -86977,28 +100578,37 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ProgramEvaluationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(1)] public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + [Key(2)] public virtual string ProgramEvaluationTitle { get; set; } + [Key(3)] public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + [Key(4)] public virtual string ProgramName { get; set; } + [Key(5)] public virtual int ProgramTypeDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(6)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(7)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -87068,6 +100678,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IProgramEvaluation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -87076,8 +100687,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramEvaluation() { ProgramEvaluationLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -87086,8 +100697,10 @@ public ProgramEvaluation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual int ProgramEvaluationPeriodDescriptorId { get @@ -87107,6 +100720,7 @@ public virtual int ProgramEvaluationPeriodDescriptorId private int _programEvaluationPeriodDescriptorId; private string _programEvaluationPeriodDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationPeriodDescriptor { get @@ -87123,8 +100737,10 @@ public virtual string ProgramEvaluationPeriodDescriptor } } [DomainSignature] + [Key(8)] public virtual string ProgramEvaluationTitle { get; set; } [DomainSignature] + [Key(9)] public virtual int ProgramEvaluationTypeDescriptorId { get @@ -87144,6 +100760,7 @@ public virtual int ProgramEvaluationTypeDescriptorId private int _programEvaluationTypeDescriptorId; private string _programEvaluationTypeDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationTypeDescriptor { get @@ -87160,8 +100777,10 @@ public virtual string ProgramEvaluationTypeDescriptor } } [DomainSignature] + [Key(10)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(11)] public virtual int ProgramTypeDescriptorId { get @@ -87181,6 +100800,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -87206,8 +100826,11 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(12)] public virtual decimal? EvaluationMaxNumericRating { get; set; } + [Key(13)] public virtual decimal? EvaluationMinNumericRating { get; set; } + [Key(14)] public virtual string ProgramEvaluationDescription { get; set; } // ------------------------------------------------------------- @@ -87221,14 +100844,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramEvaluation", "ProgramEvaluation")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -87247,12 +100883,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramEvaluation", "ProgramEvaluation")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -87281,6 +100958,8 @@ string Entities.Common.EdFi.IProgramEvaluation.ProgramDiscriminator private ICollection _programEvaluationLevels; private ICollection _programEvaluationLevelsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProgramEvaluationLevels { get @@ -87290,6 +100969,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProgramEvaluationLevels"); + } + foreach (var item in _programEvaluationLevels) if (item.ProgramEvaluation == null) item.ProgramEvaluation = this; @@ -87433,6 +101117,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -87440,8 +101125,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramEvaluationLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -87449,7 +101134,7 @@ public ProgramEvaluationLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ProgramEvaluation ProgramEvaluation { get; set; } Entities.Common.EdFi.IProgramEvaluation IProgramEvaluationLevel.ProgramEvaluation @@ -87459,6 +101144,7 @@ Entities.Common.EdFi.IProgramEvaluation IProgramEvaluationLevel.ProgramEvaluatio } [DomainSignature] + [Key(1)] public virtual int RatingLevelDescriptorId { get @@ -87478,6 +101164,7 @@ public virtual int RatingLevelDescriptorId private int _ratingLevelDescriptorId; private string _ratingLevelDescriptor; + [IgnoreMember] public virtual string RatingLevelDescriptor { get @@ -87503,7 +101190,9 @@ public virtual string RatingLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? MaxNumericRating { get; set; } + [Key(3)] public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- @@ -87517,14 +101206,27 @@ public virtual string RatingLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramEvaluation", "ProgramEvaluationLevel")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -87543,7 +101245,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramEvaluation", "ProgramEvaluationLevel")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -87574,7 +101316,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProgramEvaluation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ProgramEvaluation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); @@ -87662,29 +101404,39 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationElementAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ProgramEvaluationElementReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(1)] public virtual string ProgramEvaluationElementTitle { get; set; } + [Key(2)] public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + [Key(3)] public virtual string ProgramEvaluationTitle { get; set; } + [Key(4)] public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + [Key(5)] public virtual string ProgramName { get; set; } + [Key(6)] public virtual int ProgramTypeDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -87755,6 +101507,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluationElement : AggregateRootWithCompositeKey, Entities.Common.EdFi.IProgramEvaluationElement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -87763,8 +101516,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramEvaluationElement() { ProgramEvaluationElementProgramEvaluationLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -87773,10 +101526,13 @@ public ProgramEvaluationElement() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string ProgramEvaluationElementTitle { get; set; } [DomainSignature] + [Key(8)] public virtual int ProgramEvaluationPeriodDescriptorId { get @@ -87796,6 +101552,7 @@ public virtual int ProgramEvaluationPeriodDescriptorId private int _programEvaluationPeriodDescriptorId; private string _programEvaluationPeriodDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationPeriodDescriptor { get @@ -87812,8 +101569,10 @@ public virtual string ProgramEvaluationPeriodDescriptor } } [DomainSignature] + [Key(9)] public virtual string ProgramEvaluationTitle { get; set; } [DomainSignature] + [Key(10)] public virtual int ProgramEvaluationTypeDescriptorId { get @@ -87833,6 +101592,7 @@ public virtual int ProgramEvaluationTypeDescriptorId private int _programEvaluationTypeDescriptorId; private string _programEvaluationTypeDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationTypeDescriptor { get @@ -87849,8 +101609,10 @@ public virtual string ProgramEvaluationTypeDescriptor } } [DomainSignature] + [Key(11)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(12)] public virtual int ProgramTypeDescriptorId { get @@ -87870,6 +101632,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -87895,10 +101658,15 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(13)] public virtual decimal? ElementMaxNumericRating { get; set; } + [Key(14)] public virtual decimal? ElementMinNumericRating { get; set; } + [Key(15)] public virtual int? ElementSortOrder { get; set; } + [Key(16)] public virtual string ProgramEvaluationElementDescription { get; set; } + [Key(17)] public virtual string ProgramEvaluationObjectiveTitle { get; set; } // ------------------------------------------------------------- @@ -87912,14 +101680,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramEvaluationElement", "ProgramEvaluationElement")] + [Key(18)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -87938,12 +101719,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramEvaluationElement", "ProgramEvaluationElement")] + [Key(19)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(20)] public virtual NHibernate.ProgramEvaluationAggregate.EdFi.ProgramEvaluationReferenceData ProgramEvaluationReferenceData { get; set; } /// @@ -87964,6 +101786,7 @@ string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationDiscrimin set { } } + [Key(21)] public virtual NHibernate.ProgramEvaluationObjectiveAggregate.EdFi.ProgramEvaluationObjectiveReferenceData ProgramEvaluationObjectiveReferenceData { get; set; } /// @@ -87992,6 +101815,8 @@ string Entities.Common.EdFi.IProgramEvaluationElement.ProgramEvaluationObjective private ICollection _programEvaluationElementProgramEvaluationLevels; private ICollection _programEvaluationElementProgramEvaluationLevelsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProgramEvaluationElementProgramEvaluationLevels { get @@ -88001,6 +101826,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProgramEvaluationElementProgramEvaluationLevels"); + } + foreach (var item in _programEvaluationElementProgramEvaluationLevels) if (item.ProgramEvaluationElement == null) item.ProgramEvaluationElement = this; @@ -88145,6 +101975,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluationElementProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProgramEvaluationElementProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -88152,8 +101983,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramEvaluationElementProgramEvaluationLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -88161,7 +101992,7 @@ public ProgramEvaluationElementProgramEvaluationLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ProgramEvaluationElement ProgramEvaluationElement { get; set; } Entities.Common.EdFi.IProgramEvaluationElement IProgramEvaluationElementProgramEvaluationLevel.ProgramEvaluationElement @@ -88171,6 +102002,7 @@ Entities.Common.EdFi.IProgramEvaluationElement IProgramEvaluationElementProgramE } [DomainSignature] + [Key(1)] public virtual int RatingLevelDescriptorId { get @@ -88190,6 +102022,7 @@ public virtual int RatingLevelDescriptorId private int _ratingLevelDescriptorId; private string _ratingLevelDescriptor; + [IgnoreMember] public virtual string RatingLevelDescriptor { get @@ -88215,7 +102048,9 @@ public virtual string RatingLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? MaxNumericRating { get; set; } + [Key(3)] public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- @@ -88229,14 +102064,27 @@ public virtual string RatingLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramEvaluationElement", "ProgramEvaluationElementProgramEvaluationLevel")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -88255,7 +102103,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramEvaluationElement", "ProgramEvaluationElementProgramEvaluationLevel")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -88286,7 +102174,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProgramEvaluationElement as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ProgramEvaluationElement as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); @@ -88374,29 +102262,39 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationObjectiveAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ProgramEvaluationObjectiveReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(1)] public virtual string ProgramEvaluationObjectiveTitle { get; set; } + [Key(2)] public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + [Key(3)] public virtual string ProgramEvaluationTitle { get; set; } + [Key(4)] public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + [Key(5)] public virtual string ProgramName { get; set; } + [Key(6)] public virtual int ProgramTypeDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -88467,6 +102365,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluationObjective : AggregateRootWithCompositeKey, Entities.Common.EdFi.IProgramEvaluationObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -88475,8 +102374,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramEvaluationObjective() { ProgramEvaluationObjectiveProgramEvaluationLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -88485,10 +102384,13 @@ public ProgramEvaluationObjective() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string ProgramEvaluationObjectiveTitle { get; set; } [DomainSignature] + [Key(8)] public virtual int ProgramEvaluationPeriodDescriptorId { get @@ -88508,6 +102410,7 @@ public virtual int ProgramEvaluationPeriodDescriptorId private int _programEvaluationPeriodDescriptorId; private string _programEvaluationPeriodDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationPeriodDescriptor { get @@ -88524,8 +102427,10 @@ public virtual string ProgramEvaluationPeriodDescriptor } } [DomainSignature] + [Key(9)] public virtual string ProgramEvaluationTitle { get; set; } [DomainSignature] + [Key(10)] public virtual int ProgramEvaluationTypeDescriptorId { get @@ -88545,6 +102450,7 @@ public virtual int ProgramEvaluationTypeDescriptorId private int _programEvaluationTypeDescriptorId; private string _programEvaluationTypeDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationTypeDescriptor { get @@ -88561,8 +102467,10 @@ public virtual string ProgramEvaluationTypeDescriptor } } [DomainSignature] + [Key(11)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(12)] public virtual int ProgramTypeDescriptorId { get @@ -88582,6 +102490,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -88607,9 +102516,13 @@ public virtual string ProgramTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(13)] public virtual decimal? ObjectiveMaxNumericRating { get; set; } + [Key(14)] public virtual decimal? ObjectiveMinNumericRating { get; set; } + [Key(15)] public virtual int? ObjectiveSortOrder { get; set; } + [Key(16)] public virtual string ProgramEvaluationObjectiveDescription { get; set; } // ------------------------------------------------------------- @@ -88623,14 +102536,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramEvaluationObjective", "ProgramEvaluationObjective")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -88649,12 +102575,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramEvaluationObjective", "ProgramEvaluationObjective")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(19)] public virtual NHibernate.ProgramEvaluationAggregate.EdFi.ProgramEvaluationReferenceData ProgramEvaluationReferenceData { get; set; } /// @@ -88683,6 +102650,8 @@ string Entities.Common.EdFi.IProgramEvaluationObjective.ProgramEvaluationDiscrim private ICollection _programEvaluationObjectiveProgramEvaluationLevels; private ICollection _programEvaluationObjectiveProgramEvaluationLevelsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProgramEvaluationObjectiveProgramEvaluationLevels { get @@ -88692,6 +102661,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProgramEvaluationObjectiveProgramEvaluationLevels"); + } + foreach (var item in _programEvaluationObjectiveProgramEvaluationLevels) if (item.ProgramEvaluationObjective == null) item.ProgramEvaluationObjective = this; @@ -88836,6 +102810,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluationObjectiveProgramEvaluationLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProgramEvaluationObjectiveProgramEvaluationLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -88843,8 +102818,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProgramEvaluationObjectiveProgramEvaluationLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -88852,7 +102827,7 @@ public ProgramEvaluationObjectiveProgramEvaluationLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ProgramEvaluationObjective ProgramEvaluationObjective { get; set; } Entities.Common.EdFi.IProgramEvaluationObjective IProgramEvaluationObjectiveProgramEvaluationLevel.ProgramEvaluationObjective @@ -88862,6 +102837,7 @@ Entities.Common.EdFi.IProgramEvaluationObjective IProgramEvaluationObjectiveProg } [DomainSignature] + [Key(1)] public virtual int RatingLevelDescriptorId { get @@ -88881,6 +102857,7 @@ public virtual int RatingLevelDescriptorId private int _ratingLevelDescriptorId; private string _ratingLevelDescriptor; + [IgnoreMember] public virtual string RatingLevelDescriptor { get @@ -88906,7 +102883,9 @@ public virtual string RatingLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? MaxNumericRating { get; set; } + [Key(3)] public virtual decimal? MinNumericRating { get; set; } // ------------------------------------------------------------- @@ -88920,14 +102899,27 @@ public virtual string RatingLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProgramEvaluationObjective", "ProgramEvaluationObjectiveProgramEvaluationLevel")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -88946,7 +102938,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProgramEvaluationObjective", "ProgramEvaluationObjectiveProgramEvaluationLevel")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -88977,7 +103009,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProgramEvaluationObjective as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ProgramEvaluationObjective as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RatingLevelDescriptorId", RatingLevelDescriptorId); @@ -89070,6 +103102,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationPeriodDescriptorAggregat /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluationPeriodDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgramEvaluationPeriodDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -89078,6 +103111,7 @@ public class ProgramEvaluationPeriodDescriptor : DescriptorAggregate.EdFi.Descri // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgramEvaluationPeriodDescriptorId { get { return base.DescriptorId; } @@ -89249,6 +103283,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramEvaluationTypeDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgramEvaluationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -89257,6 +103292,7 @@ public class ProgramEvaluationTypeDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgramEvaluationTypeDescriptorId { get { return base.DescriptorId; } @@ -89428,6 +103464,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramSponsorDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramSponsorDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgramSponsorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -89436,6 +103473,7 @@ public class ProgramSponsorDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgramSponsorDescriptorId { get { return base.DescriptorId; } @@ -89607,6 +103645,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgramTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgramTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgramTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -89615,6 +103654,7 @@ public class ProgramTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgramTypeDescriptorId { get { return base.DescriptorId; } @@ -89786,6 +103826,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgressDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgressDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgressDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -89794,6 +103835,7 @@ public class ProgressDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgressDescriptorId { get { return base.DescriptorId; } @@ -89965,6 +104007,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProgressLevelDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProgressLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProgressLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -89973,6 +104016,7 @@ public class ProgressLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProgressLevelDescriptorId { get { return base.DescriptorId; } @@ -90139,24 +104183,29 @@ namespace EdFi.Ods.Entities.NHibernate.ProjectDimensionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ProjectDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Code { get; set; } + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -90222,6 +104271,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProjectDimension : AggregateRootWithCompositeKey, Entities.Common.EdFi.IProjectDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -90230,8 +104280,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProjectDimension() { ProjectDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -90240,8 +104290,10 @@ public ProjectDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Code { get; set; } [DomainSignature] + [Key(7)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -90253,6 +104305,7 @@ public ProjectDimension() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual string CodeName { get; set; } // ------------------------------------------------------------- @@ -90266,14 +104319,27 @@ public ProjectDimension() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProjectDimension", "ProjectDimension")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -90292,7 +104358,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProjectDimension", "ProjectDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -90306,6 +104412,8 @@ public IDictionary Extensions private ICollection _projectDimensionReportingTags; private ICollection _projectDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ProjectDimensionReportingTags { get @@ -90315,6 +104423,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ProjectDimensionReportingTags"); + } + foreach (var item in _projectDimensionReportingTags) if (item.ProjectDimension == null) item.ProjectDimension = this; @@ -90451,6 +104564,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProjectDimensionReportingTag : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IProjectDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -90458,8 +104572,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ProjectDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -90467,7 +104581,7 @@ public ProjectDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ProjectDimension ProjectDimension { get; set; } Entities.Common.EdFi.IProjectDimension IProjectDimensionReportingTag.ProjectDimension @@ -90477,6 +104591,7 @@ Entities.Common.EdFi.IProjectDimension IProjectDimensionReportingTag.ProjectDime } [DomainSignature] + [Key(1)] public virtual int ReportingTagDescriptorId { get @@ -90496,6 +104611,7 @@ public virtual int ReportingTagDescriptorId private int _reportingTagDescriptorId; private string _reportingTagDescriptor; + [IgnoreMember] public virtual string ReportingTagDescriptor { get @@ -90533,14 +104649,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ProjectDimension", "ProjectDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -90559,7 +104688,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ProjectDimension", "ProjectDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -90587,7 +104756,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ProjectDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ProjectDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -90680,6 +104849,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProviderCategoryDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProviderCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProviderCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -90688,6 +104858,7 @@ public class ProviderCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProviderCategoryDescriptorId { get { return base.DescriptorId; } @@ -90859,6 +105030,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProviderProfitabilityDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProviderProfitabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProviderProfitabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -90867,6 +105039,7 @@ public class ProviderProfitabilityDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProviderProfitabilityDescriptorId { get { return base.DescriptorId; } @@ -91038,6 +105211,7 @@ namespace EdFi.Ods.Entities.NHibernate.ProviderStatusDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ProviderStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IProviderStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -91046,6 +105220,7 @@ public class ProviderStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ProviderStatusDescriptorId { get { return base.DescriptorId; } @@ -91217,6 +105392,7 @@ namespace EdFi.Ods.Entities.NHibernate.PublicationStatusDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class PublicationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IPublicationStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -91225,6 +105401,7 @@ public class PublicationStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int PublicationStatusDescriptorId { get { return base.DescriptorId; } @@ -91396,6 +105573,7 @@ namespace EdFi.Ods.Entities.NHibernate.QuestionFormDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class QuestionFormDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IQuestionFormDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -91404,6 +105582,7 @@ public class QuestionFormDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int QuestionFormDescriptorId { get { return base.DescriptorId; } @@ -91575,6 +105754,7 @@ namespace EdFi.Ods.Entities.NHibernate.RaceDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RaceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IRaceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -91583,6 +105763,7 @@ public class RaceDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int RaceDescriptorId { get { return base.DescriptorId; } @@ -91754,6 +105935,7 @@ namespace EdFi.Ods.Entities.NHibernate.RatingLevelDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RatingLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IRatingLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -91762,6 +105944,7 @@ public class RatingLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int RatingLevelDescriptorId { get { return base.DescriptorId; } @@ -91933,6 +106116,7 @@ namespace EdFi.Ods.Entities.NHibernate.ReasonExitedDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReasonExitedDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IReasonExitedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -91941,6 +106125,7 @@ public class ReasonExitedDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ReasonExitedDescriptorId { get { return base.DescriptorId; } @@ -92112,6 +106297,7 @@ namespace EdFi.Ods.Entities.NHibernate.ReasonNotTestedDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReasonNotTestedDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IReasonNotTestedDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -92120,6 +106306,7 @@ public class ReasonNotTestedDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ReasonNotTestedDescriptorId { get { return base.DescriptorId; } @@ -92291,6 +106478,7 @@ namespace EdFi.Ods.Entities.NHibernate.RecognitionTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RecognitionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IRecognitionTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -92299,6 +106487,7 @@ public class RecognitionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int RecognitionTypeDescriptorId { get { return base.DescriptorId; } @@ -92470,6 +106659,7 @@ namespace EdFi.Ods.Entities.NHibernate.RelationDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RelationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IRelationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -92478,6 +106668,7 @@ public class RelationDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int RelationDescriptorId { get { return base.DescriptorId; } @@ -92649,6 +106840,7 @@ namespace EdFi.Ods.Entities.NHibernate.RepeatIdentifierDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RepeatIdentifierDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IRepeatIdentifierDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -92657,6 +106849,7 @@ public class RepeatIdentifierDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int RepeatIdentifierDescriptorId { get { return base.DescriptorId; } @@ -92823,28 +107016,37 @@ namespace EdFi.Ods.Entities.NHibernate.ReportCardAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class ReportCardReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual int GradingPeriodDescriptorId { get; set; } + [Key(2)] public virtual string GradingPeriodName { get; set; } + [Key(3)] public virtual long GradingPeriodSchoolId { get; set; } + [Key(4)] public virtual short GradingPeriodSchoolYear { get; set; } + [Key(5)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(6)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(7)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -92914,6 +107116,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReportCard : AggregateRootWithCompositeKey, Entities.Common.EdFi.IReportCard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -92924,8 +107127,8 @@ public ReportCard() ReportCardGrades = new HashSet(); ReportCardGradePointAverages = new HashSet(); ReportCardStudentCompetencyObjectives = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -92934,8 +107137,10 @@ public ReportCard() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual int GradingPeriodDescriptorId { get @@ -92955,6 +107160,7 @@ public virtual int GradingPeriodDescriptorId private int _gradingPeriodDescriptorId; private string _gradingPeriodDescriptor; + [IgnoreMember] public virtual string GradingPeriodDescriptor { get @@ -92971,12 +107177,16 @@ public virtual string GradingPeriodDescriptor } } [DomainSignature] + [Key(8)] public virtual string GradingPeriodName { get; set; } [DomainSignature] + [Key(9)] public virtual long GradingPeriodSchoolId { get; set; } [DomainSignature] + [Key(10)] public virtual short GradingPeriodSchoolYear { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(11)] public virtual int StudentUSI { get @@ -93002,6 +107212,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -93035,8 +107246,11 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(12)] public virtual decimal? NumberOfDaysAbsent { get; set; } + [Key(13)] public virtual decimal? NumberOfDaysInAttendance { get; set; } + [Key(14)] public virtual int? NumberOfDaysTardy { get; set; } // ------------------------------------------------------------- @@ -93050,14 +107264,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ReportCard", "ReportCard")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -93076,12 +107303,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ReportCard", "ReportCard")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -93102,6 +107370,7 @@ string Entities.Common.EdFi.IReportCard.EducationOrganizationDiscriminator set { } } + [Key(18)] public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// @@ -93122,6 +107391,7 @@ string Entities.Common.EdFi.IReportCard.GradingPeriodDiscriminator set { } } + [Key(19)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -93150,6 +107420,8 @@ string Entities.Common.EdFi.IReportCard.StudentDiscriminator private ICollection _reportCardGrades; private ICollection _reportCardGradesCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ReportCardGrades { get @@ -93159,6 +107431,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ReportCardGrades"); + } + foreach (var item in _reportCardGrades) if (item.ReportCard == null) item.ReportCard = this; @@ -93197,6 +107474,8 @@ public virtual ICollection _reportCardGradePointAverages; private ICollection _reportCardGradePointAveragesCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ReportCardGradePointAverages { get @@ -93206,6 +107485,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ReportCardGradePointAverages"); + } + foreach (var item in _reportCardGradePointAverages) if (item.ReportCard == null) item.ReportCard = this; @@ -93244,6 +107528,8 @@ public virtual ICollection _reportCardStudentCompetencyObjectives; private ICollection _reportCardStudentCompetencyObjectivesCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection ReportCardStudentCompetencyObjectives { get @@ -93253,6 +107539,11 @@ public virtual ICollection set) + { + set.Reattach(this, "ReportCardStudentCompetencyObjectives"); + } + foreach (var item in _reportCardStudentCompetencyObjectives) if (item.ReportCard == null) item.ReportCard = this; @@ -93394,6 +107685,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReportCardGrade : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IReportCardGrade, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -93401,8 +107693,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ReportCardGrade() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -93410,7 +107702,7 @@ public ReportCardGrade() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ReportCard ReportCard { get; set; } Entities.Common.EdFi.IReportCard IReportCardGrade.ReportCard @@ -93420,6 +107712,7 @@ Entities.Common.EdFi.IReportCard IReportCardGrade.ReportCard } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -93430,6 +107723,7 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(2)] public virtual int GradeTypeDescriptorId { get @@ -93449,6 +107743,7 @@ public virtual int GradeTypeDescriptorId private int _gradeTypeDescriptorId; private string _gradeTypeDescriptor; + [IgnoreMember] public virtual string GradeTypeDescriptor { get @@ -93465,14 +107760,19 @@ public virtual string GradeTypeDescriptor } } [DomainSignature] + [Key(3)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(4)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(5)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(6)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- @@ -93496,14 +107796,27 @@ public virtual string GradeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ReportCard", "ReportCardGrade")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -93522,12 +107835,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ReportCard", "ReportCardGrade")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(10)] public virtual NHibernate.GradeAggregate.EdFi.GradeReferenceData GradeReferenceData { get; set; } /// @@ -93571,7 +107925,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ReportCard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -93665,6 +108019,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReportCardGradePointAverage : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IReportCardGradePointAverage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -93672,8 +108027,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ReportCardGradePointAverage() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -93681,7 +108036,7 @@ public ReportCardGradePointAverage() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ReportCard ReportCard { get; set; } Entities.Common.EdFi.IReportCard IReportCardGradePointAverage.ReportCard @@ -93691,6 +108046,7 @@ Entities.Common.EdFi.IReportCard IReportCardGradePointAverage.ReportCard } [DomainSignature] + [Key(1)] public virtual int GradePointAverageTypeDescriptorId { get @@ -93710,6 +108066,7 @@ public virtual int GradePointAverageTypeDescriptorId private int _gradePointAverageTypeDescriptorId; private string _gradePointAverageTypeDescriptor; + [IgnoreMember] public virtual string GradePointAverageTypeDescriptor { get @@ -93735,8 +108092,11 @@ public virtual string GradePointAverageTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal GradePointAverageValue { get; set; } + [Key(3)] public virtual bool? IsCumulative { get; set; } + [Key(4)] public virtual decimal? MaxGradePointAverageValue { get; set; } // ------------------------------------------------------------- @@ -93750,14 +108110,27 @@ public virtual string GradePointAverageTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ReportCard", "ReportCardGradePointAverage")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -93776,7 +108149,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ReportCard", "ReportCardGradePointAverage")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -93805,7 +108218,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ReportCard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); @@ -93893,6 +108306,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReportCardStudentCompetencyObjective : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IReportCardStudentCompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -93900,8 +108314,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public ReportCardStudentCompetencyObjective() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -93909,7 +108323,7 @@ public ReportCardStudentCompetencyObjective() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual ReportCard ReportCard { get; set; } Entities.Common.EdFi.IReportCard IReportCardStudentCompetencyObjective.ReportCard @@ -93919,10 +108333,13 @@ Entities.Common.EdFi.IReportCard IReportCardStudentCompetencyObjective.ReportCar } [DomainSignature] + [Key(1)] public virtual long ObjectiveEducationOrganizationId { get; set; } [DomainSignature] + [Key(2)] public virtual string Objective { get; set; } [DomainSignature] + [Key(3)] public virtual int ObjectiveGradeLevelDescriptorId { get @@ -93942,6 +108359,7 @@ public virtual int ObjectiveGradeLevelDescriptorId private int _objectiveGradeLevelDescriptorId; private string _objectiveGradeLevelDescriptor; + [IgnoreMember] public virtual string ObjectiveGradeLevelDescriptor { get @@ -93979,14 +108397,27 @@ public virtual string ObjectiveGradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "ReportCard", "ReportCardStudentCompetencyObjective")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -94005,12 +108436,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "ReportCard", "ReportCardStudentCompetencyObjective")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.StudentCompetencyObjectiveAggregate.EdFi.StudentCompetencyObjectiveReferenceData StudentCompetencyObjectiveReferenceData { get; set; } /// @@ -94054,7 +108526,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (ReportCard as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (ReportCard as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("Objective", Objective); @@ -94149,6 +108621,7 @@ namespace EdFi.Ods.Entities.NHibernate.ReporterDescriptionDescriptorAggregate.Ed /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReporterDescriptionDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IReporterDescriptionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -94157,6 +108630,7 @@ public class ReporterDescriptionDescriptor : DescriptorAggregate.EdFi.Descriptor // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ReporterDescriptionDescriptorId { get { return base.DescriptorId; } @@ -94328,6 +108802,7 @@ namespace EdFi.Ods.Entities.NHibernate.ReportingTagDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ReportingTagDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IReportingTagDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -94336,6 +108811,7 @@ public class ReportingTagDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ReportingTagDescriptorId { get { return base.DescriptorId; } @@ -94507,6 +108983,7 @@ namespace EdFi.Ods.Entities.NHibernate.ResidencyStatusDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ResidencyStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IResidencyStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -94515,6 +108992,7 @@ public class ResidencyStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ResidencyStatusDescriptorId { get { return base.DescriptorId; } @@ -94686,6 +109164,7 @@ namespace EdFi.Ods.Entities.NHibernate.ResponseIndicatorDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ResponseIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IResponseIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -94694,6 +109173,7 @@ public class ResponseIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ResponseIndicatorDescriptorId { get { return base.DescriptorId; } @@ -94865,6 +109345,7 @@ namespace EdFi.Ods.Entities.NHibernate.ResponsibilityDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ResponsibilityDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IResponsibilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -94873,6 +109354,7 @@ public class ResponsibilityDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ResponsibilityDescriptorId { get { return base.DescriptorId; } @@ -95039,25 +109521,31 @@ namespace EdFi.Ods.Entities.NHibernate.RestraintEventAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class RestraintEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string RestraintEventIdentifier { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } + [Key(2)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -95124,6 +109612,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RestraintEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.IRestraintEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -95133,8 +109622,8 @@ public RestraintEvent() { RestraintEventPrograms = new HashSet(); RestraintEventReasons = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -95143,10 +109632,13 @@ public RestraintEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string RestraintEventIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] public virtual int StudentUSI { get @@ -95172,6 +109664,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -95205,6 +109698,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual int? EducationalEnvironmentDescriptorId { get @@ -95224,6 +109718,7 @@ public virtual int? EducationalEnvironmentDescriptorId private int? _educationalEnvironmentDescriptorId; private string _educationalEnvironmentDescriptor; + [IgnoreMember] public virtual string EducationalEnvironmentDescriptor { get @@ -95239,6 +109734,7 @@ public virtual string EducationalEnvironmentDescriptor _educationalEnvironmentDescriptorId = default(int?); } } + [Key(10)] public virtual DateTime EventDate { get { return _eventDate; } @@ -95248,6 +109744,7 @@ public virtual DateTime EventDate private DateTime _eventDate; + [Key(11)] public virtual string IncidentIdentifier { get; set; } // ------------------------------------------------------------- @@ -95261,14 +109758,27 @@ public virtual DateTime EventDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "RestraintEvent", "RestraintEvent")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -95287,12 +109797,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "RestraintEvent", "RestraintEvent")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } /// @@ -95313,6 +109864,7 @@ string Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentDiscriminator set { } } + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// @@ -95324,6 +109876,7 @@ string Entities.Common.EdFi.IRestraintEvent.DisciplineIncidentDiscriminator set { } } + [Key(16)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -95352,6 +109905,8 @@ string Entities.Common.EdFi.IRestraintEvent.StudentDiscriminator private ICollection _restraintEventPrograms; private ICollection _restraintEventProgramsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection RestraintEventPrograms { get @@ -95361,6 +109916,11 @@ public virtual ICollection set) + { + set.Reattach(this, "RestraintEventPrograms"); + } + foreach (var item in _restraintEventPrograms) if (item.RestraintEvent == null) item.RestraintEvent = this; @@ -95399,6 +109959,8 @@ public virtual ICollection _restraintEventReasons; private ICollection _restraintEventReasonsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection RestraintEventReasons { get @@ -95408,6 +109970,11 @@ public virtual ICollection set) + { + set.Reattach(this, "RestraintEventReasons"); + } + foreach (var item in _restraintEventReasons) if (item.RestraintEvent == null) item.RestraintEvent = this; @@ -95546,6 +110113,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RestraintEventProgram : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IRestraintEventProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -95553,8 +110121,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public RestraintEventProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -95562,7 +110130,7 @@ public RestraintEventProgram() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual RestraintEvent RestraintEvent { get; set; } Entities.Common.EdFi.IRestraintEvent IRestraintEventProgram.RestraintEvent @@ -95572,10 +110140,13 @@ Entities.Common.EdFi.IRestraintEvent IRestraintEventProgram.RestraintEvent } [DomainSignature] + [Key(1)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(2)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(3)] public virtual int ProgramTypeDescriptorId { get @@ -95595,6 +110166,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -95632,14 +110204,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "RestraintEvent", "RestraintEventProgram")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -95658,12 +110243,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "RestraintEvent", "RestraintEventProgram")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -95706,7 +110332,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (RestraintEvent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (RestraintEvent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("EducationOrganizationId", EducationOrganizationId); @@ -95796,6 +110422,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RestraintEventReason : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IRestraintEventReason, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -95803,8 +110430,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public RestraintEventReason() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -95812,7 +110439,7 @@ public RestraintEventReason() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual RestraintEvent RestraintEvent { get; set; } Entities.Common.EdFi.IRestraintEvent IRestraintEventReason.RestraintEvent @@ -95822,6 +110449,7 @@ Entities.Common.EdFi.IRestraintEvent IRestraintEventReason.RestraintEvent } [DomainSignature] + [Key(1)] public virtual int RestraintEventReasonDescriptorId { get @@ -95841,6 +110469,7 @@ public virtual int RestraintEventReasonDescriptorId private int _restraintEventReasonDescriptorId; private string _restraintEventReasonDescriptor; + [IgnoreMember] public virtual string RestraintEventReasonDescriptor { get @@ -95878,14 +110507,27 @@ public virtual string RestraintEventReasonDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "RestraintEvent", "RestraintEventReason")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -95904,7 +110546,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "RestraintEvent", "RestraintEventReason")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -95932,7 +110614,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (RestraintEvent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (RestraintEvent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RestraintEventReasonDescriptorId", RestraintEventReasonDescriptorId); @@ -96025,6 +110707,7 @@ namespace EdFi.Ods.Entities.NHibernate.RestraintEventReasonDescriptorAggregate.E /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RestraintEventReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IRestraintEventReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -96033,6 +110716,7 @@ public class RestraintEventReasonDescriptor : DescriptorAggregate.EdFi.Descripto // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int RestraintEventReasonDescriptorId { get { return base.DescriptorId; } @@ -96204,6 +110888,7 @@ namespace EdFi.Ods.Entities.NHibernate.ResultDatatypeTypeDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ResultDatatypeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IResultDatatypeTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -96212,6 +110897,7 @@ public class ResultDatatypeTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ResultDatatypeTypeDescriptorId { get { return base.DescriptorId; } @@ -96383,6 +111069,7 @@ namespace EdFi.Ods.Entities.NHibernate.RetestIndicatorDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class RetestIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IRetestIndicatorDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -96391,6 +111078,7 @@ public class RetestIndicatorDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int RetestIndicatorDescriptorId { get { return base.DescriptorId; } @@ -96562,6 +111250,7 @@ namespace EdFi.Ods.Entities.NHibernate.SchoolAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class School : EducationOrganizationAggregate.EdFi.EducationOrganization, Entities.Common.EdFi.ISchool, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -96569,8 +111258,8 @@ public School() { SchoolCategories = new HashSet(); SchoolGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -96579,6 +111268,7 @@ public School() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual long SchoolId { get { return base.EducationOrganizationId; } @@ -96615,6 +111305,7 @@ string IEducationOrganization.WebSite // ============================================================= // Properties // ------------------------------------------------------------- + [Key(17)] public virtual int? AdministrativeFundingControlDescriptorId { get @@ -96634,6 +111325,7 @@ public virtual int? AdministrativeFundingControlDescriptorId private int? _administrativeFundingControlDescriptorId; private string _administrativeFundingControlDescriptor; + [IgnoreMember] public virtual string AdministrativeFundingControlDescriptor { get @@ -96649,6 +111341,7 @@ public virtual string AdministrativeFundingControlDescriptor _administrativeFundingControlDescriptorId = default(int?); } } + [Key(18)] public virtual int? CharterApprovalAgencyTypeDescriptorId { get @@ -96668,6 +111361,7 @@ public virtual int? CharterApprovalAgencyTypeDescriptorId private int? _charterApprovalAgencyTypeDescriptorId; private string _charterApprovalAgencyTypeDescriptor; + [IgnoreMember] public virtual string CharterApprovalAgencyTypeDescriptor { get @@ -96683,7 +111377,9 @@ public virtual string CharterApprovalAgencyTypeDescriptor _charterApprovalAgencyTypeDescriptorId = default(int?); } } + [Key(19)] public virtual short? CharterApprovalSchoolYear { get; set; } + [Key(20)] public virtual int? CharterStatusDescriptorId { get @@ -96703,6 +111399,7 @@ public virtual int? CharterStatusDescriptorId private int? _charterStatusDescriptorId; private string _charterStatusDescriptor; + [IgnoreMember] public virtual string CharterStatusDescriptor { get @@ -96718,6 +111415,7 @@ public virtual string CharterStatusDescriptor _charterStatusDescriptorId = default(int?); } } + [Key(21)] public virtual int? InternetAccessDescriptorId { get @@ -96737,6 +111435,7 @@ public virtual int? InternetAccessDescriptorId private int? _internetAccessDescriptorId; private string _internetAccessDescriptor; + [IgnoreMember] public virtual string InternetAccessDescriptor { get @@ -96752,7 +111451,9 @@ public virtual string InternetAccessDescriptor _internetAccessDescriptorId = default(int?); } } + [Key(22)] public virtual long? LocalEducationAgencyId { get; set; } + [Key(23)] public virtual int? MagnetSpecialProgramEmphasisSchoolDescriptorId { get @@ -96772,6 +111473,7 @@ public virtual int? MagnetSpecialProgramEmphasisSchoolDescriptorId private int? _magnetSpecialProgramEmphasisSchoolDescriptorId; private string _magnetSpecialProgramEmphasisSchoolDescriptor; + [IgnoreMember] public virtual string MagnetSpecialProgramEmphasisSchoolDescriptor { get @@ -96787,6 +111489,7 @@ public virtual string MagnetSpecialProgramEmphasisSchoolDescriptor _magnetSpecialProgramEmphasisSchoolDescriptorId = default(int?); } } + [Key(24)] public virtual int? SchoolTypeDescriptorId { get @@ -96806,6 +111509,7 @@ public virtual int? SchoolTypeDescriptorId private int? _schoolTypeDescriptorId; private string _schoolTypeDescriptor; + [IgnoreMember] public virtual string SchoolTypeDescriptor { get @@ -96821,6 +111525,7 @@ public virtual string SchoolTypeDescriptor _schoolTypeDescriptorId = default(int?); } } + [Key(25)] public virtual int? TitleIPartASchoolDesignationDescriptorId { get @@ -96840,6 +111545,7 @@ public virtual int? TitleIPartASchoolDesignationDescriptorId private int? _titleIPartASchoolDesignationDescriptorId; private string _titleIPartASchoolDesignationDescriptor; + [IgnoreMember] public virtual string TitleIPartASchoolDesignationDescriptor { get @@ -96867,14 +111573,27 @@ public virtual string TitleIPartASchoolDesignationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "School", "School")] + [Key(26)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -96893,12 +111612,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "School", "School")] + [Key(27)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(28)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData CharterApprovalSchoolYearTypeReferenceData { get; set; } /// @@ -96910,6 +111670,7 @@ public IDictionary Extensions set { } } + [Key(29)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData LocalEducationAgencyReferenceData { get; set; } /// @@ -96929,6 +111690,8 @@ public IDictionary Extensions private ICollection _schoolCategories; private ICollection _schoolCategoriesCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SchoolCategories { get @@ -96938,6 +111701,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SchoolCategories"); + } + foreach (var item in _schoolCategories) if (item.School == null) item.School = this; @@ -96976,6 +111744,8 @@ public virtual ICollection _schoolGradeLevels; private ICollection _schoolGradeLevelsCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SchoolGradeLevels { get @@ -96985,6 +111755,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SchoolGradeLevels"); + } + foreach (var item in _schoolGradeLevels) if (item.School == null) item.School = this; @@ -97128,6 +111903,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolCategory : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISchoolCategory, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -97135,8 +111911,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SchoolCategory() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -97144,7 +111920,7 @@ public SchoolCategory() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual School School { get; set; } Entities.Common.EdFi.ISchool ISchoolCategory.School @@ -97154,6 +111930,7 @@ Entities.Common.EdFi.ISchool ISchoolCategory.School } [DomainSignature] + [Key(1)] public virtual int SchoolCategoryDescriptorId { get @@ -97173,6 +111950,7 @@ public virtual int SchoolCategoryDescriptorId private int _schoolCategoryDescriptorId; private string _schoolCategoryDescriptor; + [IgnoreMember] public virtual string SchoolCategoryDescriptor { get @@ -97210,14 +111988,27 @@ public virtual string SchoolCategoryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "School", "SchoolCategory")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -97236,7 +112027,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "School", "SchoolCategory")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -97264,7 +112095,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (School as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (School as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SchoolCategoryDescriptorId", SchoolCategoryDescriptorId); @@ -97352,6 +112183,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISchoolGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -97359,8 +112191,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SchoolGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -97368,7 +112200,7 @@ public SchoolGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual School School { get; set; } Entities.Common.EdFi.ISchool ISchoolGradeLevel.School @@ -97378,6 +112210,7 @@ Entities.Common.EdFi.ISchool ISchoolGradeLevel.School } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -97397,6 +112230,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -97434,14 +112268,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "School", "SchoolGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -97460,7 +112307,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "School", "SchoolGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -97488,7 +112375,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (School as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (School as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -97581,6 +112468,7 @@ namespace EdFi.Ods.Entities.NHibernate.SchoolCategoryDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISchoolCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -97589,6 +112477,7 @@ public class SchoolCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SchoolCategoryDescriptorId { get { return base.DescriptorId; } @@ -97760,6 +112649,7 @@ namespace EdFi.Ods.Entities.NHibernate.SchoolChoiceBasisDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolChoiceBasisDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISchoolChoiceBasisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -97768,6 +112658,7 @@ public class SchoolChoiceBasisDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SchoolChoiceBasisDescriptorId { get { return base.DescriptorId; } @@ -97939,6 +112830,7 @@ namespace EdFi.Ods.Entities.NHibernate.SchoolChoiceImplementStatusDescriptorAggr /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolChoiceImplementStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISchoolChoiceImplementStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -97947,6 +112839,7 @@ public class SchoolChoiceImplementStatusDescriptor : DescriptorAggregate.EdFi.De // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SchoolChoiceImplementStatusDescriptorId { get { return base.DescriptorId; } @@ -98118,6 +113011,7 @@ namespace EdFi.Ods.Entities.NHibernate.SchoolFoodServiceProgramServiceDescriptor /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolFoodServiceProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISchoolFoodServiceProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -98126,6 +113020,7 @@ public class SchoolFoodServiceProgramServiceDescriptor : DescriptorAggregate.EdF // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SchoolFoodServiceProgramServiceDescriptorId { get { return base.DescriptorId; } @@ -98297,6 +113192,7 @@ namespace EdFi.Ods.Entities.NHibernate.SchoolTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISchoolTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -98305,6 +113201,7 @@ public class SchoolTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SchoolTypeDescriptorId { get { return base.DescriptorId; } @@ -98471,17 +113368,20 @@ namespace EdFi.Ods.Entities.NHibernate.SchoolYearTypeAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SchoolYearTypeReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(1)] public virtual Guid? Id { get; set; } // Provide primary key information @@ -98546,6 +113446,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SchoolYearType : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISchoolYearType, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -98553,8 +113454,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SchoolYearType() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -98563,6 +113464,7 @@ public SchoolYearType() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- @@ -98574,7 +113476,9 @@ public SchoolYearType() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(7)] public virtual bool CurrentSchoolYear { get; set; } + [Key(8)] public virtual string SchoolYearDescription { get; set; } // ------------------------------------------------------------- @@ -98588,14 +113492,27 @@ public SchoolYearType() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SchoolYearType", "SchoolYearType")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -98614,7 +113531,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SchoolYearType", "SchoolYearType")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -98725,27 +113682,35 @@ namespace EdFi.Ods.Entities.NHibernate.SectionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SectionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string LocalCourseCode { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } + [Key(2)] public virtual short SchoolYear { get; set; } + [Key(3)] public virtual string SectionIdentifier { get; set; } + [Key(4)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -98814,6 +113779,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Section : AggregateRootWithCompositeKey, IHasCascadableKeyValues, Entities.Common.EdFi.ISection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -98826,8 +113792,8 @@ public Section() SectionCourseLevelCharacteristics = new HashSet(); SectionOfferedGradeLevels = new HashSet(); SectionPrograms = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions
(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions
()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions
(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions
()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -98836,14 +113802,19 @@ public Section() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(8)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(9)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(10)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- @@ -98855,8 +113826,11 @@ public Section() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(11)] public virtual decimal? AvailableCreditConversion { get; set; } + [Key(12)] public virtual decimal? AvailableCredits { get; set; } + [Key(13)] public virtual int? AvailableCreditTypeDescriptorId { get @@ -98876,6 +113850,7 @@ public virtual int? AvailableCreditTypeDescriptorId private int? _availableCreditTypeDescriptorId; private string _availableCreditTypeDescriptor; + [IgnoreMember] public virtual string AvailableCreditTypeDescriptor { get @@ -98891,6 +113866,7 @@ public virtual string AvailableCreditTypeDescriptor _availableCreditTypeDescriptorId = default(int?); } } + [Key(14)] public virtual int? EducationalEnvironmentDescriptorId { get @@ -98910,6 +113886,7 @@ public virtual int? EducationalEnvironmentDescriptorId private int? _educationalEnvironmentDescriptorId; private string _educationalEnvironmentDescriptor; + [IgnoreMember] public virtual string EducationalEnvironmentDescriptor { get @@ -98925,6 +113902,7 @@ public virtual string EducationalEnvironmentDescriptor _educationalEnvironmentDescriptorId = default(int?); } } + [Key(15)] public virtual int? InstructionLanguageDescriptorId { get @@ -98944,6 +113922,7 @@ public virtual int? InstructionLanguageDescriptorId private int? _instructionLanguageDescriptorId; private string _instructionLanguageDescriptor; + [IgnoreMember] public virtual string InstructionLanguageDescriptor { get @@ -98959,8 +113938,11 @@ public virtual string InstructionLanguageDescriptor _instructionLanguageDescriptorId = default(int?); } } + [Key(16)] public virtual string LocationClassroomIdentificationCode { get; set; } + [Key(17)] public virtual long? LocationSchoolId { get; set; } + [Key(18)] public virtual int? MediumOfInstructionDescriptorId { get @@ -98980,6 +113962,7 @@ public virtual int? MediumOfInstructionDescriptorId private int? _mediumOfInstructionDescriptorId; private string _mediumOfInstructionDescriptor; + [IgnoreMember] public virtual string MediumOfInstructionDescriptor { get @@ -98995,7 +113978,9 @@ public virtual string MediumOfInstructionDescriptor _mediumOfInstructionDescriptorId = default(int?); } } + [Key(19)] public virtual bool? OfficialAttendancePeriod { get; set; } + [Key(20)] public virtual int? PopulationServedDescriptorId { get @@ -99015,6 +114000,7 @@ public virtual int? PopulationServedDescriptorId private int? _populationServedDescriptorId; private string _populationServedDescriptor; + [IgnoreMember] public virtual string PopulationServedDescriptor { get @@ -99030,7 +114016,9 @@ public virtual string PopulationServedDescriptor _populationServedDescriptorId = default(int?); } } + [Key(21)] public virtual string SectionName { get; set; } + [Key(22)] public virtual int? SectionTypeDescriptorId { get @@ -99050,6 +114038,7 @@ public virtual int? SectionTypeDescriptorId private int? _sectionTypeDescriptorId; private string _sectionTypeDescriptor; + [IgnoreMember] public virtual string SectionTypeDescriptor { get @@ -99065,6 +114054,7 @@ public virtual string SectionTypeDescriptor _sectionTypeDescriptorId = default(int?); } } + [Key(23)] public virtual int? SequenceOfCourse { get; set; } // ------------------------------------------------------------- @@ -99078,14 +114068,27 @@ public virtual string SectionTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Section", "Section")] + [Key(24)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -99104,12 +114107,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Section", "Section")] + [Key(25)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(26)] public virtual NHibernate.CourseOfferingAggregate.EdFi.CourseOfferingReferenceData CourseOfferingReferenceData { get; set; } /// @@ -99130,6 +114174,7 @@ string Entities.Common.EdFi.ISection.CourseOfferingDiscriminator set { } } + [Key(27)] public virtual NHibernate.LocationAggregate.EdFi.LocationReferenceData LocationReferenceData { get; set; } /// @@ -99150,6 +114195,7 @@ string Entities.Common.EdFi.ISection.LocationDiscriminator set { } } + [Key(28)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData LocationSchoolReferenceData { get; set; } /// @@ -99169,6 +114215,8 @@ string Entities.Common.EdFi.ISection.LocationDiscriminator private ICollection _sectionCharacteristics; private ICollection _sectionCharacteristicsCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SectionCharacteristics { get @@ -99178,6 +114226,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SectionCharacteristics"); + } + foreach (var item in _sectionCharacteristics) if (item.Section == null) item.Section = this; @@ -99216,6 +114269,8 @@ public virtual ICollection _sectionClassPeriods; private ICollection _sectionClassPeriodsCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SectionClassPeriods { get @@ -99225,6 +114280,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SectionClassPeriods"); + } + foreach (var item in _sectionClassPeriods) if (item.Section == null) item.Section = this; @@ -99263,6 +114323,8 @@ public virtual ICollection _sectionCourseLevelCharacteristics; private ICollection _sectionCourseLevelCharacteristicsCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SectionCourseLevelCharacteristics { get @@ -99272,6 +114334,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SectionCourseLevelCharacteristics"); + } + foreach (var item in _sectionCourseLevelCharacteristics) if (item.Section == null) item.Section = this; @@ -99310,6 +114377,8 @@ public virtual ICollection _sectionOfferedGradeLevels; private ICollection _sectionOfferedGradeLevelsCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SectionOfferedGradeLevels { get @@ -99319,6 +114388,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SectionOfferedGradeLevels"); + } + foreach (var item in _sectionOfferedGradeLevels) if (item.Section == null) item.Section = this; @@ -99357,6 +114431,8 @@ public virtual ICollection _sectionPrograms; private ICollection _sectionProgramsCovariant; + [Key(33)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SectionPrograms { get @@ -99366,6 +114442,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SectionPrograms"); + } + foreach (var item in _sectionPrograms) if (item.Section == null) item.Section = this; @@ -99517,6 +114598,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionCharacteristic : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISectionCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -99524,8 +114606,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SectionCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -99533,7 +114615,7 @@ public SectionCharacteristic() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Section Section { get; set; } Entities.Common.EdFi.ISection ISectionCharacteristic.Section @@ -99543,6 +114625,7 @@ Entities.Common.EdFi.ISection ISectionCharacteristic.Section } [DomainSignature] + [Key(1)] public virtual int SectionCharacteristicDescriptorId { get @@ -99562,6 +114645,7 @@ public virtual int SectionCharacteristicDescriptorId private int _sectionCharacteristicDescriptorId; private string _sectionCharacteristicDescriptor; + [IgnoreMember] public virtual string SectionCharacteristicDescriptor { get @@ -99599,14 +114683,27 @@ public virtual string SectionCharacteristicDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Section", "SectionCharacteristic")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -99625,7 +114722,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Section", "SectionCharacteristic")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -99653,7 +114790,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SectionCharacteristicDescriptorId", SectionCharacteristicDescriptorId); @@ -99741,6 +114878,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionClassPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISectionClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -99748,8 +114886,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SectionClassPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -99757,7 +114895,7 @@ public SectionClassPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Section Section { get; set; } Entities.Common.EdFi.ISection ISectionClassPeriod.Section @@ -99767,6 +114905,7 @@ Entities.Common.EdFi.ISection ISectionClassPeriod.Section } [DomainSignature] + [Key(1)] public virtual string ClassPeriodName { get; set; } // ------------------------------------------------------------- @@ -99790,14 +114929,27 @@ Entities.Common.EdFi.ISection ISectionClassPeriod.Section // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Section", "SectionClassPeriod")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -99816,12 +114968,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Section", "SectionClassPeriod")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } /// @@ -99863,7 +115056,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ClassPeriodName", ClassPeriodName); @@ -99951,6 +115144,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionCourseLevelCharacteristic : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISectionCourseLevelCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -99958,8 +115152,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SectionCourseLevelCharacteristic() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -99967,7 +115161,7 @@ public SectionCourseLevelCharacteristic() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Section Section { get; set; } Entities.Common.EdFi.ISection ISectionCourseLevelCharacteristic.Section @@ -99977,6 +115171,7 @@ Entities.Common.EdFi.ISection ISectionCourseLevelCharacteristic.Section } [DomainSignature] + [Key(1)] public virtual int CourseLevelCharacteristicDescriptorId { get @@ -99996,6 +115191,7 @@ public virtual int CourseLevelCharacteristicDescriptorId private int _courseLevelCharacteristicDescriptorId; private string _courseLevelCharacteristicDescriptor; + [IgnoreMember] public virtual string CourseLevelCharacteristicDescriptor { get @@ -100033,14 +115229,27 @@ public virtual string CourseLevelCharacteristicDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Section", "SectionCourseLevelCharacteristic")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -100059,7 +115268,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Section", "SectionCourseLevelCharacteristic")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -100087,7 +115336,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CourseLevelCharacteristicDescriptorId", CourseLevelCharacteristicDescriptorId); @@ -100175,6 +115424,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionOfferedGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISectionOfferedGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -100182,8 +115432,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SectionOfferedGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -100191,7 +115441,7 @@ public SectionOfferedGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Section Section { get; set; } Entities.Common.EdFi.ISection ISectionOfferedGradeLevel.Section @@ -100201,6 +115451,7 @@ Entities.Common.EdFi.ISection ISectionOfferedGradeLevel.Section } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -100220,6 +115471,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -100257,14 +115509,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Section", "SectionOfferedGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -100283,7 +115548,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Section", "SectionOfferedGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -100311,7 +115616,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -100399,6 +115704,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionProgram : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISectionProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -100406,8 +115712,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SectionProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -100415,7 +115721,7 @@ public SectionProgram() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Section Section { get; set; } Entities.Common.EdFi.ISection ISectionProgram.Section @@ -100425,10 +115731,13 @@ Entities.Common.EdFi.ISection ISectionProgram.Section } [DomainSignature] + [Key(1)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(2)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(3)] public virtual int ProgramTypeDescriptorId { get @@ -100448,6 +115757,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -100485,14 +115795,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Section", "SectionProgram")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -100511,12 +115834,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Section", "SectionProgram")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -100559,7 +115923,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Section as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Section as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("EducationOrganizationId", EducationOrganizationId); @@ -100654,6 +116018,7 @@ namespace EdFi.Ods.Entities.NHibernate.Section504DisabilityDescriptorAggregate.E /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Section504DisabilityDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISection504DisabilityDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -100662,6 +116027,7 @@ public class Section504DisabilityDescriptor : DescriptorAggregate.EdFi.Descripto // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int Section504DisabilityDescriptorId { get { return base.DescriptorId; } @@ -100828,29 +116194,39 @@ namespace EdFi.Ods.Entities.NHibernate.SectionAttendanceTakenEventAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SectionAttendanceTakenEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string CalendarCode { get; set; } + [Key(1)] public virtual DateTime Date { get; set; } + [Key(2)] public virtual string LocalCourseCode { get; set; } + [Key(3)] public virtual long SchoolId { get; set; } + [Key(4)] public virtual short SchoolYear { get; set; } + [Key(5)] public virtual string SectionIdentifier { get; set; } + [Key(6)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -100921,6 +116297,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionAttendanceTakenEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISectionAttendanceTakenEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -100928,8 +116305,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SectionAttendanceTakenEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -100938,8 +116315,10 @@ public SectionAttendanceTakenEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string CalendarCode { get; set; } [DomainSignature] + [Key(7)] public virtual DateTime Date { get { return _date; } @@ -100950,14 +116329,19 @@ public virtual DateTime Date private DateTime _date; [DomainSignature] + [Key(8)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(9)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(10)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(11)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(12)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- @@ -100969,6 +116353,7 @@ public virtual DateTime Date // ============================================================= // Properties // ------------------------------------------------------------- + [Key(13)] public virtual DateTime EventDate { get { return _eventDate; } @@ -100978,6 +116363,7 @@ public virtual DateTime EventDate private DateTime _eventDate; + [Key(14)] public virtual int? StaffUSI { get @@ -101007,6 +116393,7 @@ public virtual int? StaffUSI private int? _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -101042,14 +116429,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SectionAttendanceTakenEvent", "SectionAttendanceTakenEvent")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -101068,12 +116468,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SectionAttendanceTakenEvent", "SectionAttendanceTakenEvent")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.CalendarDateAggregate.EdFi.CalendarDateReferenceData CalendarDateReferenceData { get; set; } /// @@ -101094,6 +116535,7 @@ string Entities.Common.EdFi.ISectionAttendanceTakenEvent.CalendarDateDiscriminat set { } } + [Key(18)] public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// @@ -101114,6 +116556,7 @@ string Entities.Common.EdFi.ISectionAttendanceTakenEvent.SectionDiscriminator set { } } + [Key(19)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -101250,6 +116693,7 @@ namespace EdFi.Ods.Entities.NHibernate.SectionCharacteristicDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISectionCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -101258,6 +116702,7 @@ public class SectionCharacteristicDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SectionCharacteristicDescriptorId { get { return base.DescriptorId; } @@ -101429,6 +116874,7 @@ namespace EdFi.Ods.Entities.NHibernate.SectionTypeDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SectionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISectionTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -101437,6 +116883,7 @@ public class SectionTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SectionTypeDescriptorId { get { return base.DescriptorId; } @@ -101608,6 +117055,7 @@ namespace EdFi.Ods.Entities.NHibernate.SeparationDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SeparationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISeparationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -101616,6 +117064,7 @@ public class SeparationDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SeparationDescriptorId { get { return base.DescriptorId; } @@ -101787,6 +117236,7 @@ namespace EdFi.Ods.Entities.NHibernate.SeparationReasonDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SeparationReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISeparationReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -101795,6 +117245,7 @@ public class SeparationReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SeparationReasonDescriptorId { get { return base.DescriptorId; } @@ -101966,6 +117417,7 @@ namespace EdFi.Ods.Entities.NHibernate.ServiceDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class ServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -101974,6 +117426,7 @@ public class ServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int ServiceDescriptorId { get { return base.DescriptorId; } @@ -102140,25 +117593,31 @@ namespace EdFi.Ods.Entities.NHibernate.SessionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SessionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long SchoolId { get; set; } + [Key(1)] public virtual short SchoolYear { get; set; } + [Key(2)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -102225,6 +117684,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Session : AggregateRootWithCompositeKey, IHasCascadableKeyValues, Entities.Common.EdFi.ISession, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -102234,8 +117694,8 @@ public Session() { SessionAcademicWeeks = new HashSet(); SessionGradingPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -102244,10 +117704,13 @@ public Session() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(7)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(8)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- @@ -102259,6 +117722,7 @@ public Session() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -102268,6 +117732,7 @@ public virtual DateTime BeginDate private DateTime _beginDate; + [Key(10)] public virtual DateTime EndDate { get { return _endDate; } @@ -102277,6 +117742,7 @@ public virtual DateTime EndDate private DateTime _endDate; + [Key(11)] public virtual int TermDescriptorId { get @@ -102296,6 +117762,7 @@ public virtual int TermDescriptorId private int _termDescriptorId; private string _termDescriptor; + [IgnoreMember] public virtual string TermDescriptor { get @@ -102311,6 +117778,7 @@ public virtual string TermDescriptor _termDescriptorId = default(int); } } + [Key(12)] public virtual int TotalInstructionalDays { get; set; } // ------------------------------------------------------------- @@ -102324,14 +117792,27 @@ public virtual string TermDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Session", "Session")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -102350,12 +117831,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Session", "Session")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// @@ -102367,6 +117889,7 @@ public IDictionary Extensions set { } } + [Key(16)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -102386,6 +117909,8 @@ public IDictionary Extensions private ICollection _sessionAcademicWeeks; private ICollection _sessionAcademicWeeksCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SessionAcademicWeeks { get @@ -102395,6 +117920,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SessionAcademicWeeks"); + } + foreach (var item in _sessionAcademicWeeks) if (item.Session == null) item.Session = this; @@ -102433,6 +117963,8 @@ public virtual ICollection _sessionGradingPeriods; private ICollection _sessionGradingPeriodsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SessionGradingPeriods { get @@ -102442,6 +117974,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SessionGradingPeriods"); + } + foreach (var item in _sessionGradingPeriods) if (item.Session == null) item.Session = this; @@ -102586,6 +118123,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SessionAcademicWeek : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISessionAcademicWeek, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -102593,8 +118131,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SessionAcademicWeek() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -102602,7 +118140,7 @@ public SessionAcademicWeek() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Session Session { get; set; } Entities.Common.EdFi.ISession ISessionAcademicWeek.Session @@ -102612,6 +118150,7 @@ Entities.Common.EdFi.ISession ISessionAcademicWeek.Session } [DomainSignature] + [Key(1)] public virtual string WeekIdentifier { get; set; } // ------------------------------------------------------------- @@ -102635,14 +118174,27 @@ Entities.Common.EdFi.ISession ISessionAcademicWeek.Session // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Session", "SessionAcademicWeek")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -102661,12 +118213,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Session", "SessionAcademicWeek")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.AcademicWeekAggregate.EdFi.AcademicWeekReferenceData AcademicWeekReferenceData { get; set; } /// @@ -102708,7 +118301,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Session as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Session as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("WeekIdentifier", WeekIdentifier); @@ -102796,6 +118389,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SessionGradingPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISessionGradingPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -102803,8 +118397,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SessionGradingPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -102812,7 +118406,7 @@ public SessionGradingPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Session Session { get; set; } Entities.Common.EdFi.ISession ISessionGradingPeriod.Session @@ -102822,6 +118416,7 @@ Entities.Common.EdFi.ISession ISessionGradingPeriod.Session } [DomainSignature] + [Key(1)] public virtual int GradingPeriodDescriptorId { get @@ -102841,6 +118436,7 @@ public virtual int GradingPeriodDescriptorId private int _gradingPeriodDescriptorId; private string _gradingPeriodDescriptor; + [IgnoreMember] public virtual string GradingPeriodDescriptor { get @@ -102857,6 +118453,7 @@ public virtual string GradingPeriodDescriptor } } [DomainSignature] + [Key(2)] public virtual string GradingPeriodName { get; set; } // ------------------------------------------------------------- @@ -102880,14 +118477,27 @@ public virtual string GradingPeriodDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Session", "SessionGradingPeriod")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -102906,12 +118516,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Session", "SessionGradingPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// @@ -102954,7 +118605,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Session as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Session as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); @@ -103048,6 +118699,7 @@ namespace EdFi.Ods.Entities.NHibernate.SexDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SexDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISexDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -103056,6 +118708,7 @@ public class SexDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SexDescriptorId { get { return base.DescriptorId; } @@ -103222,24 +118875,29 @@ namespace EdFi.Ods.Entities.NHibernate.SourceDimensionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SourceDimensionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Code { get; set; } + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -103305,6 +118963,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SourceDimension : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISourceDimension, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -103313,8 +118972,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SourceDimension() { SourceDimensionReportingTags = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -103323,8 +118982,10 @@ public SourceDimension() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Code { get; set; } [DomainSignature] + [Key(7)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -103336,6 +118997,7 @@ public SourceDimension() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual string CodeName { get; set; } // ------------------------------------------------------------- @@ -103349,14 +119011,27 @@ public SourceDimension() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SourceDimension", "SourceDimension")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -103375,7 +119050,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SourceDimension", "SourceDimension")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -103389,6 +119104,8 @@ public IDictionary Extensions private ICollection _sourceDimensionReportingTags; private ICollection _sourceDimensionReportingTagsCovariant; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SourceDimensionReportingTags { get @@ -103398,6 +119115,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SourceDimensionReportingTags"); + } + foreach (var item in _sourceDimensionReportingTags) if (item.SourceDimension == null) item.SourceDimension = this; @@ -103534,6 +119256,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SourceDimensionReportingTag : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISourceDimensionReportingTag, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -103541,8 +119264,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SourceDimensionReportingTag() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -103550,7 +119273,7 @@ public SourceDimensionReportingTag() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual SourceDimension SourceDimension { get; set; } Entities.Common.EdFi.ISourceDimension ISourceDimensionReportingTag.SourceDimension @@ -103560,6 +119283,7 @@ Entities.Common.EdFi.ISourceDimension ISourceDimensionReportingTag.SourceDimensi } [DomainSignature] + [Key(1)] public virtual int ReportingTagDescriptorId { get @@ -103579,6 +119303,7 @@ public virtual int ReportingTagDescriptorId private int _reportingTagDescriptorId; private string _reportingTagDescriptor; + [IgnoreMember] public virtual string ReportingTagDescriptor { get @@ -103616,14 +119341,27 @@ public virtual string ReportingTagDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SourceDimension", "SourceDimensionReportingTag")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -103642,7 +119380,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SourceDimension", "SourceDimensionReportingTag")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -103670,7 +119448,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (SourceDimension as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (SourceDimension as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ReportingTagDescriptorId", ReportingTagDescriptorId); @@ -103763,6 +119541,7 @@ namespace EdFi.Ods.Entities.NHibernate.SourceSystemDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SourceSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISourceSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -103771,6 +119550,7 @@ public class SourceSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SourceSystemDescriptorId { get { return base.DescriptorId; } @@ -103942,6 +119722,7 @@ namespace EdFi.Ods.Entities.NHibernate.SpecialEducationExitReasonDescriptorAggre /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SpecialEducationExitReasonDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISpecialEducationExitReasonDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -103950,6 +119731,7 @@ public class SpecialEducationExitReasonDescriptor : DescriptorAggregate.EdFi.Des // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SpecialEducationExitReasonDescriptorId { get { return base.DescriptorId; } @@ -104121,6 +119903,7 @@ namespace EdFi.Ods.Entities.NHibernate.SpecialEducationProgramServiceDescriptorA /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SpecialEducationProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISpecialEducationProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -104129,6 +119912,7 @@ public class SpecialEducationProgramServiceDescriptor : DescriptorAggregate.EdFi // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SpecialEducationProgramServiceDescriptorId { get { return base.DescriptorId; } @@ -104300,6 +120084,7 @@ namespace EdFi.Ods.Entities.NHibernate.SpecialEducationSettingDescriptorAggregat /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SpecialEducationSettingDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISpecialEducationSettingDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -104308,6 +120093,7 @@ public class SpecialEducationSettingDescriptor : DescriptorAggregate.EdFi.Descri // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SpecialEducationSettingDescriptorId { get { return base.DescriptorId; } @@ -104474,23 +120260,27 @@ namespace EdFi.Ods.Entities.NHibernate.StaffAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(1)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(2)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -104555,6 +120345,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Staff : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaff, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IPersonUsiMutator, IHasExtensions { @@ -104577,8 +120368,8 @@ public Staff() StaffTelephones = new HashSet(); StaffTribalAffiliations = new HashSet(); StaffVisas = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -104587,6 +120378,7 @@ public Staff() // Primary Key // ------------------------------------------------------------- [Display(Name="StaffUniqueId")][DomainSignature] + [Key(6)] public virtual int StaffUSI { get @@ -104625,6 +120417,7 @@ public virtual int StaffUSI // ============================================================= // Properties // ------------------------------------------------------------- + [Key(7)] public virtual DateTime? BirthDate { get { return _birthDate; } @@ -104644,6 +120437,7 @@ public virtual DateTime? BirthDate private DateTime? _birthDate; + [Key(8)] public virtual int? CitizenshipStatusDescriptorId { get @@ -104663,6 +120457,7 @@ public virtual int? CitizenshipStatusDescriptorId private int? _citizenshipStatusDescriptorId; private string _citizenshipStatusDescriptor; + [IgnoreMember] public virtual string CitizenshipStatusDescriptor { get @@ -104678,9 +120473,13 @@ public virtual string CitizenshipStatusDescriptor _citizenshipStatusDescriptorId = default(int?); } } + [Key(9)] public virtual string FirstName { get; set; } + [Key(10)] public virtual string GenderIdentity { get; set; } + [Key(11)] public virtual string GenerationCodeSuffix { get; set; } + [Key(12)] public virtual int? HighestCompletedLevelOfEducationDescriptorId { get @@ -104700,6 +120499,7 @@ public virtual int? HighestCompletedLevelOfEducationDescriptorId private int? _highestCompletedLevelOfEducationDescriptorId; private string _highestCompletedLevelOfEducationDescriptor; + [IgnoreMember] public virtual string HighestCompletedLevelOfEducationDescriptor { get @@ -104715,16 +120515,27 @@ public virtual string HighestCompletedLevelOfEducationDescriptor _highestCompletedLevelOfEducationDescriptorId = default(int?); } } + [Key(13)] public virtual bool? HighlyQualifiedTeacher { get; set; } + [Key(14)] public virtual bool? HispanicLatinoEthnicity { get; set; } + [Key(15)] public virtual string LastSurname { get; set; } + [Key(16)] public virtual string LoginId { get; set; } + [Key(17)] public virtual string MaidenName { get; set; } + [Key(18)] public virtual string MiddleName { get; set; } + [Key(19)] public virtual string PersonalTitlePrefix { get; set; } + [Key(20)] public virtual string PersonId { get; set; } + [Key(21)] public virtual string PreferredFirstName { get; set; } + [Key(22)] public virtual string PreferredLastSurname { get; set; } + [Key(23)] public virtual int? SexDescriptorId { get @@ -104744,6 +120555,7 @@ public virtual int? SexDescriptorId private int? _sexDescriptorId; private string _sexDescriptor; + [IgnoreMember] public virtual string SexDescriptor { get @@ -104759,6 +120571,7 @@ public virtual string SexDescriptor _sexDescriptorId = default(int?); } } + [Key(24)] public virtual int? SourceSystemDescriptorId { get @@ -104778,6 +120591,7 @@ public virtual int? SourceSystemDescriptorId private int? _sourceSystemDescriptorId; private string _sourceSystemDescriptor; + [IgnoreMember] public virtual string SourceSystemDescriptor { get @@ -104793,6 +120607,7 @@ public virtual string SourceSystemDescriptor _sourceSystemDescriptorId = default(int?); } } + [Key(25)] public virtual string StaffUniqueId { get @@ -104815,7 +120630,9 @@ public virtual string StaffUniqueId } private string _staffUniqueId; + [Key(26)] public virtual decimal? YearsOfPriorProfessionalExperience { get; set; } + [Key(27)] public virtual decimal? YearsOfPriorTeachingExperience { get; set; } // ------------------------------------------------------------- @@ -104829,14 +120646,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "Staff")] + [Key(28)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -104855,12 +120685,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "Staff")] + [Key(29)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(30)] public virtual NHibernate.PersonAggregate.EdFi.PersonReferenceData PersonReferenceData { get; set; } /// @@ -104889,6 +120760,8 @@ string Entities.Common.EdFi.IStaff.PersonDiscriminator private ICollection _staffAddresses; private ICollection _staffAddressesCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffAddresses { get @@ -104898,6 +120771,11 @@ public virtual ICollection // due to ServiceStack's lack of [OnDeserialized] attribute support. // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- + if (_staffAddresses is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "StaffAddresses"); + } + foreach (var item in _staffAddresses) if (item.Staff == null) item.Staff = this; @@ -104936,6 +120814,8 @@ public virtual ICollection private ICollection _staffAncestryEthnicOrigins; private ICollection _staffAncestryEthnicOriginsCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffAncestryEthnicOrigins { get @@ -104945,6 +120825,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffAncestryEthnicOrigins"); + } + foreach (var item in _staffAncestryEthnicOrigins) if (item.Staff == null) item.Staff = this; @@ -104983,6 +120868,8 @@ public virtual ICollection _staffCredentials; private ICollection _staffCredentialsCovariant; + [Key(33)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffCredentials { get @@ -104992,6 +120879,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffCredentials"); + } + foreach (var item in _staffCredentials) if (item.Staff == null) item.Staff = this; @@ -105030,6 +120922,8 @@ public virtual ICollection _staffElectronicMails; private ICollection _staffElectronicMailsCovariant; + [Key(34)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffElectronicMails { get @@ -105039,6 +120933,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffElectronicMails"); + } + foreach (var item in _staffElectronicMails) if (item.Staff == null) item.Staff = this; @@ -105077,6 +120976,8 @@ public virtual ICollection _staffIdentificationCodes; private ICollection _staffIdentificationCodesCovariant; + [Key(35)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffIdentificationCodes { get @@ -105086,6 +120987,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffIdentificationCodes"); + } + foreach (var item in _staffIdentificationCodes) if (item.Staff == null) item.Staff = this; @@ -105124,6 +121030,8 @@ public virtual ICollection _staffIdentificationDocuments; private ICollection _staffIdentificationDocumentsCovariant; + [Key(36)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffIdentificationDocuments { get @@ -105133,6 +121041,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffIdentificationDocuments"); + } + foreach (var item in _staffIdentificationDocuments) if (item.Staff == null) item.Staff = this; @@ -105171,6 +121084,8 @@ public virtual ICollection _staffInternationalAddresses; private ICollection _staffInternationalAddressesCovariant; + [Key(37)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffInternationalAddresses { get @@ -105180,6 +121095,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffInternationalAddresses"); + } + foreach (var item in _staffInternationalAddresses) if (item.Staff == null) item.Staff = this; @@ -105218,6 +121138,8 @@ public virtual ICollection _staffLanguages; private ICollection _staffLanguagesCovariant; + [Key(38)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffLanguages { get @@ -105227,6 +121149,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffLanguages"); + } + foreach (var item in _staffLanguages) if (item.Staff == null) item.Staff = this; @@ -105265,6 +121192,8 @@ public virtual ICollection _staffOtherNames; private ICollection _staffOtherNamesCovariant; + [Key(39)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffOtherNames { get @@ -105274,6 +121203,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffOtherNames"); + } + foreach (var item in _staffOtherNames) if (item.Staff == null) item.Staff = this; @@ -105312,6 +121246,8 @@ public virtual ICollection _staffPersonalIdentificationDocuments; private ICollection _staffPersonalIdentificationDocumentsCovariant; + [Key(40)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffPersonalIdentificationDocuments { get @@ -105321,6 +121257,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffPersonalIdentificationDocuments"); + } + foreach (var item in _staffPersonalIdentificationDocuments) if (item.Staff == null) item.Staff = this; @@ -105359,6 +121300,8 @@ public virtual ICollection _staffRaces; private ICollection _staffRacesCovariant; + [Key(41)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffRaces { get @@ -105368,6 +121311,11 @@ public virtual ICollection St // due to ServiceStack's lack of [OnDeserialized] attribute support. // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- + if (_staffRaces is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "StaffRaces"); + } + foreach (var item in _staffRaces) if (item.Staff == null) item.Staff = this; @@ -105406,6 +121354,8 @@ public virtual ICollection St private ICollection _staffRecognitions; private ICollection _staffRecognitionsCovariant; + [Key(42)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffRecognitions { get @@ -105415,6 +121365,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffRecognitions"); + } + foreach (var item in _staffRecognitions) if (item.Staff == null) item.Staff = this; @@ -105453,6 +121408,8 @@ public virtual ICollection _staffTelephones; private ICollection _staffTelephonesCovariant; + [Key(43)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffTelephones { get @@ -105462,6 +121419,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffTelephones"); + } + foreach (var item in _staffTelephones) if (item.Staff == null) item.Staff = this; @@ -105500,6 +121462,8 @@ public virtual ICollection _staffTribalAffiliations; private ICollection _staffTribalAffiliationsCovariant; + [Key(44)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffTribalAffiliations { get @@ -105509,6 +121473,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffTribalAffiliations"); + } + foreach (var item in _staffTribalAffiliations) if (item.Staff == null) item.Staff = this; @@ -105547,6 +121516,8 @@ public virtual ICollection _staffVisas; private ICollection _staffVisasCovariant; + [Key(45)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffVisas { get @@ -105556,6 +121527,11 @@ public virtual ICollection St // due to ServiceStack's lack of [OnDeserialized] attribute support. // Back-reference is required by NHibernate for persistence. // ------------------------------------------------------------- + if (_staffVisas is DeserializedPersistentGenericSet set) + { + set.Reattach(this, "StaffVisas"); + } + foreach (var item in _staffVisas) if (item.Staff == null) item.Staff = this; @@ -105695,6 +121671,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffAddress : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -105703,8 +121680,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffAddress() { StaffAddressPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -105712,7 +121689,7 @@ public StaffAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffAddress.Staff @@ -105722,6 +121699,7 @@ Entities.Common.EdFi.IStaff IStaffAddress.Staff } [DomainSignature] + [Key(1)] public virtual int AddressTypeDescriptorId { get @@ -105741,6 +121719,7 @@ public virtual int AddressTypeDescriptorId private int _addressTypeDescriptorId; private string _addressTypeDescriptor; + [IgnoreMember] public virtual string AddressTypeDescriptor { get @@ -105757,10 +121736,13 @@ public virtual string AddressTypeDescriptor } } [DomainSignature] + [Key(2)] public virtual string City { get; set; } [DomainSignature] + [Key(3)] public virtual string PostalCode { get; set; } [DomainSignature] + [Key(4)] public virtual int StateAbbreviationDescriptorId { get @@ -105780,6 +121762,7 @@ public virtual int StateAbbreviationDescriptorId private int _stateAbbreviationDescriptorId; private string _stateAbbreviationDescriptor; + [IgnoreMember] public virtual string StateAbbreviationDescriptor { get @@ -105796,6 +121779,7 @@ public virtual string StateAbbreviationDescriptor } } [DomainSignature] + [Key(5)] public virtual string StreetNumberName { get; set; } // ------------------------------------------------------------- @@ -105807,12 +121791,19 @@ public virtual string StateAbbreviationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(6)] public virtual string ApartmentRoomSuiteNumber { get; set; } + [Key(7)] public virtual string BuildingSiteNumber { get; set; } + [Key(8)] public virtual string CongressionalDistrict { get; set; } + [Key(9)] public virtual string CountyFIPSCode { get; set; } + [Key(10)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(11)] public virtual string Latitude { get; set; } + [Key(12)] public virtual int? LocaleDescriptorId { get @@ -105832,6 +121823,7 @@ public virtual int? LocaleDescriptorId private int? _localeDescriptorId; private string _localeDescriptor; + [IgnoreMember] public virtual string LocaleDescriptor { get @@ -105847,7 +121839,9 @@ public virtual string LocaleDescriptor _localeDescriptorId = default(int?); } } + [Key(13)] public virtual string Longitude { get; set; } + [Key(14)] public virtual string NameOfCounty { get; set; } // ------------------------------------------------------------- @@ -105861,14 +121855,27 @@ public virtual string LocaleDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffAddress")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -105887,7 +121894,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffAddress")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -105901,6 +121948,8 @@ public IDictionary Extensions private ICollection _staffAddressPeriods; private ICollection _staffAddressPeriodsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffAddressPeriods { get @@ -105910,6 +121959,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffAddressPeriods"); + } + foreach (var item in _staffAddressPeriods) if (item.StaffAddress == null) item.StaffAddress = this; @@ -105964,7 +122018,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); @@ -106056,6 +122110,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffAddressPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -106063,8 +122118,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffAddressPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -106072,7 +122127,7 @@ public StaffAddressPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffAddress StaffAddress { get; set; } Entities.Common.EdFi.IStaffAddress IStaffAddressPeriod.StaffAddress @@ -106082,6 +122137,7 @@ Entities.Common.EdFi.IStaffAddress IStaffAddressPeriod.StaffAddress } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -106101,6 +122157,7 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual DateTime? EndDate { get { return _endDate; } @@ -106132,14 +122189,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffAddressPeriod")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -106158,7 +122228,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffAddressPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -106187,7 +122297,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffAddress as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -106275,6 +122385,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffAncestryEthnicOrigin : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffAncestryEthnicOrigin, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -106282,8 +122393,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffAncestryEthnicOrigin() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -106291,7 +122402,7 @@ public StaffAncestryEthnicOrigin() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffAncestryEthnicOrigin.Staff @@ -106301,6 +122412,7 @@ Entities.Common.EdFi.IStaff IStaffAncestryEthnicOrigin.Staff } [DomainSignature] + [Key(1)] public virtual int AncestryEthnicOriginDescriptorId { get @@ -106320,6 +122432,7 @@ public virtual int AncestryEthnicOriginDescriptorId private int _ancestryEthnicOriginDescriptorId; private string _ancestryEthnicOriginDescriptor; + [IgnoreMember] public virtual string AncestryEthnicOriginDescriptor { get @@ -106357,14 +122470,27 @@ public virtual string AncestryEthnicOriginDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffAncestryEthnicOrigin")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -106383,7 +122509,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffAncestryEthnicOrigin")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -106411,7 +122577,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AncestryEthnicOriginDescriptorId", AncestryEthnicOriginDescriptorId); @@ -106499,6 +122665,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffCredential : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffCredential, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -106506,8 +122673,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffCredential() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -106515,7 +122682,7 @@ public StaffCredential() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffCredential.Staff @@ -106525,8 +122692,10 @@ Entities.Common.EdFi.IStaff IStaffCredential.Staff } [DomainSignature] + [Key(1)] public virtual string CredentialIdentifier { get; set; } [DomainSignature] + [Key(2)] public virtual int StateOfIssueStateAbbreviationDescriptorId { get @@ -106546,6 +122715,7 @@ public virtual int StateOfIssueStateAbbreviationDescriptorId private int _stateOfIssueStateAbbreviationDescriptorId; private string _stateOfIssueStateAbbreviationDescriptor; + [IgnoreMember] public virtual string StateOfIssueStateAbbreviationDescriptor { get @@ -106583,14 +122753,27 @@ public virtual string StateOfIssueStateAbbreviationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffCredential")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -106609,12 +122792,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffCredential")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] public virtual NHibernate.CredentialAggregate.EdFi.CredentialReferenceData CredentialReferenceData { get; set; } /// @@ -106657,7 +122881,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CredentialIdentifier", CredentialIdentifier); @@ -106746,6 +122970,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffElectronicMail : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffElectronicMail, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -106753,8 +122978,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffElectronicMail() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -106762,7 +122987,7 @@ public StaffElectronicMail() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffElectronicMail.Staff @@ -106772,8 +122997,10 @@ Entities.Common.EdFi.IStaff IStaffElectronicMail.Staff } [DomainSignature] + [Key(1)] public virtual string ElectronicMailAddress { get; set; } [DomainSignature] + [Key(2)] public virtual int ElectronicMailTypeDescriptorId { get @@ -106793,6 +123020,7 @@ public virtual int ElectronicMailTypeDescriptorId private int _electronicMailTypeDescriptorId; private string _electronicMailTypeDescriptor; + [IgnoreMember] public virtual string ElectronicMailTypeDescriptor { get @@ -106818,7 +123046,9 @@ public virtual string ElectronicMailTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(4)] public virtual bool? PrimaryEmailAddressIndicator { get; set; } // ------------------------------------------------------------- @@ -106832,14 +123062,27 @@ public virtual string ElectronicMailTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffElectronicMail")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -106858,7 +123101,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffElectronicMail")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -106886,7 +123169,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); @@ -106975,6 +123258,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffIdentificationCode : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -106982,8 +123266,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -106991,7 +123275,7 @@ public StaffIdentificationCode() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffIdentificationCode.Staff @@ -107001,6 +123285,7 @@ Entities.Common.EdFi.IStaff IStaffIdentificationCode.Staff } [DomainSignature] + [Key(1)] public virtual int StaffIdentificationSystemDescriptorId { get @@ -107020,6 +123305,7 @@ public virtual int StaffIdentificationSystemDescriptorId private int _staffIdentificationSystemDescriptorId; private string _staffIdentificationSystemDescriptor; + [IgnoreMember] public virtual string StaffIdentificationSystemDescriptor { get @@ -107045,7 +123331,9 @@ public virtual string StaffIdentificationSystemDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string AssigningOrganizationIdentificationCode { get; set; } + [Key(3)] public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- @@ -107059,14 +123347,27 @@ public virtual string StaffIdentificationSystemDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffIdentificationCode")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -107085,7 +123386,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffIdentificationCode")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -107113,7 +123454,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("StaffIdentificationSystemDescriptorId", StaffIdentificationSystemDescriptorId); @@ -107201,6 +123542,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffIdentificationDocument : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -107208,8 +123550,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffIdentificationDocument() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -107217,7 +123559,7 @@ public StaffIdentificationDocument() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffIdentificationDocument.Staff @@ -107227,6 +123569,7 @@ Entities.Common.EdFi.IStaff IStaffIdentificationDocument.Staff } [DomainSignature] + [Key(1)] public virtual int IdentificationDocumentUseDescriptorId { get @@ -107246,6 +123589,7 @@ public virtual int IdentificationDocumentUseDescriptorId private int _identificationDocumentUseDescriptorId; private string _identificationDocumentUseDescriptor; + [IgnoreMember] public virtual string IdentificationDocumentUseDescriptor { get @@ -107262,6 +123606,7 @@ public virtual string IdentificationDocumentUseDescriptor } } [DomainSignature] + [Key(2)] public virtual int PersonalInformationVerificationDescriptorId { get @@ -107281,6 +123626,7 @@ public virtual int PersonalInformationVerificationDescriptorId private int _personalInformationVerificationDescriptorId; private string _personalInformationVerificationDescriptor; + [IgnoreMember] public virtual string PersonalInformationVerificationDescriptor { get @@ -107306,6 +123652,7 @@ public virtual string PersonalInformationVerificationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual DateTime? DocumentExpirationDate { get { return _documentExpirationDate; } @@ -107325,7 +123672,9 @@ public virtual DateTime? DocumentExpirationDate private DateTime? _documentExpirationDate; + [Key(4)] public virtual string DocumentTitle { get; set; } + [Key(5)] public virtual int? IssuerCountryDescriptorId { get @@ -107345,6 +123694,7 @@ public virtual int? IssuerCountryDescriptorId private int? _issuerCountryDescriptorId; private string _issuerCountryDescriptor; + [IgnoreMember] public virtual string IssuerCountryDescriptor { get @@ -107360,7 +123710,9 @@ public virtual string IssuerCountryDescriptor _issuerCountryDescriptorId = default(int?); } } + [Key(6)] public virtual string IssuerDocumentIdentificationCode { get; set; } + [Key(7)] public virtual string IssuerName { get; set; } // ------------------------------------------------------------- @@ -107374,14 +123726,27 @@ public virtual string IssuerCountryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffIdentificationDocument")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -107400,7 +123765,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffIdentificationDocument")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -107430,7 +123835,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); @@ -107519,6 +123924,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffInternationalAddress : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -107526,8 +123932,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffInternationalAddress() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -107535,7 +123941,7 @@ public StaffInternationalAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffInternationalAddress.Staff @@ -107545,6 +123951,7 @@ Entities.Common.EdFi.IStaff IStaffInternationalAddress.Staff } [DomainSignature] + [Key(1)] public virtual int AddressTypeDescriptorId { get @@ -107564,6 +123971,7 @@ public virtual int AddressTypeDescriptorId private int _addressTypeDescriptorId; private string _addressTypeDescriptor; + [IgnoreMember] public virtual string AddressTypeDescriptor { get @@ -107589,10 +123997,15 @@ public virtual string AddressTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string AddressLine1 { get; set; } + [Key(3)] public virtual string AddressLine2 { get; set; } + [Key(4)] public virtual string AddressLine3 { get; set; } + [Key(5)] public virtual string AddressLine4 { get; set; } + [Key(6)] public virtual DateTime? BeginDate { get { return _beginDate; } @@ -107612,6 +124025,7 @@ public virtual DateTime? BeginDate private DateTime? _beginDate; + [Key(7)] public virtual int CountryDescriptorId { get @@ -107631,6 +124045,7 @@ public virtual int CountryDescriptorId private int _countryDescriptorId; private string _countryDescriptor; + [IgnoreMember] public virtual string CountryDescriptor { get @@ -107646,6 +124061,7 @@ public virtual string CountryDescriptor _countryDescriptorId = default(int); } } + [Key(8)] public virtual DateTime? EndDate { get { return _endDate; } @@ -107665,7 +124081,9 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(9)] public virtual string Latitude { get; set; } + [Key(10)] public virtual string Longitude { get; set; } // ------------------------------------------------------------- @@ -107679,14 +124097,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffInternationalAddress")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -107705,7 +124136,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffInternationalAddress")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -107734,7 +124205,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); @@ -107822,6 +124293,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffLanguage : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -107830,8 +124302,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffLanguage() { StaffLanguageUses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -107839,7 +124311,7 @@ public StaffLanguage() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffLanguage.Staff @@ -107849,6 +124321,7 @@ Entities.Common.EdFi.IStaff IStaffLanguage.Staff } [DomainSignature] + [Key(1)] public virtual int LanguageDescriptorId { get @@ -107868,6 +124341,7 @@ public virtual int LanguageDescriptorId private int _languageDescriptorId; private string _languageDescriptor; + [IgnoreMember] public virtual string LanguageDescriptor { get @@ -107905,14 +124379,27 @@ public virtual string LanguageDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffLanguage")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -107931,7 +124418,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffLanguage")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -107945,6 +124472,8 @@ public IDictionary Extensions private ICollection _staffLanguageUses; private ICollection _staffLanguageUsesCovariant; + [Key(4)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffLanguageUses { get @@ -107954,6 +124483,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffLanguageUses"); + } + foreach (var item in _staffLanguageUses) if (item.StaffLanguage == null) item.StaffLanguage = this; @@ -108006,7 +124540,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); @@ -108094,6 +124628,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffLanguageUse : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffLanguageUse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -108101,8 +124636,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffLanguageUse() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -108110,7 +124645,7 @@ public StaffLanguageUse() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffLanguage StaffLanguage { get; set; } Entities.Common.EdFi.IStaffLanguage IStaffLanguageUse.StaffLanguage @@ -108120,6 +124655,7 @@ Entities.Common.EdFi.IStaffLanguage IStaffLanguageUse.StaffLanguage } [DomainSignature] + [Key(1)] public virtual int LanguageUseDescriptorId { get @@ -108139,6 +124675,7 @@ public virtual int LanguageUseDescriptorId private int _languageUseDescriptorId; private string _languageUseDescriptor; + [IgnoreMember] public virtual string LanguageUseDescriptor { get @@ -108176,14 +124713,27 @@ public virtual string LanguageUseDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffLanguageUse")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -108202,7 +124752,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffLanguageUse")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -108231,7 +124821,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffLanguage as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffLanguage as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); @@ -108319,6 +124909,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffOtherName : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -108326,8 +124917,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffOtherName() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -108335,7 +124926,7 @@ public StaffOtherName() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffOtherName.Staff @@ -108345,6 +124936,7 @@ Entities.Common.EdFi.IStaff IStaffOtherName.Staff } [DomainSignature] + [Key(1)] public virtual int OtherNameTypeDescriptorId { get @@ -108364,6 +124956,7 @@ public virtual int OtherNameTypeDescriptorId private int _otherNameTypeDescriptorId; private string _otherNameTypeDescriptor; + [IgnoreMember] public virtual string OtherNameTypeDescriptor { get @@ -108389,10 +124982,15 @@ public virtual string OtherNameTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string FirstName { get; set; } + [Key(3)] public virtual string GenerationCodeSuffix { get; set; } + [Key(4)] public virtual string LastSurname { get; set; } + [Key(5)] public virtual string MiddleName { get; set; } + [Key(6)] public virtual string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- @@ -108406,14 +125004,27 @@ public virtual string OtherNameTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffOtherName")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -108432,7 +125043,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffOtherName")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -108460,7 +125111,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); @@ -108548,6 +125199,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -108555,8 +125207,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffPersonalIdentificationDocument() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -108564,7 +125216,7 @@ public StaffPersonalIdentificationDocument() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffPersonalIdentificationDocument.Staff @@ -108574,6 +125226,7 @@ Entities.Common.EdFi.IStaff IStaffPersonalIdentificationDocument.Staff } [DomainSignature] + [Key(1)] public virtual int IdentificationDocumentUseDescriptorId { get @@ -108593,6 +125246,7 @@ public virtual int IdentificationDocumentUseDescriptorId private int _identificationDocumentUseDescriptorId; private string _identificationDocumentUseDescriptor; + [IgnoreMember] public virtual string IdentificationDocumentUseDescriptor { get @@ -108609,6 +125263,7 @@ public virtual string IdentificationDocumentUseDescriptor } } [DomainSignature] + [Key(2)] public virtual int PersonalInformationVerificationDescriptorId { get @@ -108628,6 +125283,7 @@ public virtual int PersonalInformationVerificationDescriptorId private int _personalInformationVerificationDescriptorId; private string _personalInformationVerificationDescriptor; + [IgnoreMember] public virtual string PersonalInformationVerificationDescriptor { get @@ -108653,6 +125309,7 @@ public virtual string PersonalInformationVerificationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual DateTime? DocumentExpirationDate { get { return _documentExpirationDate; } @@ -108672,7 +125329,9 @@ public virtual DateTime? DocumentExpirationDate private DateTime? _documentExpirationDate; + [Key(4)] public virtual string DocumentTitle { get; set; } + [Key(5)] public virtual int? IssuerCountryDescriptorId { get @@ -108692,6 +125351,7 @@ public virtual int? IssuerCountryDescriptorId private int? _issuerCountryDescriptorId; private string _issuerCountryDescriptor; + [IgnoreMember] public virtual string IssuerCountryDescriptor { get @@ -108707,7 +125367,9 @@ public virtual string IssuerCountryDescriptor _issuerCountryDescriptorId = default(int?); } } + [Key(6)] public virtual string IssuerDocumentIdentificationCode { get; set; } + [Key(7)] public virtual string IssuerName { get; set; } // ------------------------------------------------------------- @@ -108721,14 +125383,27 @@ public virtual string IssuerCountryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffPersonalIdentificationDocument")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -108747,7 +125422,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffPersonalIdentificationDocument")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -108777,7 +125492,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); @@ -108866,6 +125581,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffRace : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffRace, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -108873,8 +125589,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffRace() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -108882,7 +125598,7 @@ public StaffRace() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffRace.Staff @@ -108892,6 +125608,7 @@ Entities.Common.EdFi.IStaff IStaffRace.Staff } [DomainSignature] + [Key(1)] public virtual int RaceDescriptorId { get @@ -108911,6 +125628,7 @@ public virtual int RaceDescriptorId private int _raceDescriptorId; private string _raceDescriptor; + [IgnoreMember] public virtual string RaceDescriptor { get @@ -108948,14 +125666,27 @@ public virtual string RaceDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffRace")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -108974,7 +125705,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffRace")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -109002,7 +125773,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RaceDescriptorId", RaceDescriptorId); @@ -109090,6 +125861,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffRecognition : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffRecognition, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -109097,8 +125869,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffRecognition() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -109106,7 +125878,7 @@ public StaffRecognition() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffRecognition.Staff @@ -109116,6 +125888,7 @@ Entities.Common.EdFi.IStaff IStaffRecognition.Staff } [DomainSignature] + [Key(1)] public virtual int RecognitionTypeDescriptorId { get @@ -109135,6 +125908,7 @@ public virtual int RecognitionTypeDescriptorId private int _recognitionTypeDescriptorId; private string _recognitionTypeDescriptor; + [IgnoreMember] public virtual string RecognitionTypeDescriptor { get @@ -109160,6 +125934,7 @@ public virtual string RecognitionTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? AchievementCategoryDescriptorId { get @@ -109179,6 +125954,7 @@ public virtual int? AchievementCategoryDescriptorId private int? _achievementCategoryDescriptorId; private string _achievementCategoryDescriptor; + [IgnoreMember] public virtual string AchievementCategoryDescriptor { get @@ -109194,14 +125970,23 @@ public virtual string AchievementCategoryDescriptor _achievementCategoryDescriptorId = default(int?); } } + [Key(3)] public virtual string AchievementCategorySystem { get; set; } + [Key(4)] public virtual string AchievementTitle { get; set; } + [Key(5)] public virtual string Criteria { get; set; } + [Key(6)] public virtual string CriteriaURL { get; set; } + [Key(7)] public virtual string EvidenceStatement { get; set; } + [Key(8)] public virtual string ImageURL { get; set; } + [Key(9)] public virtual string IssuerName { get; set; } + [Key(10)] public virtual string IssuerOriginURL { get; set; } + [Key(11)] public virtual DateTime? RecognitionAwardDate { get { return _recognitionAwardDate; } @@ -109221,6 +126006,7 @@ public virtual DateTime? RecognitionAwardDate private DateTime? _recognitionAwardDate; + [Key(12)] public virtual DateTime? RecognitionAwardExpiresDate { get { return _recognitionAwardExpiresDate; } @@ -109240,6 +126026,7 @@ public virtual DateTime? RecognitionAwardExpiresDate private DateTime? _recognitionAwardExpiresDate; + [Key(13)] public virtual string RecognitionDescription { get; set; } // ------------------------------------------------------------- @@ -109253,14 +126040,27 @@ public virtual DateTime? RecognitionAwardExpiresDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffRecognition")] + [Key(14)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -109279,7 +126079,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffRecognition")] + [Key(15)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -109308,7 +126148,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RecognitionTypeDescriptorId", RecognitionTypeDescriptorId); @@ -109396,6 +126236,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffTelephone : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -109403,8 +126244,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffTelephone() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -109412,7 +126253,7 @@ public StaffTelephone() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffTelephone.Staff @@ -109422,8 +126263,10 @@ Entities.Common.EdFi.IStaff IStaffTelephone.Staff } [DomainSignature] + [Key(1)] public virtual string TelephoneNumber { get; set; } [DomainSignature] + [Key(2)] public virtual int TelephoneNumberTypeDescriptorId { get @@ -109443,6 +126286,7 @@ public virtual int TelephoneNumberTypeDescriptorId private int _telephoneNumberTypeDescriptorId; private string _telephoneNumberTypeDescriptor; + [IgnoreMember] public virtual string TelephoneNumberTypeDescriptor { get @@ -109468,8 +126312,11 @@ public virtual string TelephoneNumberTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(4)] public virtual int? OrderOfPriority { get; set; } + [Key(5)] public virtual bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- @@ -109483,14 +126330,27 @@ public virtual string TelephoneNumberTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffTelephone")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -109509,7 +126369,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffTelephone")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -109537,7 +126437,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TelephoneNumber", TelephoneNumber); @@ -109626,6 +126526,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffTribalAffiliation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffTribalAffiliation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -109633,8 +126534,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffTribalAffiliation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -109642,7 +126543,7 @@ public StaffTribalAffiliation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffTribalAffiliation.Staff @@ -109652,6 +126553,7 @@ Entities.Common.EdFi.IStaff IStaffTribalAffiliation.Staff } [DomainSignature] + [Key(1)] public virtual int TribalAffiliationDescriptorId { get @@ -109671,6 +126573,7 @@ public virtual int TribalAffiliationDescriptorId private int _tribalAffiliationDescriptorId; private string _tribalAffiliationDescriptor; + [IgnoreMember] public virtual string TribalAffiliationDescriptor { get @@ -109708,14 +126611,27 @@ public virtual string TribalAffiliationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffTribalAffiliation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -109734,7 +126650,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffTribalAffiliation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -109762,7 +126718,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TribalAffiliationDescriptorId", TribalAffiliationDescriptorId); @@ -109850,6 +126806,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffVisa : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffVisa, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -109857,8 +126814,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffVisa() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -109866,7 +126823,7 @@ public StaffVisa() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Staff Staff { get; set; } Entities.Common.EdFi.IStaff IStaffVisa.Staff @@ -109876,6 +126833,7 @@ Entities.Common.EdFi.IStaff IStaffVisa.Staff } [DomainSignature] + [Key(1)] public virtual int VisaDescriptorId { get @@ -109895,6 +126853,7 @@ public virtual int VisaDescriptorId private int _visaDescriptorId; private string _visaDescriptor; + [IgnoreMember] public virtual string VisaDescriptor { get @@ -109932,14 +126891,27 @@ public virtual string VisaDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Staff", "StaffVisa")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -109958,7 +126930,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Staff", "StaffVisa")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -109986,7 +126998,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Staff as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Staff as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("VisaDescriptorId", VisaDescriptorId); @@ -110074,25 +127086,31 @@ namespace EdFi.Ods.Entities.NHibernate.StaffAbsenceEventAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffAbsenceEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int AbsenceEventCategoryDescriptorId { get; set; } + [Key(1)] public virtual DateTime EventDate { get; set; } + [Key(2)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -110159,6 +127177,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffAbsenceEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffAbsenceEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -110166,8 +127185,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffAbsenceEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -110176,6 +127195,7 @@ public StaffAbsenceEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int AbsenceEventCategoryDescriptorId { get @@ -110195,6 +127215,7 @@ public virtual int AbsenceEventCategoryDescriptorId private int _absenceEventCategoryDescriptorId; private string _absenceEventCategoryDescriptor; + [IgnoreMember] public virtual string AbsenceEventCategoryDescriptor { get @@ -110211,6 +127232,7 @@ public virtual string AbsenceEventCategoryDescriptor } } [DomainSignature] + [Key(7)] public virtual DateTime EventDate { get { return _eventDate; } @@ -110221,6 +127243,7 @@ public virtual DateTime EventDate private DateTime _eventDate; [Display(Name="StaffUniqueId")][DomainSignature] + [Key(8)] public virtual int StaffUSI { get @@ -110246,6 +127269,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -110279,7 +127303,9 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual string AbsenceEventReason { get; set; } + [Key(10)] public virtual decimal? HoursAbsent { get; set; } // ------------------------------------------------------------- @@ -110293,14 +127319,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffAbsenceEvent", "StaffAbsenceEvent")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -110319,12 +127358,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffAbsenceEvent", "StaffAbsenceEvent")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -110458,6 +127538,7 @@ namespace EdFi.Ods.Entities.NHibernate.StaffClassificationDescriptorAggregate.Ed /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffClassificationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IStaffClassificationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -110466,6 +127547,7 @@ public class StaffClassificationDescriptor : DescriptorAggregate.EdFi.Descriptor // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int StaffClassificationDescriptorId { get { return base.DescriptorId; } @@ -110632,26 +127714,33 @@ namespace EdFi.Ods.Entities.NHibernate.StaffCohortAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffCohortAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual string CohortIdentifier { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -110719,6 +127808,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffCohortAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffCohortAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -110726,8 +127816,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffCohortAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -110736,6 +127826,7 @@ public StaffCohortAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -110746,10 +127837,13 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual string CohortIdentifier { get; set; } [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(9)] public virtual int StaffUSI { get @@ -110775,6 +127869,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -110808,6 +127903,7 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual DateTime? EndDate { get { return _endDate; } @@ -110827,6 +127923,7 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(11)] public virtual bool? StudentRecordAccess { get; set; } // ------------------------------------------------------------- @@ -110840,14 +127937,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffCohortAssociation", "StaffCohortAssociation")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -110866,12 +127976,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffCohortAssociation", "StaffCohortAssociation")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.CohortAggregate.EdFi.CohortReferenceData CohortReferenceData { get; set; } /// @@ -110892,6 +128043,7 @@ string Entities.Common.EdFi.IStaffCohortAssociation.CohortDiscriminator set { } } + [Key(15)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -111020,25 +128172,31 @@ namespace EdFi.Ods.Entities.NHibernate.StaffDisciplineIncidentAssociationAggrega /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffDisciplineIncidentAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string IncidentIdentifier { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } + [Key(2)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -111105,6 +128263,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffDisciplineIncidentAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffDisciplineIncidentAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -111113,8 +128272,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffDisciplineIncidentAssociation() { StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -111123,10 +128282,13 @@ public StaffDisciplineIncidentAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string IncidentIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(8)] public virtual int StaffUSI { get @@ -111152,6 +128314,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -111197,14 +128360,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociation")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -111223,12 +128399,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociation")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(11)] public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } /// @@ -111249,6 +128466,7 @@ string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.DisciplineIncide set { } } + [Key(12)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -111277,6 +128495,8 @@ string Entities.Common.EdFi.IStaffDisciplineIncidentAssociation.StaffDiscriminat private ICollection _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes; private ICollection _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodesCovariant; + [Key(13)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes { get @@ -111286,6 +128506,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes"); + } + foreach (var item in _staffDisciplineIncidentAssociationDisciplineIncidentParticipationCodes) if (item.StaffDisciplineIncidentAssociation == null) item.StaffDisciplineIncidentAssociation = this; @@ -111423,6 +128648,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -111430,8 +128656,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -111439,7 +128665,7 @@ public StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffDisciplineIncidentAssociation StaffDisciplineIncidentAssociation { get; set; } Entities.Common.EdFi.IStaffDisciplineIncidentAssociation IStaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode.StaffDisciplineIncidentAssociation @@ -111449,6 +128675,7 @@ Entities.Common.EdFi.IStaffDisciplineIncidentAssociation IStaffDisciplineInciden } [DomainSignature] + [Key(1)] public virtual int DisciplineIncidentParticipationCodeDescriptorId { get @@ -111468,6 +128695,7 @@ public virtual int DisciplineIncidentParticipationCodeDescriptorId private int _disciplineIncidentParticipationCodeDescriptorId; private string _disciplineIncidentParticipationCodeDescriptor; + [IgnoreMember] public virtual string DisciplineIncidentParticipationCodeDescriptor { get @@ -111505,14 +128733,27 @@ public virtual string DisciplineIncidentParticipationCodeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -111531,7 +128772,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffDisciplineIncidentAssociation", "StaffDisciplineIncidentAssociationDisciplineIncidentParticipationCode")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -111559,7 +128840,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffDisciplineIncidentAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffDisciplineIncidentAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); @@ -111647,26 +128928,33 @@ namespace EdFi.Ods.Entities.NHibernate.StaffEducationOrganizationAssignmentAssoc /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffEducationOrganizationAssignmentAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual int StaffClassificationDescriptorId { get; set; } + [Key(3)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -111734,6 +129022,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffEducationOrganizationAssignmentAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -111741,8 +129030,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffEducationOrganizationAssignmentAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -111751,6 +129040,7 @@ public StaffEducationOrganizationAssignmentAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -111761,8 +129051,10 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual int StaffClassificationDescriptorId { get @@ -111782,6 +129074,7 @@ public virtual int StaffClassificationDescriptorId private int _staffClassificationDescriptorId; private string _staffClassificationDescriptor; + [IgnoreMember] public virtual string StaffClassificationDescriptor { get @@ -111798,6 +129091,7 @@ public virtual string StaffClassificationDescriptor } } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(9)] public virtual int StaffUSI { get @@ -111823,6 +129117,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -111856,8 +129151,11 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual string CredentialIdentifier { get; set; } + [Key(11)] public virtual long? EmploymentEducationOrganizationId { get; set; } + [Key(12)] public virtual DateTime? EmploymentHireDate { get { return _employmentHireDate; } @@ -111877,6 +129175,7 @@ public virtual DateTime? EmploymentHireDate private DateTime? _employmentHireDate; + [Key(13)] public virtual int? EmploymentStatusDescriptorId { get @@ -111896,6 +129195,7 @@ public virtual int? EmploymentStatusDescriptorId private int? _employmentStatusDescriptorId; private string _employmentStatusDescriptor; + [IgnoreMember] public virtual string EmploymentStatusDescriptor { get @@ -111911,6 +129211,7 @@ public virtual string EmploymentStatusDescriptor _employmentStatusDescriptorId = default(int?); } } + [Key(14)] public virtual DateTime? EndDate { get { return _endDate; } @@ -111930,9 +129231,13 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(15)] public virtual decimal? FullTimeEquivalency { get; set; } + [Key(16)] public virtual int? OrderOfAssignment { get; set; } + [Key(17)] public virtual string PositionTitle { get; set; } + [Key(18)] public virtual int? StateOfIssueStateAbbreviationDescriptorId { get @@ -111952,6 +129257,7 @@ public virtual int? StateOfIssueStateAbbreviationDescriptorId private int? _stateOfIssueStateAbbreviationDescriptorId; private string _stateOfIssueStateAbbreviationDescriptor; + [IgnoreMember] public virtual string StateOfIssueStateAbbreviationDescriptor { get @@ -111979,14 +129285,27 @@ public virtual string StateOfIssueStateAbbreviationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffEducationOrganizationAssignmentAssociation", "StaffEducationOrganizationAssignmentAssociation")] + [Key(19)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -112005,12 +129324,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffEducationOrganizationAssignmentAssociation", "StaffEducationOrganizationAssignmentAssociation")] + [Key(20)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(21)] public virtual NHibernate.CredentialAggregate.EdFi.CredentialReferenceData CredentialReferenceData { get; set; } /// @@ -112031,6 +129391,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Cre set { } } + [Key(22)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -112051,6 +129412,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Edu set { } } + [Key(23)] public virtual NHibernate.StaffEducationOrganizationEmploymentAssociationAggregate.EdFi.StaffEducationOrganizationEmploymentAssociationReferenceData EmploymentStaffEducationOrganizationEmploymentAssociationReferenceData { get; set; } /// @@ -112071,6 +129433,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationAssignmentAssociation.Emp set { } } + [Key(24)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -112202,25 +129565,31 @@ namespace EdFi.Ods.Entities.NHibernate.StaffEducationOrganizationContactAssociat /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffEducationOrganizationContactAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string ContactTitle { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -112287,6 +129656,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffEducationOrganizationContactAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -112296,8 +129666,8 @@ public StaffEducationOrganizationContactAssociation() { StaffEducationOrganizationContactAssociationAddressPersistentList = new HashSet(); StaffEducationOrganizationContactAssociationTelephones = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -112306,10 +129676,13 @@ public StaffEducationOrganizationContactAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string ContactTitle { get; set; } [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(8)] public virtual int StaffUSI { get @@ -112335,6 +129708,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -112368,6 +129742,7 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual int? ContactTypeDescriptorId { get @@ -112387,6 +129762,7 @@ public virtual int? ContactTypeDescriptorId private int? _contactTypeDescriptorId; private string _contactTypeDescriptor; + [IgnoreMember] public virtual string ContactTypeDescriptor { get @@ -112402,12 +129778,14 @@ public virtual string ContactTypeDescriptor _contactTypeDescriptorId = default(int?); } } + [Key(10)] public virtual string ElectronicMailAddress { get; set; } // ------------------------------------------------------------- // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + [IgnoreMember] public virtual Entities.NHibernate.StaffEducationOrganizationContactAssociationAggregate.EdFi.StaffEducationOrganizationContactAssociationAddress StaffEducationOrganizationContactAssociationAddress { get @@ -112444,6 +129822,8 @@ Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress Entiti private ICollection _staffEducationOrganizationContactAssociationAddressPersistentList; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffEducationOrganizationContactAssociationAddressPersistentList { get @@ -112453,6 +129833,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffEducationOrganizationContactAssociationAddress"); + } + foreach (var item in _staffEducationOrganizationContactAssociationAddressPersistentList) if (item.StaffEducationOrganizationContactAssociation == null) item.StaffEducationOrganizationContactAssociation = this; @@ -112473,14 +129858,27 @@ public virtual ICollection _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -112499,12 +129897,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociation")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -112525,6 +129964,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.Educat set { } } + [Key(15)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -112553,6 +129993,8 @@ string Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation.StaffD private ICollection _staffEducationOrganizationContactAssociationTelephones; private ICollection _staffEducationOrganizationContactAssociationTelephonesCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffEducationOrganizationContactAssociationTelephones { get @@ -112562,6 +130004,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffEducationOrganizationContactAssociationTelephones"); + } + foreach (var item in _staffEducationOrganizationContactAssociationTelephones) if (item.StaffEducationOrganizationContactAssociation == null) item.StaffEducationOrganizationContactAssociation = this; @@ -112700,6 +130147,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffEducationOrganizationContactAssociationAddress : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -112708,8 +130156,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffEducationOrganizationContactAssociationAddress() { StaffEducationOrganizationContactAssociationAddressPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -112717,7 +130165,7 @@ public StaffEducationOrganizationContactAssociationAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffEducationOrganizationContactAssociation StaffEducationOrganizationContactAssociation { get; set; } Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducationOrganizationContactAssociationAddress.StaffEducationOrganizationContactAssociation @@ -112736,6 +130184,7 @@ Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducati // ============================================================= // Properties // ------------------------------------------------------------- + [Key(1)] public virtual int AddressTypeDescriptorId { get @@ -112755,6 +130204,7 @@ public virtual int AddressTypeDescriptorId private int _addressTypeDescriptorId; private string _addressTypeDescriptor; + [IgnoreMember] public virtual string AddressTypeDescriptor { get @@ -112770,13 +130220,21 @@ public virtual string AddressTypeDescriptor _addressTypeDescriptorId = default(int); } } + [Key(2)] public virtual string ApartmentRoomSuiteNumber { get; set; } + [Key(3)] public virtual string BuildingSiteNumber { get; set; } + [Key(4)] public virtual string City { get; set; } + [Key(5)] public virtual string CongressionalDistrict { get; set; } + [Key(6)] public virtual string CountyFIPSCode { get; set; } + [Key(7)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(8)] public virtual string Latitude { get; set; } + [Key(9)] public virtual int? LocaleDescriptorId { get @@ -112796,6 +130254,7 @@ public virtual int? LocaleDescriptorId private int? _localeDescriptorId; private string _localeDescriptor; + [IgnoreMember] public virtual string LocaleDescriptor { get @@ -112811,9 +130270,13 @@ public virtual string LocaleDescriptor _localeDescriptorId = default(int?); } } + [Key(10)] public virtual string Longitude { get; set; } + [Key(11)] public virtual string NameOfCounty { get; set; } + [Key(12)] public virtual string PostalCode { get; set; } + [Key(13)] public virtual int StateAbbreviationDescriptorId { get @@ -112833,6 +130296,7 @@ public virtual int StateAbbreviationDescriptorId private int _stateAbbreviationDescriptorId; private string _stateAbbreviationDescriptor; + [IgnoreMember] public virtual string StateAbbreviationDescriptor { get @@ -112848,6 +130312,7 @@ public virtual string StateAbbreviationDescriptor _stateAbbreviationDescriptorId = default(int); } } + [Key(14)] public virtual string StreetNumberName { get; set; } // ------------------------------------------------------------- @@ -112861,14 +130326,27 @@ public virtual string StateAbbreviationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddress")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -112887,7 +130365,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddress")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -112901,6 +130419,8 @@ public IDictionary Extensions private ICollection _staffEducationOrganizationContactAssociationAddressPeriods; private ICollection _staffEducationOrganizationContactAssociationAddressPeriodsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffEducationOrganizationContactAssociationAddressPeriods { get @@ -112910,6 +130430,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffEducationOrganizationContactAssociationAddressPeriods"); + } + foreach (var item in _staffEducationOrganizationContactAssociationAddressPeriods) if (item.StaffEducationOrganizationContactAssociationAddress == null) item.StaffEducationOrganizationContactAssociationAddress = this; @@ -112964,7 +130489,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffEducationOrganizationContactAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffEducationOrganizationContactAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values @@ -113051,6 +130576,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffEducationOrganizationContactAssociationAddressPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -113058,8 +130584,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffEducationOrganizationContactAssociationAddressPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -113067,7 +130593,7 @@ public StaffEducationOrganizationContactAssociationAddressPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffEducationOrganizationContactAssociationAddress StaffEducationOrganizationContactAssociationAddress { get; set; } Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress IStaffEducationOrganizationContactAssociationAddressPeriod.StaffEducationOrganizationContactAssociationAddress @@ -113077,6 +130603,7 @@ Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationAddress IStaff } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -113096,6 +130623,7 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual DateTime? EndDate { get { return _endDate; } @@ -113127,14 +130655,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddressPeriod")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -113153,7 +130694,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationAddressPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -113180,7 +130761,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffEducationOrganizationContactAssociationAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffEducationOrganizationContactAssociationAddress as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -113268,6 +130849,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffEducationOrganizationContactAssociationTelephone : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffEducationOrganizationContactAssociationTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -113275,8 +130857,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffEducationOrganizationContactAssociationTelephone() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -113284,7 +130866,7 @@ public StaffEducationOrganizationContactAssociationTelephone() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffEducationOrganizationContactAssociation StaffEducationOrganizationContactAssociation { get; set; } Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducationOrganizationContactAssociationTelephone.StaffEducationOrganizationContactAssociation @@ -113294,8 +130876,10 @@ Entities.Common.EdFi.IStaffEducationOrganizationContactAssociation IStaffEducati } [DomainSignature] + [Key(1)] public virtual string TelephoneNumber { get; set; } [DomainSignature] + [Key(2)] public virtual int TelephoneNumberTypeDescriptorId { get @@ -113315,6 +130899,7 @@ public virtual int TelephoneNumberTypeDescriptorId private int _telephoneNumberTypeDescriptorId; private string _telephoneNumberTypeDescriptor; + [IgnoreMember] public virtual string TelephoneNumberTypeDescriptor { get @@ -113340,8 +130925,11 @@ public virtual string TelephoneNumberTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(4)] public virtual int? OrderOfPriority { get; set; } + [Key(5)] public virtual bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- @@ -113355,14 +130943,27 @@ public virtual string TelephoneNumberTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationTelephone")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -113381,7 +130982,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffEducationOrganizationContactAssociation", "StaffEducationOrganizationContactAssociationTelephone")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -113409,7 +131050,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffEducationOrganizationContactAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffEducationOrganizationContactAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TelephoneNumber", TelephoneNumber); @@ -113498,26 +131139,33 @@ namespace EdFi.Ods.Entities.NHibernate.StaffEducationOrganizationEmploymentAssoc /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffEducationOrganizationEmploymentAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual int EmploymentStatusDescriptorId { get; set; } + [Key(2)] public virtual DateTime HireDate { get; set; } + [Key(3)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -113585,6 +131233,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffEducationOrganizationEmploymentAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -113592,8 +131241,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffEducationOrganizationEmploymentAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -113602,8 +131251,10 @@ public StaffEducationOrganizationEmploymentAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual int EmploymentStatusDescriptorId { get @@ -113623,6 +131274,7 @@ public virtual int EmploymentStatusDescriptorId private int _employmentStatusDescriptorId; private string _employmentStatusDescriptor; + [IgnoreMember] public virtual string EmploymentStatusDescriptor { get @@ -113639,6 +131291,7 @@ public virtual string EmploymentStatusDescriptor } } [DomainSignature] + [Key(8)] public virtual DateTime HireDate { get { return _hireDate; } @@ -113649,6 +131302,7 @@ public virtual DateTime HireDate private DateTime _hireDate; [Display(Name="StaffUniqueId")][DomainSignature] + [Key(9)] public virtual int StaffUSI { get @@ -113674,6 +131328,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -113707,9 +131362,13 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual decimal? AnnualWage { get; set; } + [Key(11)] public virtual string CredentialIdentifier { get; set; } + [Key(12)] public virtual string Department { get; set; } + [Key(13)] public virtual DateTime? EndDate { get { return _endDate; } @@ -113729,8 +131388,11 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(14)] public virtual decimal? FullTimeEquivalency { get; set; } + [Key(15)] public virtual decimal? HourlyWage { get; set; } + [Key(16)] public virtual DateTime? OfferDate { get { return _offerDate; } @@ -113750,6 +131412,7 @@ public virtual DateTime? OfferDate private DateTime? _offerDate; + [Key(17)] public virtual int? SeparationDescriptorId { get @@ -113769,6 +131432,7 @@ public virtual int? SeparationDescriptorId private int? _separationDescriptorId; private string _separationDescriptor; + [IgnoreMember] public virtual string SeparationDescriptor { get @@ -113784,6 +131448,7 @@ public virtual string SeparationDescriptor _separationDescriptorId = default(int?); } } + [Key(18)] public virtual int? SeparationReasonDescriptorId { get @@ -113803,6 +131468,7 @@ public virtual int? SeparationReasonDescriptorId private int? _separationReasonDescriptorId; private string _separationReasonDescriptor; + [IgnoreMember] public virtual string SeparationReasonDescriptor { get @@ -113818,6 +131484,7 @@ public virtual string SeparationReasonDescriptor _separationReasonDescriptorId = default(int?); } } + [Key(19)] public virtual int? StateOfIssueStateAbbreviationDescriptorId { get @@ -113837,6 +131504,7 @@ public virtual int? StateOfIssueStateAbbreviationDescriptorId private int? _stateOfIssueStateAbbreviationDescriptorId; private string _stateOfIssueStateAbbreviationDescriptor; + [IgnoreMember] public virtual string StateOfIssueStateAbbreviationDescriptor { get @@ -113864,14 +131532,27 @@ public virtual string StateOfIssueStateAbbreviationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffEducationOrganizationEmploymentAssociation", "StaffEducationOrganizationEmploymentAssociation")] + [Key(20)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -113890,12 +131571,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffEducationOrganizationEmploymentAssociation", "StaffEducationOrganizationEmploymentAssociation")] + [Key(21)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(22)] public virtual NHibernate.CredentialAggregate.EdFi.CredentialReferenceData CredentialReferenceData { get; set; } /// @@ -113916,6 +131638,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Cre set { } } + [Key(23)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -113936,6 +131659,7 @@ string Entities.Common.EdFi.IStaffEducationOrganizationEmploymentAssociation.Edu set { } } + [Key(24)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -114073,6 +131797,7 @@ namespace EdFi.Ods.Entities.NHibernate.StaffIdentificationSystemDescriptorAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IStaffIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -114081,6 +131806,7 @@ public class StaffIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Desc // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int StaffIdentificationSystemDescriptorId { get { return base.DescriptorId; } @@ -114247,25 +131973,31 @@ namespace EdFi.Ods.Entities.NHibernate.StaffLeaveAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffLeaveReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual int StaffLeaveEventCategoryDescriptorId { get; set; } + [Key(2)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -114332,6 +132064,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffLeave : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffLeave, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -114339,8 +132072,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffLeave() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -114349,6 +132082,7 @@ public StaffLeave() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -114359,6 +132093,7 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual int StaffLeaveEventCategoryDescriptorId { get @@ -114378,6 +132113,7 @@ public virtual int StaffLeaveEventCategoryDescriptorId private int _staffLeaveEventCategoryDescriptorId; private string _staffLeaveEventCategoryDescriptor; + [IgnoreMember] public virtual string StaffLeaveEventCategoryDescriptor { get @@ -114394,6 +132130,7 @@ public virtual string StaffLeaveEventCategoryDescriptor } } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(8)] public virtual int StaffUSI { get @@ -114419,6 +132156,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -114452,6 +132190,7 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual DateTime? EndDate { get { return _endDate; } @@ -114471,7 +132210,9 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(10)] public virtual string Reason { get; set; } + [Key(11)] public virtual bool? SubstituteAssigned { get; set; } // ------------------------------------------------------------- @@ -114485,14 +132226,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffLeave", "StaffLeave")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -114511,12 +132265,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffLeave", "StaffLeave")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -114650,6 +132445,7 @@ namespace EdFi.Ods.Entities.NHibernate.StaffLeaveEventCategoryDescriptorAggregat /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffLeaveEventCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IStaffLeaveEventCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -114658,6 +132454,7 @@ public class StaffLeaveEventCategoryDescriptor : DescriptorAggregate.EdFi.Descri // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int StaffLeaveEventCategoryDescriptorId { get { return base.DescriptorId; } @@ -114824,27 +132621,35 @@ namespace EdFi.Ods.Entities.NHibernate.StaffProgramAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffProgramAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(2)] public virtual string ProgramName { get; set; } + [Key(3)] public virtual int ProgramTypeDescriptorId { get; set; } + [Key(4)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -114913,6 +132718,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffProgramAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -114920,8 +132726,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffProgramAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -114930,6 +132736,7 @@ public StaffProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -114940,10 +132747,13 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(9)] public virtual int ProgramTypeDescriptorId { get @@ -114963,6 +132773,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -114979,6 +132790,7 @@ public virtual string ProgramTypeDescriptor } } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(10)] public virtual int StaffUSI { get @@ -115004,6 +132816,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -115037,6 +132850,7 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(11)] public virtual DateTime? EndDate { get { return _endDate; } @@ -115056,6 +132870,7 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(12)] public virtual bool? StudentRecordAccess { get; set; } // ------------------------------------------------------------- @@ -115069,14 +132884,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffProgramAssociation", "StaffProgramAssociation")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -115095,12 +132923,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffProgramAssociation", "StaffProgramAssociation")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -115121,6 +132990,7 @@ string Entities.Common.EdFi.IStaffProgramAssociation.ProgramDiscriminator set { } } + [Key(16)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -115251,25 +133121,31 @@ namespace EdFi.Ods.Entities.NHibernate.StaffSchoolAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffSchoolAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int ProgramAssignmentDescriptorId { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } + [Key(2)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -115336,6 +133212,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffSchoolAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffSchoolAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -115345,8 +133222,8 @@ public StaffSchoolAssociation() { StaffSchoolAssociationAcademicSubjects = new HashSet(); StaffSchoolAssociationGradeLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -115355,6 +133232,7 @@ public StaffSchoolAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int ProgramAssignmentDescriptorId { get @@ -115374,6 +133252,7 @@ public virtual int ProgramAssignmentDescriptorId private int _programAssignmentDescriptorId; private string _programAssignmentDescriptor; + [IgnoreMember] public virtual string ProgramAssignmentDescriptor { get @@ -115390,8 +133269,10 @@ public virtual string ProgramAssignmentDescriptor } } [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(8)] public virtual int StaffUSI { get @@ -115417,6 +133298,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -115450,7 +133332,9 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual string CalendarCode { get; set; } + [Key(10)] public virtual short? SchoolYear { get; set; } // ------------------------------------------------------------- @@ -115464,14 +133348,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffSchoolAssociation", "StaffSchoolAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -115490,12 +133387,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffSchoolAssociation", "StaffSchoolAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.CalendarAggregate.EdFi.CalendarReferenceData CalendarReferenceData { get; set; } /// @@ -115516,6 +133454,7 @@ string Entities.Common.EdFi.IStaffSchoolAssociation.CalendarDiscriminator set { } } + [Key(14)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// @@ -115527,6 +133466,7 @@ string Entities.Common.EdFi.IStaffSchoolAssociation.CalendarDiscriminator set { } } + [Key(15)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -115538,6 +133478,7 @@ string Entities.Common.EdFi.IStaffSchoolAssociation.CalendarDiscriminator set { } } + [Key(16)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -115566,6 +133507,8 @@ string Entities.Common.EdFi.IStaffSchoolAssociation.StaffDiscriminator private ICollection _staffSchoolAssociationAcademicSubjects; private ICollection _staffSchoolAssociationAcademicSubjectsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffSchoolAssociationAcademicSubjects { get @@ -115575,6 +133518,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffSchoolAssociationAcademicSubjects"); + } + foreach (var item in _staffSchoolAssociationAcademicSubjects) if (item.StaffSchoolAssociation == null) item.StaffSchoolAssociation = this; @@ -115613,6 +133561,8 @@ public virtual ICollection _staffSchoolAssociationGradeLevels; private ICollection _staffSchoolAssociationGradeLevelsCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StaffSchoolAssociationGradeLevels { get @@ -115622,6 +133572,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StaffSchoolAssociationGradeLevels"); + } + foreach (var item in _staffSchoolAssociationGradeLevels) if (item.StaffSchoolAssociation == null) item.StaffSchoolAssociation = this; @@ -115760,6 +133715,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffSchoolAssociationAcademicSubject : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffSchoolAssociationAcademicSubject, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -115767,8 +133723,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffSchoolAssociationAcademicSubject() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -115776,7 +133732,7 @@ public StaffSchoolAssociationAcademicSubject() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffSchoolAssociation StaffSchoolAssociation { get; set; } Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationAcademicSubject.StaffSchoolAssociation @@ -115786,6 +133742,7 @@ Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationAcademicSubj } [DomainSignature] + [Key(1)] public virtual int AcademicSubjectDescriptorId { get @@ -115805,6 +133762,7 @@ public virtual int AcademicSubjectDescriptorId private int _academicSubjectDescriptorId; private string _academicSubjectDescriptor; + [IgnoreMember] public virtual string AcademicSubjectDescriptor { get @@ -115842,14 +133800,27 @@ public virtual string AcademicSubjectDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffSchoolAssociation", "StaffSchoolAssociationAcademicSubject")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -115868,7 +133839,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffSchoolAssociation", "StaffSchoolAssociationAcademicSubject")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -115897,7 +133908,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffSchoolAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffSchoolAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AcademicSubjectDescriptorId", AcademicSubjectDescriptorId); @@ -115985,6 +133996,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffSchoolAssociationGradeLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStaffSchoolAssociationGradeLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -115992,8 +134004,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffSchoolAssociationGradeLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -116001,7 +134013,7 @@ public StaffSchoolAssociationGradeLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StaffSchoolAssociation StaffSchoolAssociation { get; set; } Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationGradeLevel.StaffSchoolAssociation @@ -116011,6 +134023,7 @@ Entities.Common.EdFi.IStaffSchoolAssociation IStaffSchoolAssociationGradeLevel.S } [DomainSignature] + [Key(1)] public virtual int GradeLevelDescriptorId { get @@ -116030,6 +134043,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -116067,14 +134081,27 @@ public virtual string GradeLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffSchoolAssociation", "StaffSchoolAssociationGradeLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -116093,7 +134120,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffSchoolAssociation", "StaffSchoolAssociationGradeLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -116122,7 +134189,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StaffSchoolAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StaffSchoolAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradeLevelDescriptorId", GradeLevelDescriptorId); @@ -116210,29 +134277,39 @@ namespace EdFi.Ods.Entities.NHibernate.StaffSectionAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StaffSectionAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual string LocalCourseCode { get; set; } + [Key(2)] public virtual long SchoolId { get; set; } + [Key(3)] public virtual short SchoolYear { get; set; } + [Key(4)] public virtual string SectionIdentifier { get; set; } + [Key(5)] public virtual string SessionName { get; set; } + [Key(6)] public virtual int StaffUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -116303,6 +134380,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StaffSectionAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStaffSectionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -116310,8 +134388,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StaffSectionAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -116320,6 +134398,7 @@ public StaffSectionAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -116330,16 +134409,22 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(8)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(9)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(10)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(11)] public virtual string SessionName { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(12)] public virtual int StaffUSI { get @@ -116365,6 +134450,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -116398,6 +134484,7 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(13)] public virtual int ClassroomPositionDescriptorId { get @@ -116417,6 +134504,7 @@ public virtual int ClassroomPositionDescriptorId private int _classroomPositionDescriptorId; private string _classroomPositionDescriptor; + [IgnoreMember] public virtual string ClassroomPositionDescriptor { get @@ -116432,6 +134520,7 @@ public virtual string ClassroomPositionDescriptor _classroomPositionDescriptorId = default(int); } } + [Key(14)] public virtual DateTime? EndDate { get { return _endDate; } @@ -116451,8 +134540,11 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(15)] public virtual bool? HighlyQualifiedTeacher { get; set; } + [Key(16)] public virtual decimal? PercentageContribution { get; set; } + [Key(17)] public virtual bool? TeacherStudentDataLinkExclusion { get; set; } // ------------------------------------------------------------- @@ -116466,14 +134558,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StaffSectionAssociation", "StaffSectionAssociation")] + [Key(18)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -116492,12 +134597,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StaffSectionAssociation", "StaffSectionAssociation")] + [Key(19)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(20)] public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// @@ -116518,6 +134664,7 @@ string Entities.Common.EdFi.IStaffSectionAssociation.SectionDiscriminator set { } } + [Key(21)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -116655,6 +134802,7 @@ namespace EdFi.Ods.Entities.NHibernate.StateAbbreviationDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StateAbbreviationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IStateAbbreviationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -116663,6 +134811,7 @@ public class StateAbbreviationDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int StateAbbreviationDescriptorId { get { return base.DescriptorId; } @@ -116834,6 +134983,7 @@ namespace EdFi.Ods.Entities.NHibernate.StateEducationAgencyAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StateEducationAgency : EducationOrganizationAggregate.EdFi.EducationOrganization, Entities.Common.EdFi.IStateEducationAgency, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -116841,8 +134991,8 @@ public StateEducationAgency() { StateEducationAgencyAccountabilities = new HashSet(); StateEducationAgencyFederalFunds = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -116851,6 +135001,7 @@ public StateEducationAgency() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual long StateEducationAgencyId { get { return base.EducationOrganizationId; } @@ -116899,14 +135050,27 @@ string IEducationOrganization.WebSite // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StateEducationAgency", "StateEducationAgency")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -116925,7 +135089,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StateEducationAgency", "StateEducationAgency")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -116939,6 +135143,8 @@ public IDictionary Extensions private ICollection _stateEducationAgencyAccountabilities; private ICollection _stateEducationAgencyAccountabilitiesCovariant; + [Key(19)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StateEducationAgencyAccountabilities { get @@ -116948,6 +135154,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StateEducationAgencyAccountabilities"); + } + foreach (var item in _stateEducationAgencyAccountabilities) if (item.StateEducationAgency == null) item.StateEducationAgency = this; @@ -116986,6 +135197,8 @@ public virtual ICollection _stateEducationAgencyFederalFunds; private ICollection _stateEducationAgencyFederalFundsCovariant; + [Key(20)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StateEducationAgencyFederalFunds { get @@ -116995,6 +135208,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StateEducationAgencyFederalFunds"); + } + foreach (var item in _stateEducationAgencyFederalFunds) if (item.StateEducationAgency == null) item.StateEducationAgency = this; @@ -117131,6 +135349,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StateEducationAgencyAccountability : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStateEducationAgencyAccountability, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -117138,8 +135357,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StateEducationAgencyAccountability() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -117147,7 +135366,7 @@ public StateEducationAgencyAccountability() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StateEducationAgency StateEducationAgency { get; set; } Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyAccountability.StateEducationAgency @@ -117157,6 +135376,7 @@ Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyAccountability.S } [DomainSignature] + [Key(1)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- @@ -117168,6 +135388,7 @@ Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyAccountability.S // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? CTEGraduationRateInclusion { get; set; } // ------------------------------------------------------------- @@ -117181,14 +135402,27 @@ Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyAccountability.S // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StateEducationAgency", "StateEducationAgencyAccountability")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -117207,12 +135441,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StateEducationAgency", "StateEducationAgencyAccountability")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -117245,7 +135520,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StateEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StateEducationAgency as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SchoolYear", SchoolYear); @@ -117333,6 +135608,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StateEducationAgencyFederalFunds : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStateEducationAgencyFederalFunds, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -117340,8 +135616,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StateEducationAgencyFederalFunds() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -117349,7 +135625,7 @@ public StateEducationAgencyFederalFunds() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StateEducationAgency StateEducationAgency { get; set; } Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyFederalFunds.StateEducationAgency @@ -117359,6 +135635,7 @@ Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyFederalFunds.Sta } [DomainSignature] + [Key(1)] public virtual int FiscalYear { get; set; } // ------------------------------------------------------------- @@ -117370,6 +135647,7 @@ Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyFederalFunds.Sta // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? FederalProgramsFundingAllocation { get; set; } // ------------------------------------------------------------- @@ -117383,14 +135661,27 @@ Entities.Common.EdFi.IStateEducationAgency IStateEducationAgencyFederalFunds.Sta // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StateEducationAgency", "StateEducationAgencyFederalFunds")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -117409,7 +135700,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StateEducationAgency", "StateEducationAgencyFederalFunds")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -117436,7 +135767,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StateEducationAgency as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StateEducationAgency as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("FiscalYear", FiscalYear); @@ -117524,23 +135855,27 @@ namespace EdFi.Ods.Entities.NHibernate.StudentAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(1)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(2)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -117605,6 +135940,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Student : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IPersonUsiMutator, IHasExtensions { @@ -117616,8 +135952,8 @@ public Student() StudentOtherNames = new HashSet(); StudentPersonalIdentificationDocuments = new HashSet(); StudentVisas = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -117626,6 +135962,7 @@ public Student() // Primary Key // ------------------------------------------------------------- [Display(Name="StudentUniqueId")][DomainSignature] + [Key(6)] public virtual int StudentUSI { get @@ -117664,7 +136001,9 @@ public virtual int StudentUSI // ============================================================= // Properties // ------------------------------------------------------------- + [Key(7)] public virtual string BirthCity { get; set; } + [Key(8)] public virtual int? BirthCountryDescriptorId { get @@ -117684,6 +136023,7 @@ public virtual int? BirthCountryDescriptorId private int? _birthCountryDescriptorId; private string _birthCountryDescriptor; + [IgnoreMember] public virtual string BirthCountryDescriptor { get @@ -117699,6 +136039,7 @@ public virtual string BirthCountryDescriptor _birthCountryDescriptorId = default(int?); } } + [Key(9)] public virtual DateTime BirthDate { get { return _birthDate; } @@ -117708,7 +136049,9 @@ public virtual DateTime BirthDate private DateTime _birthDate; + [Key(10)] public virtual string BirthInternationalProvince { get; set; } + [Key(11)] public virtual int? BirthSexDescriptorId { get @@ -117728,6 +136071,7 @@ public virtual int? BirthSexDescriptorId private int? _birthSexDescriptorId; private string _birthSexDescriptor; + [IgnoreMember] public virtual string BirthSexDescriptor { get @@ -117743,6 +136087,7 @@ public virtual string BirthSexDescriptor _birthSexDescriptorId = default(int?); } } + [Key(12)] public virtual int? BirthStateAbbreviationDescriptorId { get @@ -117762,6 +136107,7 @@ public virtual int? BirthStateAbbreviationDescriptorId private int? _birthStateAbbreviationDescriptorId; private string _birthStateAbbreviationDescriptor; + [IgnoreMember] public virtual string BirthStateAbbreviationDescriptor { get @@ -117777,6 +136123,7 @@ public virtual string BirthStateAbbreviationDescriptor _birthStateAbbreviationDescriptorId = default(int?); } } + [Key(13)] public virtual int? CitizenshipStatusDescriptorId { get @@ -117796,6 +136143,7 @@ public virtual int? CitizenshipStatusDescriptorId private int? _citizenshipStatusDescriptorId; private string _citizenshipStatusDescriptor; + [IgnoreMember] public virtual string CitizenshipStatusDescriptor { get @@ -117811,6 +136159,7 @@ public virtual string CitizenshipStatusDescriptor _citizenshipStatusDescriptorId = default(int?); } } + [Key(14)] public virtual DateTime? DateEnteredUS { get { return _dateEnteredUS; } @@ -117830,16 +136179,27 @@ public virtual DateTime? DateEnteredUS private DateTime? _dateEnteredUS; + [Key(15)] public virtual string FirstName { get; set; } + [Key(16)] public virtual string GenerationCodeSuffix { get; set; } + [Key(17)] public virtual string LastSurname { get; set; } + [Key(18)] public virtual string MaidenName { get; set; } + [Key(19)] public virtual string MiddleName { get; set; } + [Key(20)] public virtual bool? MultipleBirthStatus { get; set; } + [Key(21)] public virtual string PersonalTitlePrefix { get; set; } + [Key(22)] public virtual string PersonId { get; set; } + [Key(23)] public virtual string PreferredFirstName { get; set; } + [Key(24)] public virtual string PreferredLastSurname { get; set; } + [Key(25)] public virtual int? SourceSystemDescriptorId { get @@ -117859,6 +136219,7 @@ public virtual int? SourceSystemDescriptorId private int? _sourceSystemDescriptorId; private string _sourceSystemDescriptor; + [IgnoreMember] public virtual string SourceSystemDescriptor { get @@ -117874,6 +136235,7 @@ public virtual string SourceSystemDescriptor _sourceSystemDescriptorId = default(int?); } } + [Key(26)] public virtual string StudentUniqueId { get @@ -117908,14 +136270,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Student", "Student")] + [Key(27)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -117934,12 +136309,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Student", "Student")] + [Key(28)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(29)] public virtual NHibernate.PersonAggregate.EdFi.PersonReferenceData PersonReferenceData { get; set; } /// @@ -117968,6 +136384,8 @@ string Entities.Common.EdFi.IStudent.PersonDiscriminator private ICollection _studentIdentificationDocuments; private ICollection _studentIdentificationDocumentsCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentIdentificationDocuments { get @@ -117977,6 +136395,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentIdentificationDocuments"); + } + foreach (var item in _studentIdentificationDocuments) if (item.Student == null) item.Student = this; @@ -118015,6 +136438,8 @@ public virtual ICollection _studentOtherNames; private ICollection _studentOtherNamesCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentOtherNames { get @@ -118024,6 +136449,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentOtherNames"); + } + foreach (var item in _studentOtherNames) if (item.Student == null) item.Student = this; @@ -118062,6 +136492,8 @@ public virtual ICollection _studentPersonalIdentificationDocuments; private ICollection _studentPersonalIdentificationDocumentsCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentPersonalIdentificationDocuments { get @@ -118071,6 +136503,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentPersonalIdentificationDocuments"); + } + foreach (var item in _studentPersonalIdentificationDocuments) if (item.Student == null) item.Student = this; @@ -118109,6 +136546,8 @@ public virtual ICollection _studentVisas; private ICollection _studentVisasCovariant; + [Key(33)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentVisas { get @@ -118118,6 +136557,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentVisas"); + } + foreach (var item in _studentVisas) if (item.Student == null) item.Student = this; @@ -118258,6 +136702,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentIdentificationDocument : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -118265,8 +136710,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentIdentificationDocument() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -118274,7 +136719,7 @@ public StudentIdentificationDocument() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Student Student { get; set; } Entities.Common.EdFi.IStudent IStudentIdentificationDocument.Student @@ -118284,6 +136729,7 @@ Entities.Common.EdFi.IStudent IStudentIdentificationDocument.Student } [DomainSignature] + [Key(1)] public virtual int IdentificationDocumentUseDescriptorId { get @@ -118303,6 +136749,7 @@ public virtual int IdentificationDocumentUseDescriptorId private int _identificationDocumentUseDescriptorId; private string _identificationDocumentUseDescriptor; + [IgnoreMember] public virtual string IdentificationDocumentUseDescriptor { get @@ -118319,6 +136766,7 @@ public virtual string IdentificationDocumentUseDescriptor } } [DomainSignature] + [Key(2)] public virtual int PersonalInformationVerificationDescriptorId { get @@ -118338,6 +136786,7 @@ public virtual int PersonalInformationVerificationDescriptorId private int _personalInformationVerificationDescriptorId; private string _personalInformationVerificationDescriptor; + [IgnoreMember] public virtual string PersonalInformationVerificationDescriptor { get @@ -118363,6 +136812,7 @@ public virtual string PersonalInformationVerificationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual DateTime? DocumentExpirationDate { get { return _documentExpirationDate; } @@ -118382,7 +136832,9 @@ public virtual DateTime? DocumentExpirationDate private DateTime? _documentExpirationDate; + [Key(4)] public virtual string DocumentTitle { get; set; } + [Key(5)] public virtual int? IssuerCountryDescriptorId { get @@ -118402,6 +136854,7 @@ public virtual int? IssuerCountryDescriptorId private int? _issuerCountryDescriptorId; private string _issuerCountryDescriptor; + [IgnoreMember] public virtual string IssuerCountryDescriptor { get @@ -118417,7 +136870,9 @@ public virtual string IssuerCountryDescriptor _issuerCountryDescriptorId = default(int?); } } + [Key(6)] public virtual string IssuerDocumentIdentificationCode { get; set; } + [Key(7)] public virtual string IssuerName { get; set; } // ------------------------------------------------------------- @@ -118431,14 +136886,27 @@ public virtual string IssuerCountryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Student", "StudentIdentificationDocument")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -118457,7 +136925,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Student", "StudentIdentificationDocument")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -118487,7 +136995,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Student as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); @@ -118576,6 +137084,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentOtherName : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentOtherName, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -118583,8 +137092,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentOtherName() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -118592,7 +137101,7 @@ public StudentOtherName() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Student Student { get; set; } Entities.Common.EdFi.IStudent IStudentOtherName.Student @@ -118602,6 +137111,7 @@ Entities.Common.EdFi.IStudent IStudentOtherName.Student } [DomainSignature] + [Key(1)] public virtual int OtherNameTypeDescriptorId { get @@ -118621,6 +137131,7 @@ public virtual int OtherNameTypeDescriptorId private int _otherNameTypeDescriptorId; private string _otherNameTypeDescriptor; + [IgnoreMember] public virtual string OtherNameTypeDescriptor { get @@ -118646,10 +137157,15 @@ public virtual string OtherNameTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string FirstName { get; set; } + [Key(3)] public virtual string GenerationCodeSuffix { get; set; } + [Key(4)] public virtual string LastSurname { get; set; } + [Key(5)] public virtual string MiddleName { get; set; } + [Key(6)] public virtual string PersonalTitlePrefix { get; set; } // ------------------------------------------------------------- @@ -118663,14 +137179,27 @@ public virtual string OtherNameTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Student", "StudentOtherName")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -118689,7 +137218,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Student", "StudentOtherName")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -118717,7 +137286,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Student as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("OtherNameTypeDescriptorId", OtherNameTypeDescriptorId); @@ -118805,6 +137374,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentPersonalIdentificationDocument : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentPersonalIdentificationDocument, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -118812,8 +137382,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentPersonalIdentificationDocument() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -118821,7 +137391,7 @@ public StudentPersonalIdentificationDocument() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Student Student { get; set; } Entities.Common.EdFi.IStudent IStudentPersonalIdentificationDocument.Student @@ -118831,6 +137401,7 @@ Entities.Common.EdFi.IStudent IStudentPersonalIdentificationDocument.Student } [DomainSignature] + [Key(1)] public virtual int IdentificationDocumentUseDescriptorId { get @@ -118850,6 +137421,7 @@ public virtual int IdentificationDocumentUseDescriptorId private int _identificationDocumentUseDescriptorId; private string _identificationDocumentUseDescriptor; + [IgnoreMember] public virtual string IdentificationDocumentUseDescriptor { get @@ -118866,6 +137438,7 @@ public virtual string IdentificationDocumentUseDescriptor } } [DomainSignature] + [Key(2)] public virtual int PersonalInformationVerificationDescriptorId { get @@ -118885,6 +137458,7 @@ public virtual int PersonalInformationVerificationDescriptorId private int _personalInformationVerificationDescriptorId; private string _personalInformationVerificationDescriptor; + [IgnoreMember] public virtual string PersonalInformationVerificationDescriptor { get @@ -118910,6 +137484,7 @@ public virtual string PersonalInformationVerificationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual DateTime? DocumentExpirationDate { get { return _documentExpirationDate; } @@ -118929,7 +137504,9 @@ public virtual DateTime? DocumentExpirationDate private DateTime? _documentExpirationDate; + [Key(4)] public virtual string DocumentTitle { get; set; } + [Key(5)] public virtual int? IssuerCountryDescriptorId { get @@ -118949,6 +137526,7 @@ public virtual int? IssuerCountryDescriptorId private int? _issuerCountryDescriptorId; private string _issuerCountryDescriptor; + [IgnoreMember] public virtual string IssuerCountryDescriptor { get @@ -118964,7 +137542,9 @@ public virtual string IssuerCountryDescriptor _issuerCountryDescriptorId = default(int?); } } + [Key(6)] public virtual string IssuerDocumentIdentificationCode { get; set; } + [Key(7)] public virtual string IssuerName { get; set; } // ------------------------------------------------------------- @@ -118978,14 +137558,27 @@ public virtual string IssuerCountryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Student", "StudentPersonalIdentificationDocument")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -119004,7 +137597,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Student", "StudentPersonalIdentificationDocument")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -119034,7 +137667,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Student as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("IdentificationDocumentUseDescriptorId", IdentificationDocumentUseDescriptorId); @@ -119123,6 +137756,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentVisa : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentVisa, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -119130,8 +137764,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentVisa() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -119139,7 +137773,7 @@ public StudentVisa() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual Student Student { get; set; } Entities.Common.EdFi.IStudent IStudentVisa.Student @@ -119149,6 +137783,7 @@ Entities.Common.EdFi.IStudent IStudentVisa.Student } [DomainSignature] + [Key(1)] public virtual int VisaDescriptorId { get @@ -119168,6 +137803,7 @@ public virtual int VisaDescriptorId private int _visaDescriptorId; private string _visaDescriptor; + [IgnoreMember] public virtual string VisaDescriptor { get @@ -119205,14 +137841,27 @@ public virtual string VisaDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Student", "StudentVisa")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -119231,7 +137880,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Student", "StudentVisa")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -119259,7 +137948,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (Student as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (Student as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("VisaDescriptorId", VisaDescriptorId); @@ -119347,26 +138036,33 @@ namespace EdFi.Ods.Entities.NHibernate.StudentAcademicRecordAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentAcademicRecordReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual short SchoolYear { get; set; } + [Key(2)] public virtual int StudentUSI { get; set; } + [Key(3)] public virtual int TermDescriptorId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -119434,6 +138130,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAcademicRecord : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentAcademicRecord, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -119447,8 +138144,8 @@ public StudentAcademicRecord() StudentAcademicRecordGradePointAverages = new HashSet(); StudentAcademicRecordRecognitions = new HashSet(); StudentAcademicRecordReportCards = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -119457,10 +138154,13 @@ public StudentAcademicRecord() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual short SchoolYear { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] public virtual int StudentUSI { get @@ -119486,6 +138186,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -119510,6 +138211,7 @@ public virtual string StudentUniqueId } } [DomainSignature] + [Key(9)] public virtual int TermDescriptorId { get @@ -119529,6 +138231,7 @@ public virtual int TermDescriptorId private int _termDescriptorId; private string _termDescriptor; + [IgnoreMember] public virtual string TermDescriptor { get @@ -119554,8 +138257,11 @@ public virtual string TermDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual decimal? CumulativeAttemptedCreditConversion { get; set; } + [Key(11)] public virtual decimal? CumulativeAttemptedCredits { get; set; } + [Key(12)] public virtual int? CumulativeAttemptedCreditTypeDescriptorId { get @@ -119575,6 +138281,7 @@ public virtual int? CumulativeAttemptedCreditTypeDescriptorId private int? _cumulativeAttemptedCreditTypeDescriptorId; private string _cumulativeAttemptedCreditTypeDescriptor; + [IgnoreMember] public virtual string CumulativeAttemptedCreditTypeDescriptor { get @@ -119590,8 +138297,11 @@ public virtual string CumulativeAttemptedCreditTypeDescriptor _cumulativeAttemptedCreditTypeDescriptorId = default(int?); } } + [Key(13)] public virtual decimal? CumulativeEarnedCreditConversion { get; set; } + [Key(14)] public virtual decimal? CumulativeEarnedCredits { get; set; } + [Key(15)] public virtual int? CumulativeEarnedCreditTypeDescriptorId { get @@ -119611,6 +138321,7 @@ public virtual int? CumulativeEarnedCreditTypeDescriptorId private int? _cumulativeEarnedCreditTypeDescriptorId; private string _cumulativeEarnedCreditTypeDescriptor; + [IgnoreMember] public virtual string CumulativeEarnedCreditTypeDescriptor { get @@ -119626,6 +138337,7 @@ public virtual string CumulativeEarnedCreditTypeDescriptor _cumulativeEarnedCreditTypeDescriptorId = default(int?); } } + [Key(16)] public virtual DateTime? ProjectedGraduationDate { get { return _projectedGraduationDate; } @@ -119645,8 +138357,11 @@ public virtual DateTime? ProjectedGraduationDate private DateTime? _projectedGraduationDate; + [Key(17)] public virtual decimal? SessionAttemptedCreditConversion { get; set; } + [Key(18)] public virtual decimal? SessionAttemptedCredits { get; set; } + [Key(19)] public virtual int? SessionAttemptedCreditTypeDescriptorId { get @@ -119666,6 +138381,7 @@ public virtual int? SessionAttemptedCreditTypeDescriptorId private int? _sessionAttemptedCreditTypeDescriptorId; private string _sessionAttemptedCreditTypeDescriptor; + [IgnoreMember] public virtual string SessionAttemptedCreditTypeDescriptor { get @@ -119681,8 +138397,11 @@ public virtual string SessionAttemptedCreditTypeDescriptor _sessionAttemptedCreditTypeDescriptorId = default(int?); } } + [Key(20)] public virtual decimal? SessionEarnedCreditConversion { get; set; } + [Key(21)] public virtual decimal? SessionEarnedCredits { get; set; } + [Key(22)] public virtual int? SessionEarnedCreditTypeDescriptorId { get @@ -119702,6 +138421,7 @@ public virtual int? SessionEarnedCreditTypeDescriptorId private int? _sessionEarnedCreditTypeDescriptorId; private string _sessionEarnedCreditTypeDescriptor; + [IgnoreMember] public virtual string SessionEarnedCreditTypeDescriptor { get @@ -119722,6 +138442,7 @@ public virtual string SessionEarnedCreditTypeDescriptor // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + [IgnoreMember] public virtual Entities.NHibernate.StudentAcademicRecordAggregate.EdFi.StudentAcademicRecordClassRanking StudentAcademicRecordClassRanking { get @@ -119758,6 +138479,8 @@ Entities.Common.EdFi.IStudentAcademicRecordClassRanking Entities.Common.EdFi.ISt private ICollection _studentAcademicRecordClassRankingPersistentList; + [Key(23)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAcademicRecordClassRankingPersistentList { get @@ -119767,6 +138490,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAcademicRecordClassRanking"); + } + foreach (var item in _studentAcademicRecordClassRankingPersistentList) if (item.StudentAcademicRecord == null) item.StudentAcademicRecord = this; @@ -119787,14 +138515,27 @@ public virtual ICollection _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -119813,12 +138554,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecord")] + [Key(25)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(26)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -119839,6 +138621,7 @@ string Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationDiscrimi set { } } + [Key(27)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -119850,6 +138633,7 @@ string Entities.Common.EdFi.IStudentAcademicRecord.EducationOrganizationDiscrimi set { } } + [Key(28)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -119878,6 +138662,8 @@ string Entities.Common.EdFi.IStudentAcademicRecord.StudentDiscriminator private ICollection _studentAcademicRecordAcademicHonors; private ICollection _studentAcademicRecordAcademicHonorsCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAcademicRecordAcademicHonors { get @@ -119887,6 +138673,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAcademicRecordAcademicHonors"); + } + foreach (var item in _studentAcademicRecordAcademicHonors) if (item.StudentAcademicRecord == null) item.StudentAcademicRecord = this; @@ -119925,6 +138716,8 @@ public virtual ICollection _studentAcademicRecordDiplomas; private ICollection _studentAcademicRecordDiplomasCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAcademicRecordDiplomas { get @@ -119934,6 +138727,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAcademicRecordDiplomas"); + } + foreach (var item in _studentAcademicRecordDiplomas) if (item.StudentAcademicRecord == null) item.StudentAcademicRecord = this; @@ -119972,6 +138770,8 @@ public virtual ICollection _studentAcademicRecordGradePointAverages; private ICollection _studentAcademicRecordGradePointAveragesCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAcademicRecordGradePointAverages { get @@ -119981,6 +138781,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAcademicRecordGradePointAverages"); + } + foreach (var item in _studentAcademicRecordGradePointAverages) if (item.StudentAcademicRecord == null) item.StudentAcademicRecord = this; @@ -120019,6 +138824,8 @@ public virtual ICollection _studentAcademicRecordRecognitions; private ICollection _studentAcademicRecordRecognitionsCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAcademicRecordRecognitions { get @@ -120028,6 +138835,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAcademicRecordRecognitions"); + } + foreach (var item in _studentAcademicRecordRecognitions) if (item.StudentAcademicRecord == null) item.StudentAcademicRecord = this; @@ -120066,6 +138878,8 @@ public virtual ICollection _studentAcademicRecordReportCards; private ICollection _studentAcademicRecordReportCardsCovariant; + [Key(33)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAcademicRecordReportCards { get @@ -120075,6 +138889,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAcademicRecordReportCards"); + } + foreach (var item in _studentAcademicRecordReportCards) if (item.StudentAcademicRecord == null) item.StudentAcademicRecord = this; @@ -120218,6 +139037,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAcademicRecordAcademicHonor : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAcademicRecordAcademicHonor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -120225,8 +139045,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAcademicRecordAcademicHonor() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -120234,7 +139054,7 @@ public StudentAcademicRecordAcademicHonor() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordAcademicHonor.StudentAcademicRecord @@ -120244,6 +139064,7 @@ Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordAcademicHonor. } [DomainSignature] + [Key(1)] public virtual int AcademicHonorCategoryDescriptorId { get @@ -120263,6 +139084,7 @@ public virtual int AcademicHonorCategoryDescriptorId private int _academicHonorCategoryDescriptorId; private string _academicHonorCategoryDescriptor; + [IgnoreMember] public virtual string AcademicHonorCategoryDescriptor { get @@ -120279,6 +139101,7 @@ public virtual string AcademicHonorCategoryDescriptor } } [DomainSignature] + [Key(2)] public virtual string HonorDescription { get; set; } // ------------------------------------------------------------- @@ -120290,6 +139113,7 @@ public virtual string AcademicHonorCategoryDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual int? AchievementCategoryDescriptorId { get @@ -120309,6 +139133,7 @@ public virtual int? AchievementCategoryDescriptorId private int? _achievementCategoryDescriptorId; private string _achievementCategoryDescriptor; + [IgnoreMember] public virtual string AchievementCategoryDescriptor { get @@ -120324,11 +139149,17 @@ public virtual string AchievementCategoryDescriptor _achievementCategoryDescriptorId = default(int?); } } + [Key(4)] public virtual string AchievementCategorySystem { get; set; } + [Key(5)] public virtual string AchievementTitle { get; set; } + [Key(6)] public virtual string Criteria { get; set; } + [Key(7)] public virtual string CriteriaURL { get; set; } + [Key(8)] public virtual string EvidenceStatement { get; set; } + [Key(9)] public virtual DateTime? HonorAwardDate { get { return _honorAwardDate; } @@ -120348,6 +139179,7 @@ public virtual DateTime? HonorAwardDate private DateTime? _honorAwardDate; + [Key(10)] public virtual DateTime? HonorAwardExpiresDate { get { return _honorAwardExpiresDate; } @@ -120367,8 +139199,11 @@ public virtual DateTime? HonorAwardExpiresDate private DateTime? _honorAwardExpiresDate; + [Key(11)] public virtual string ImageURL { get; set; } + [Key(12)] public virtual string IssuerName { get; set; } + [Key(13)] public virtual string IssuerOriginURL { get; set; } // ------------------------------------------------------------- @@ -120382,14 +139217,27 @@ public virtual DateTime? HonorAwardExpiresDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordAcademicHonor")] + [Key(14)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -120408,7 +139256,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordAcademicHonor")] + [Key(15)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -120438,7 +139326,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AcademicHonorCategoryDescriptorId", AcademicHonorCategoryDescriptorId); @@ -120527,6 +139415,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAcademicRecordClassRanking : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAcademicRecordClassRanking, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -120534,8 +139423,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAcademicRecordClassRanking() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -120543,7 +139432,7 @@ public StudentAcademicRecordClassRanking() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordClassRanking.StudentAcademicRecord @@ -120562,7 +139451,9 @@ Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordClassRanking.S // ============================================================= // Properties // ------------------------------------------------------------- + [Key(1)] public virtual int ClassRank { get; set; } + [Key(2)] public virtual DateTime? ClassRankingDate { get { return _classRankingDate; } @@ -120582,7 +139473,9 @@ public virtual DateTime? ClassRankingDate private DateTime? _classRankingDate; + [Key(3)] public virtual int? PercentageRanking { get; set; } + [Key(4)] public virtual int TotalNumberInClass { get; set; } // ------------------------------------------------------------- @@ -120596,14 +139489,27 @@ public virtual DateTime? ClassRankingDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordClassRanking")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -120622,7 +139528,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordClassRanking")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -120650,7 +139596,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values @@ -120737,6 +139683,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAcademicRecordDiploma : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAcademicRecordDiploma, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -120744,8 +139691,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAcademicRecordDiploma() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -120753,7 +139700,7 @@ public StudentAcademicRecordDiploma() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordDiploma.StudentAcademicRecord @@ -120763,6 +139710,7 @@ Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordDiploma.Studen } [DomainSignature] + [Key(1)] public virtual DateTime DiplomaAwardDate { get { return _diplomaAwardDate; } @@ -120773,6 +139721,7 @@ public virtual DateTime DiplomaAwardDate private DateTime _diplomaAwardDate; [DomainSignature] + [Key(2)] public virtual int DiplomaTypeDescriptorId { get @@ -120792,6 +139741,7 @@ public virtual int DiplomaTypeDescriptorId private int _diplomaTypeDescriptorId; private string _diplomaTypeDescriptor; + [IgnoreMember] public virtual string DiplomaTypeDescriptor { get @@ -120817,6 +139767,7 @@ public virtual string DiplomaTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual int? AchievementCategoryDescriptorId { get @@ -120836,6 +139787,7 @@ public virtual int? AchievementCategoryDescriptorId private int? _achievementCategoryDescriptorId; private string _achievementCategoryDescriptor; + [IgnoreMember] public virtual string AchievementCategoryDescriptor { get @@ -120851,11 +139803,17 @@ public virtual string AchievementCategoryDescriptor _achievementCategoryDescriptorId = default(int?); } } + [Key(4)] public virtual string AchievementCategorySystem { get; set; } + [Key(5)] public virtual string AchievementTitle { get; set; } + [Key(6)] public virtual string Criteria { get; set; } + [Key(7)] public virtual string CriteriaURL { get; set; } + [Key(8)] public virtual bool? CTECompleter { get; set; } + [Key(9)] public virtual DateTime? DiplomaAwardExpiresDate { get { return _diplomaAwardExpiresDate; } @@ -120875,7 +139833,9 @@ public virtual DateTime? DiplomaAwardExpiresDate private DateTime? _diplomaAwardExpiresDate; + [Key(10)] public virtual string DiplomaDescription { get; set; } + [Key(11)] public virtual int? DiplomaLevelDescriptorId { get @@ -120895,6 +139855,7 @@ public virtual int? DiplomaLevelDescriptorId private int? _diplomaLevelDescriptorId; private string _diplomaLevelDescriptor; + [IgnoreMember] public virtual string DiplomaLevelDescriptor { get @@ -120910,9 +139871,13 @@ public virtual string DiplomaLevelDescriptor _diplomaLevelDescriptorId = default(int?); } } + [Key(12)] public virtual string EvidenceStatement { get; set; } + [Key(13)] public virtual string ImageURL { get; set; } + [Key(14)] public virtual string IssuerName { get; set; } + [Key(15)] public virtual string IssuerOriginURL { get; set; } // ------------------------------------------------------------- @@ -120926,14 +139891,27 @@ public virtual string DiplomaLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordDiploma")] + [Key(16)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -120952,7 +139930,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordDiploma")] + [Key(17)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -120983,7 +140001,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DiplomaAwardDate", DiplomaAwardDate); @@ -121072,6 +140090,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAcademicRecordGradePointAverage : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAcademicRecordGradePointAverage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -121079,8 +140098,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAcademicRecordGradePointAverage() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121088,7 +140107,7 @@ public StudentAcademicRecordGradePointAverage() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordGradePointAverage.StudentAcademicRecord @@ -121098,6 +140117,7 @@ Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordGradePointAver } [DomainSignature] + [Key(1)] public virtual int GradePointAverageTypeDescriptorId { get @@ -121117,6 +140137,7 @@ public virtual int GradePointAverageTypeDescriptorId private int _gradePointAverageTypeDescriptorId; private string _gradePointAverageTypeDescriptor; + [IgnoreMember] public virtual string GradePointAverageTypeDescriptor { get @@ -121142,8 +140163,11 @@ public virtual string GradePointAverageTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal GradePointAverageValue { get; set; } + [Key(3)] public virtual bool? IsCumulative { get; set; } + [Key(4)] public virtual decimal? MaxGradePointAverageValue { get; set; } // ------------------------------------------------------------- @@ -121157,14 +140181,27 @@ public virtual string GradePointAverageTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordGradePointAverage")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -121183,7 +140220,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordGradePointAverage")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -121212,7 +140289,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradePointAverageTypeDescriptorId", GradePointAverageTypeDescriptorId); @@ -121300,6 +140377,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAcademicRecordRecognition : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAcademicRecordRecognition, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -121307,8 +140385,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAcademicRecordRecognition() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121316,7 +140394,7 @@ public StudentAcademicRecordRecognition() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordRecognition.StudentAcademicRecord @@ -121326,6 +140404,7 @@ Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordRecognition.St } [DomainSignature] + [Key(1)] public virtual int RecognitionTypeDescriptorId { get @@ -121345,6 +140424,7 @@ public virtual int RecognitionTypeDescriptorId private int _recognitionTypeDescriptorId; private string _recognitionTypeDescriptor; + [IgnoreMember] public virtual string RecognitionTypeDescriptor { get @@ -121370,6 +140450,7 @@ public virtual string RecognitionTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? AchievementCategoryDescriptorId { get @@ -121389,6 +140470,7 @@ public virtual int? AchievementCategoryDescriptorId private int? _achievementCategoryDescriptorId; private string _achievementCategoryDescriptor; + [IgnoreMember] public virtual string AchievementCategoryDescriptor { get @@ -121404,14 +140486,23 @@ public virtual string AchievementCategoryDescriptor _achievementCategoryDescriptorId = default(int?); } } + [Key(3)] public virtual string AchievementCategorySystem { get; set; } + [Key(4)] public virtual string AchievementTitle { get; set; } + [Key(5)] public virtual string Criteria { get; set; } + [Key(6)] public virtual string CriteriaURL { get; set; } + [Key(7)] public virtual string EvidenceStatement { get; set; } + [Key(8)] public virtual string ImageURL { get; set; } + [Key(9)] public virtual string IssuerName { get; set; } + [Key(10)] public virtual string IssuerOriginURL { get; set; } + [Key(11)] public virtual DateTime? RecognitionAwardDate { get { return _recognitionAwardDate; } @@ -121431,6 +140522,7 @@ public virtual DateTime? RecognitionAwardDate private DateTime? _recognitionAwardDate; + [Key(12)] public virtual DateTime? RecognitionAwardExpiresDate { get { return _recognitionAwardExpiresDate; } @@ -121450,6 +140542,7 @@ public virtual DateTime? RecognitionAwardExpiresDate private DateTime? _recognitionAwardExpiresDate; + [Key(13)] public virtual string RecognitionDescription { get; set; } // ------------------------------------------------------------- @@ -121463,14 +140556,27 @@ public virtual DateTime? RecognitionAwardExpiresDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordRecognition")] + [Key(14)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -121489,7 +140595,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordRecognition")] + [Key(15)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -121519,7 +140665,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RecognitionTypeDescriptorId", RecognitionTypeDescriptorId); @@ -121607,6 +140753,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAcademicRecordReportCard : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAcademicRecordReportCard, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -121614,8 +140761,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAcademicRecordReportCard() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121623,7 +140770,7 @@ public StudentAcademicRecordReportCard() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAcademicRecord StudentAcademicRecord { get; set; } Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordReportCard.StudentAcademicRecord @@ -121633,6 +140780,7 @@ Entities.Common.EdFi.IStudentAcademicRecord IStudentAcademicRecordReportCard.Stu } [DomainSignature] + [Key(1)] public virtual int GradingPeriodDescriptorId { get @@ -121652,6 +140800,7 @@ public virtual int GradingPeriodDescriptorId private int _gradingPeriodDescriptorId; private string _gradingPeriodDescriptor; + [IgnoreMember] public virtual string GradingPeriodDescriptor { get @@ -121668,10 +140817,13 @@ public virtual string GradingPeriodDescriptor } } [DomainSignature] + [Key(2)] public virtual string GradingPeriodName { get; set; } [DomainSignature] + [Key(3)] public virtual long GradingPeriodSchoolId { get; set; } [DomainSignature] + [Key(4)] public virtual short GradingPeriodSchoolYear { get; set; } // ------------------------------------------------------------- @@ -121695,14 +140847,27 @@ public virtual string GradingPeriodDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordReportCard")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -121721,12 +140886,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAcademicRecord", "StudentAcademicRecordReportCard")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(7)] public virtual NHibernate.ReportCardAggregate.EdFi.ReportCardReferenceData ReportCardReferenceData { get; set; } /// @@ -121770,7 +140976,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAcademicRecord as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("GradingPeriodDescriptorId", GradingPeriodDescriptorId); @@ -121861,26 +141067,33 @@ namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentAssessmentReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AssessmentIdentifier { get; set; } + [Key(1)] public virtual string Namespace { get; set; } + [Key(2)] public virtual string StudentAssessmentIdentifier { get; set; } + [Key(3)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -121948,6 +141161,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessment : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -121961,8 +141175,8 @@ public StudentAssessment() StudentAssessmentPerformanceLevels = new HashSet(); StudentAssessmentScoreResults = new HashSet(); StudentAssessmentStudentObjectiveAssessments = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -121971,12 +141185,16 @@ public StudentAssessment() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(8)] public virtual string StudentAssessmentIdentifier { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(9)] public virtual int StudentUSI { get @@ -122002,6 +141220,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -122035,6 +141254,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual DateTime? AdministrationDate { get { return _administrationDate; } @@ -122053,6 +141273,7 @@ public virtual DateTime? AdministrationDate private DateTime? _administrationDate; + [Key(11)] public virtual DateTime? AdministrationEndDate { get { return _administrationEndDate; } @@ -122071,6 +141292,7 @@ public virtual DateTime? AdministrationEndDate private DateTime? _administrationEndDate; + [Key(12)] public virtual int? AdministrationEnvironmentDescriptorId { get @@ -122090,6 +141312,7 @@ public virtual int? AdministrationEnvironmentDescriptorId private int? _administrationEnvironmentDescriptorId; private string _administrationEnvironmentDescriptor; + [IgnoreMember] public virtual string AdministrationEnvironmentDescriptor { get @@ -122105,6 +141328,7 @@ public virtual string AdministrationEnvironmentDescriptor _administrationEnvironmentDescriptorId = default(int?); } } + [Key(13)] public virtual int? AdministrationLanguageDescriptorId { get @@ -122124,6 +141348,7 @@ public virtual int? AdministrationLanguageDescriptorId private int? _administrationLanguageDescriptorId; private string _administrationLanguageDescriptor; + [IgnoreMember] public virtual string AdministrationLanguageDescriptor { get @@ -122139,7 +141364,9 @@ public virtual string AdministrationLanguageDescriptor _administrationLanguageDescriptorId = default(int?); } } + [Key(14)] public virtual int? AssessedMinutes { get; set; } + [Key(15)] public virtual int? EventCircumstanceDescriptorId { get @@ -122159,6 +141386,7 @@ public virtual int? EventCircumstanceDescriptorId private int? _eventCircumstanceDescriptorId; private string _eventCircumstanceDescriptor; + [IgnoreMember] public virtual string EventCircumstanceDescriptor { get @@ -122174,7 +141402,9 @@ public virtual string EventCircumstanceDescriptor _eventCircumstanceDescriptorId = default(int?); } } + [Key(16)] public virtual string EventDescription { get; set; } + [Key(17)] public virtual int? PlatformTypeDescriptorId { get @@ -122194,6 +141424,7 @@ public virtual int? PlatformTypeDescriptorId private int? _platformTypeDescriptorId; private string _platformTypeDescriptor; + [IgnoreMember] public virtual string PlatformTypeDescriptor { get @@ -122209,6 +141440,7 @@ public virtual string PlatformTypeDescriptor _platformTypeDescriptorId = default(int?); } } + [Key(18)] public virtual int? ReasonNotTestedDescriptorId { get @@ -122228,6 +141460,7 @@ public virtual int? ReasonNotTestedDescriptorId private int? _reasonNotTestedDescriptorId; private string _reasonNotTestedDescriptor; + [IgnoreMember] public virtual string ReasonNotTestedDescriptor { get @@ -122243,8 +141476,11 @@ public virtual string ReasonNotTestedDescriptor _reasonNotTestedDescriptorId = default(int?); } } + [Key(19)] public virtual long? ReportedSchoolId { get; set; } + [Key(20)] public virtual string ReportedSchoolIdentifier { get; set; } + [Key(21)] public virtual int? RetestIndicatorDescriptorId { get @@ -122264,6 +141500,7 @@ public virtual int? RetestIndicatorDescriptorId private int? _retestIndicatorDescriptorId; private string _retestIndicatorDescriptor; + [IgnoreMember] public virtual string RetestIndicatorDescriptor { get @@ -122279,8 +141516,11 @@ public virtual string RetestIndicatorDescriptor _retestIndicatorDescriptorId = default(int?); } } + [Key(22)] public virtual short? SchoolYear { get; set; } + [Key(23)] public virtual string SerialNumber { get; set; } + [Key(24)] public virtual int? WhenAssessedGradeLevelDescriptorId { get @@ -122300,6 +141540,7 @@ public virtual int? WhenAssessedGradeLevelDescriptorId private int? _whenAssessedGradeLevelDescriptorId; private string _whenAssessedGradeLevelDescriptor; + [IgnoreMember] public virtual string WhenAssessedGradeLevelDescriptor { get @@ -122320,6 +141561,7 @@ public virtual string WhenAssessedGradeLevelDescriptor // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + [IgnoreMember] public virtual Entities.NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentPeriod StudentAssessmentPeriod { get @@ -122356,6 +141598,8 @@ Entities.Common.EdFi.IStudentAssessmentPeriod Entities.Common.EdFi.IStudentAsses private ICollection _studentAssessmentPeriodPersistentList; + [Key(25)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentPeriodPersistentList { get @@ -122365,6 +141609,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentPeriod"); + } + foreach (var item in _studentAssessmentPeriodPersistentList) if (item.StudentAssessment == null) item.StudentAssessment = this; @@ -122385,14 +141634,27 @@ public virtual ICollection _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -122411,12 +141673,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessment")] + [Key(27)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(28)] public virtual NHibernate.AssessmentAggregate.EdFi.AssessmentReferenceData AssessmentReferenceData { get; set; } /// @@ -122437,6 +141740,7 @@ string Entities.Common.EdFi.IStudentAssessment.AssessmentDiscriminator set { } } + [Key(29)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ReportedSchoolReferenceData { get; set; } /// @@ -122448,6 +141752,7 @@ string Entities.Common.EdFi.IStudentAssessment.AssessmentDiscriminator set { } } + [Key(30)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -122459,6 +141764,7 @@ string Entities.Common.EdFi.IStudentAssessment.AssessmentDiscriminator set { } } + [Key(31)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -122487,6 +141793,8 @@ string Entities.Common.EdFi.IStudentAssessment.StudentDiscriminator private ICollection _studentAssessmentAccommodations; private ICollection _studentAssessmentAccommodationsCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentAccommodations { get @@ -122496,6 +141804,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentAccommodations"); + } + foreach (var item in _studentAssessmentAccommodations) if (item.StudentAssessment == null) item.StudentAssessment = this; @@ -122534,6 +141847,8 @@ public virtual ICollection _studentAssessmentItems; private ICollection _studentAssessmentItemsCovariant; + [Key(33)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentItems { get @@ -122543,6 +141858,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentItems"); + } + foreach (var item in _studentAssessmentItems) if (item.StudentAssessment == null) item.StudentAssessment = this; @@ -122581,6 +141901,8 @@ public virtual ICollection _studentAssessmentPerformanceLevels; private ICollection _studentAssessmentPerformanceLevelsCovariant; + [Key(34)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentPerformanceLevels { get @@ -122590,6 +141912,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentPerformanceLevels"); + } + foreach (var item in _studentAssessmentPerformanceLevels) if (item.StudentAssessment == null) item.StudentAssessment = this; @@ -122628,6 +141955,8 @@ public virtual ICollection _studentAssessmentScoreResults; private ICollection _studentAssessmentScoreResultsCovariant; + [Key(35)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentScoreResults { get @@ -122637,6 +141966,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentScoreResults"); + } + foreach (var item in _studentAssessmentScoreResults) if (item.StudentAssessment == null) item.StudentAssessment = this; @@ -122675,6 +142009,8 @@ public virtual ICollection _studentAssessmentStudentObjectiveAssessments; private ICollection _studentAssessmentStudentObjectiveAssessmentsCovariant; + [Key(36)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentStudentObjectiveAssessments { get @@ -122684,6 +142020,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentStudentObjectiveAssessments"); + } + foreach (var item in _studentAssessmentStudentObjectiveAssessments) if (item.StudentAssessment == null) item.StudentAssessment = this; @@ -122829,6 +142170,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentAccommodation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -122836,8 +142178,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentAccommodation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -122845,7 +142187,7 @@ public StudentAssessmentAccommodation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessment StudentAssessment { get; set; } Entities.Common.EdFi.IStudentAssessment IStudentAssessmentAccommodation.StudentAssessment @@ -122855,6 +142197,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentAccommodation.StudentA } [DomainSignature] + [Key(1)] public virtual int AccommodationDescriptorId { get @@ -122874,6 +142217,7 @@ public virtual int AccommodationDescriptorId private int _accommodationDescriptorId; private string _accommodationDescriptor; + [IgnoreMember] public virtual string AccommodationDescriptor { get @@ -122911,14 +142255,27 @@ public virtual string AccommodationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentAccommodation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -122937,7 +142294,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentAccommodation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -122965,7 +142362,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); @@ -123053,6 +142450,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentItem : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentItem, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -123060,8 +142458,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentItem() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -123069,7 +142467,7 @@ public StudentAssessmentItem() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessment StudentAssessment { get; set; } Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment @@ -123079,6 +142477,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment } [DomainSignature] + [Key(1)] public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- @@ -123090,6 +142489,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentItem.StudentAssessment // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int AssessmentItemResultDescriptorId { get @@ -123109,6 +142509,7 @@ public virtual int AssessmentItemResultDescriptorId private int _assessmentItemResultDescriptorId; private string _assessmentItemResultDescriptor; + [IgnoreMember] public virtual string AssessmentItemResultDescriptor { get @@ -123124,10 +142525,15 @@ public virtual string AssessmentItemResultDescriptor _assessmentItemResultDescriptorId = default(int); } } + [Key(3)] public virtual string AssessmentResponse { get; set; } + [Key(4)] public virtual string DescriptiveFeedback { get; set; } + [Key(5)] public virtual int? ItemNumber { get; set; } + [Key(6)] public virtual decimal? RawScoreResult { get; set; } + [Key(7)] public virtual int? ResponseIndicatorDescriptorId { get @@ -123147,6 +142553,7 @@ public virtual int? ResponseIndicatorDescriptorId private int? _responseIndicatorDescriptorId; private string _responseIndicatorDescriptor; + [IgnoreMember] public virtual string ResponseIndicatorDescriptor { get @@ -123162,6 +142569,7 @@ public virtual string ResponseIndicatorDescriptor _responseIndicatorDescriptorId = default(int?); } } + [Key(8)] public virtual string TimeAssessed { get; set; } // ------------------------------------------------------------- @@ -123175,14 +142583,27 @@ public virtual string ResponseIndicatorDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentItem")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -123201,12 +142622,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentItem")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(11)] public virtual NHibernate.AssessmentItemAggregate.EdFi.AssessmentItemReferenceData AssessmentItemReferenceData { get; set; } /// @@ -123250,7 +142712,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("IdentificationCode", IdentificationCode); @@ -123338,6 +142800,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -123345,8 +142808,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentPerformanceLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -123354,7 +142817,7 @@ public StudentAssessmentPerformanceLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessment StudentAssessment { get; set; } Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPerformanceLevel.StudentAssessment @@ -123364,6 +142827,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPerformanceLevel.Stude } [DomainSignature] + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -123383,6 +142847,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -123399,6 +142864,7 @@ public virtual string AssessmentReportingMethodDescriptor } } [DomainSignature] + [Key(2)] public virtual int PerformanceLevelDescriptorId { get @@ -123418,6 +142884,7 @@ public virtual int PerformanceLevelDescriptorId private int _performanceLevelDescriptorId; private string _performanceLevelDescriptor; + [IgnoreMember] public virtual string PerformanceLevelDescriptor { get @@ -123443,6 +142910,7 @@ public virtual string PerformanceLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- @@ -123456,14 +142924,27 @@ public virtual string PerformanceLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentPerformanceLevel")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -123482,7 +142963,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentPerformanceLevel")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -123511,7 +143032,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -123600,6 +143121,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -123607,8 +143129,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -123616,7 +143138,7 @@ public StudentAssessmentPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessment StudentAssessment { get; set; } Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPeriod.StudentAssessment @@ -123635,6 +143157,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentPeriod.StudentAssessme // ============================================================= // Properties // ------------------------------------------------------------- + [Key(1)] public virtual int AssessmentPeriodDescriptorId { get @@ -123654,6 +143177,7 @@ public virtual int AssessmentPeriodDescriptorId private int _assessmentPeriodDescriptorId; private string _assessmentPeriodDescriptor; + [IgnoreMember] public virtual string AssessmentPeriodDescriptor { get @@ -123669,6 +143193,7 @@ public virtual string AssessmentPeriodDescriptor _assessmentPeriodDescriptorId = default(int); } } + [Key(2)] public virtual DateTime? BeginDate { get { return _beginDate; } @@ -123688,6 +143213,7 @@ public virtual DateTime? BeginDate private DateTime? _beginDate; + [Key(3)] public virtual DateTime? EndDate { get { return _endDate; } @@ -123719,14 +143245,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentPeriod")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -123745,7 +143284,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentPeriod")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -123773,7 +143352,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values @@ -123860,6 +143439,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentScoreResult : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentScoreResult, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -123867,8 +143447,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentScoreResult() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -123876,7 +143456,7 @@ public StudentAssessmentScoreResult() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessment StudentAssessment { get; set; } Entities.Common.EdFi.IStudentAssessment IStudentAssessmentScoreResult.StudentAssessment @@ -123886,6 +143466,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentScoreResult.StudentAss } [DomainSignature] + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -123905,6 +143486,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -123930,7 +143512,9 @@ public virtual string AssessmentReportingMethodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string Result { get; set; } + [Key(3)] public virtual int ResultDatatypeTypeDescriptorId { get @@ -123950,6 +143534,7 @@ public virtual int ResultDatatypeTypeDescriptorId private int _resultDatatypeTypeDescriptorId; private string _resultDatatypeTypeDescriptor; + [IgnoreMember] public virtual string ResultDatatypeTypeDescriptor { get @@ -123977,14 +143562,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentScoreResult")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -124003,7 +143601,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentScoreResult")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -124032,7 +143670,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -124120,6 +143758,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentStudentObjectiveAssessment : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -124129,8 +143768,8 @@ public StudentAssessmentStudentObjectiveAssessment() { StudentAssessmentStudentObjectiveAssessmentPerformanceLevels = new HashSet(); StudentAssessmentStudentObjectiveAssessmentScoreResults = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -124138,7 +143777,7 @@ public StudentAssessmentStudentObjectiveAssessment() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessment StudentAssessment { get; set; } Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssessment.StudentAssessment @@ -124148,6 +143787,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssess } [DomainSignature] + [Key(1)] public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- @@ -124159,6 +143799,7 @@ Entities.Common.EdFi.IStudentAssessment IStudentAssessmentStudentObjectiveAssess // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual DateTime? AdministrationDate { get { return _administrationDate; } @@ -124177,6 +143818,7 @@ public virtual DateTime? AdministrationDate private DateTime? _administrationDate; + [Key(3)] public virtual DateTime? AdministrationEndDate { get { return _administrationEndDate; } @@ -124195,6 +143837,7 @@ public virtual DateTime? AdministrationEndDate private DateTime? _administrationEndDate; + [Key(4)] public virtual int? AssessedMinutes { get; set; } // ------------------------------------------------------------- @@ -124208,14 +143851,27 @@ public virtual DateTime? AdministrationEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessment")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -124234,12 +143890,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessment")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(7)] public virtual NHibernate.ObjectiveAssessmentAggregate.EdFi.ObjectiveAssessmentReferenceData ObjectiveAssessmentReferenceData { get; set; } /// @@ -124268,6 +143965,8 @@ string Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment.Objecti private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevels; private ICollection _studentAssessmentStudentObjectiveAssessmentPerformanceLevelsCovariant; + [Key(8)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentStudentObjectiveAssessmentPerformanceLevels { get @@ -124277,6 +143976,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentStudentObjectiveAssessmentPerformanceLevels"); + } + foreach (var item in _studentAssessmentStudentObjectiveAssessmentPerformanceLevels) if (item.StudentAssessmentStudentObjectiveAssessment == null) item.StudentAssessmentStudentObjectiveAssessment = this; @@ -124315,6 +144019,8 @@ public virtual ICollection _studentAssessmentStudentObjectiveAssessmentScoreResults; private ICollection _studentAssessmentStudentObjectiveAssessmentScoreResultsCovariant; + [Key(9)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentStudentObjectiveAssessmentScoreResults { get @@ -124324,6 +144030,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentStudentObjectiveAssessmentScoreResults"); + } + foreach (var item in _studentAssessmentStudentObjectiveAssessmentScoreResults) if (item.StudentAssessmentStudentObjectiveAssessment == null) item.StudentAssessmentStudentObjectiveAssessment = this; @@ -124375,7 +144086,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("IdentificationCode", IdentificationCode); @@ -124463,6 +144174,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentStudentObjectiveAssessmentPerformanceLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -124470,8 +144182,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentStudentObjectiveAssessmentPerformanceLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -124479,7 +144191,7 @@ public StudentAssessmentStudentObjectiveAssessmentPerformanceLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { get; set; } Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentPerformanceLevel.StudentAssessmentStudentObjectiveAssessment @@ -124489,6 +144201,7 @@ Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssess } [DomainSignature] + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -124508,6 +144221,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -124524,6 +144238,7 @@ public virtual string AssessmentReportingMethodDescriptor } } [DomainSignature] + [Key(2)] public virtual int PerformanceLevelDescriptorId { get @@ -124543,6 +144258,7 @@ public virtual int PerformanceLevelDescriptorId private int _performanceLevelDescriptorId; private string _performanceLevelDescriptor; + [IgnoreMember] public virtual string PerformanceLevelDescriptor { get @@ -124568,6 +144284,7 @@ public virtual string PerformanceLevelDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual string PerformanceLevelIndicatorName { get; set; } // ------------------------------------------------------------- @@ -124581,14 +144298,27 @@ public virtual string PerformanceLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -124607,7 +144337,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentPerformanceLevel")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -124636,7 +144406,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -124725,6 +144495,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentStudentObjectiveAssessmentScoreResult : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessmentScoreResult, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -124732,8 +144503,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentStudentObjectiveAssessmentScoreResult() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -124741,7 +144512,7 @@ public StudentAssessmentStudentObjectiveAssessmentScoreResult() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessmentStudentObjectiveAssessment StudentAssessmentStudentObjectiveAssessment { get; set; } Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssessmentStudentObjectiveAssessmentScoreResult.StudentAssessmentStudentObjectiveAssessment @@ -124751,6 +144522,7 @@ Entities.Common.EdFi.IStudentAssessmentStudentObjectiveAssessment IStudentAssess } [DomainSignature] + [Key(1)] public virtual int AssessmentReportingMethodDescriptorId { get @@ -124770,6 +144542,7 @@ public virtual int AssessmentReportingMethodDescriptorId private int _assessmentReportingMethodDescriptorId; private string _assessmentReportingMethodDescriptor; + [IgnoreMember] public virtual string AssessmentReportingMethodDescriptor { get @@ -124795,7 +144568,9 @@ public virtual string AssessmentReportingMethodDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string Result { get; set; } + [Key(3)] public virtual int ResultDatatypeTypeDescriptorId { get @@ -124815,6 +144590,7 @@ public virtual int ResultDatatypeTypeDescriptorId private int _resultDatatypeTypeDescriptorId; private string _resultDatatypeTypeDescriptor; + [IgnoreMember] public virtual string ResultDatatypeTypeDescriptor { get @@ -124842,14 +144618,27 @@ public virtual string ResultDatatypeTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentScoreResult")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -124868,7 +144657,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessment", "StudentAssessmentStudentObjectiveAssessmentScoreResult")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -124897,7 +144726,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentStudentObjectiveAssessment as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssessmentReportingMethodDescriptorId", AssessmentReportingMethodDescriptorId); @@ -124985,28 +144814,37 @@ namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentEducationOrganizationAss /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentAssessmentEducationOrganizationAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AssessmentIdentifier { get; set; } + [Key(1)] public virtual int EducationOrganizationAssociationTypeDescriptorId { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual string Namespace { get; set; } + [Key(4)] public virtual string StudentAssessmentIdentifier { get; set; } + [Key(5)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(6)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(7)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -125076,6 +144914,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentEducationOrganizationAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -125083,8 +144922,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentEducationOrganizationAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -125093,8 +144932,10 @@ public StudentAssessmentEducationOrganizationAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual int EducationOrganizationAssociationTypeDescriptorId { get @@ -125114,6 +144955,7 @@ public virtual int EducationOrganizationAssociationTypeDescriptorId private int _educationOrganizationAssociationTypeDescriptorId; private string _educationOrganizationAssociationTypeDescriptor; + [IgnoreMember] public virtual string EducationOrganizationAssociationTypeDescriptor { get @@ -125130,12 +144972,16 @@ public virtual string EducationOrganizationAssociationTypeDescriptor } } [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(10)] public virtual string StudentAssessmentIdentifier { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(11)] public virtual int StudentUSI { get @@ -125161,6 +145007,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -125194,6 +145041,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(12)] public virtual short? SchoolYear { get; set; } // ------------------------------------------------------------- @@ -125207,14 +145055,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessmentEducationOrganizationAssociation", "StudentAssessmentEducationOrganizationAssociation")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -125233,12 +145094,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessmentEducationOrganizationAssociation", "StudentAssessmentEducationOrganizationAssociation")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -125259,6 +145161,7 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.E set { } } + [Key(16)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -125270,6 +145173,7 @@ string Entities.Common.EdFi.IStudentAssessmentEducationOrganizationAssociation.E set { } } + [Key(17)] public virtual NHibernate.StudentAssessmentAggregate.EdFi.StudentAssessmentReferenceData StudentAssessmentReferenceData { get; set; } /// @@ -125401,28 +145305,37 @@ namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentRegistrationAggregate.Ed /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentAssessmentRegistrationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AdministrationIdentifier { get; set; } + [Key(1)] public virtual string AssessmentIdentifier { get; set; } + [Key(2)] public virtual long AssigningEducationOrganizationId { get; set; } + [Key(3)] public virtual long EducationOrganizationId { get; set; } + [Key(4)] public virtual string Namespace { get; set; } + [Key(5)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(6)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(7)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -125492,6 +145405,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentRegistration : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentAssessmentRegistration, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -125501,8 +145415,8 @@ public StudentAssessmentRegistration() { StudentAssessmentRegistrationAssessmentAccommodations = new HashSet(); StudentAssessmentRegistrationAssessmentCustomizations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -125511,16 +145425,22 @@ public StudentAssessmentRegistration() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AdministrationIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] + [Key(8)] public virtual long AssigningEducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(10)] public virtual string Namespace { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(11)] public virtual int StudentUSI { get @@ -125546,6 +145466,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -125579,6 +145500,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(12)] public virtual int? AssessmentGradeLevelDescriptorId { get @@ -125598,6 +145520,7 @@ public virtual int? AssessmentGradeLevelDescriptorId private int? _assessmentGradeLevelDescriptorId; private string _assessmentGradeLevelDescriptor; + [IgnoreMember] public virtual string AssessmentGradeLevelDescriptor { get @@ -125613,6 +145536,7 @@ public virtual string AssessmentGradeLevelDescriptor _assessmentGradeLevelDescriptorId = default(int?); } } + [Key(13)] public virtual DateTime EntryDate { get { return _entryDate; } @@ -125622,6 +145546,7 @@ public virtual DateTime EntryDate private DateTime _entryDate; + [Key(14)] public virtual int? PlatformTypeDescriptorId { get @@ -125641,6 +145566,7 @@ public virtual int? PlatformTypeDescriptorId private int? _platformTypeDescriptorId; private string _platformTypeDescriptor; + [IgnoreMember] public virtual string PlatformTypeDescriptor { get @@ -125656,8 +145582,11 @@ public virtual string PlatformTypeDescriptor _platformTypeDescriptorId = default(int?); } } + [Key(15)] public virtual long? ReportingEducationOrganizationId { get; set; } + [Key(16)] public virtual long? ScheduledEducationOrganizationId { get; set; } + [Key(17)] public virtual int? ScheduledStudentUSI { get @@ -125687,6 +145616,7 @@ public virtual int? ScheduledStudentUSI private int? _scheduledStudentUSI; private string _scheduledStudentUniqueId; + [IgnoreMember] public virtual string ScheduledStudentUniqueId { get @@ -125710,7 +145640,9 @@ public virtual string ScheduledStudentUniqueId _scheduledStudentUniqueId = value; } } + [Key(18)] public virtual long SchoolId { get; set; } + [Key(19)] public virtual long? TestingEducationOrganizationId { get; set; } // ------------------------------------------------------------- @@ -125724,14 +145656,27 @@ public virtual string ScheduledStudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessmentRegistration", "StudentAssessmentRegistration")] + [Key(20)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -125750,12 +145695,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessmentRegistration", "StudentAssessmentRegistration")] + [Key(21)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(22)] public virtual NHibernate.AssessmentAdministrationAggregate.EdFi.AssessmentAdministrationReferenceData AssessmentAdministrationReferenceData { get; set; } /// @@ -125776,6 +145762,7 @@ string Entities.Common.EdFi.IStudentAssessmentRegistration.AssessmentAdministrat set { } } + [Key(23)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData ReportingEducationOrganizationReferenceData { get; set; } /// @@ -125796,6 +145783,7 @@ string Entities.Common.EdFi.IStudentAssessmentRegistration.ReportingEducationOrg set { } } + [Key(24)] public virtual NHibernate.StudentEducationOrganizationAssessmentAccommodationAggregate.EdFi.StudentEducationOrganizationAssessmentAccommodationReferenceData ScheduledStudentEducationOrganizationAssessmentAccommodationReferenceData { get; set; } /// @@ -125816,6 +145804,7 @@ string Entities.Common.EdFi.IStudentAssessmentRegistration.ScheduledStudentEduca set { } } + [Key(25)] public virtual NHibernate.StudentEducationOrganizationAssociationAggregate.EdFi.StudentEducationOrganizationAssociationReferenceData StudentEducationOrganizationAssociationReferenceData { get; set; } /// @@ -125836,6 +145825,7 @@ string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentEducationOrgan set { } } + [Key(26)] public virtual NHibernate.StudentSchoolAssociationAggregate.EdFi.StudentSchoolAssociationReferenceData StudentSchoolAssociationReferenceData { get; set; } /// @@ -125856,6 +145846,7 @@ string Entities.Common.EdFi.IStudentAssessmentRegistration.StudentSchoolAssociat set { } } + [Key(27)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData TestingEducationOrganizationReferenceData { get; set; } /// @@ -125884,6 +145875,8 @@ string Entities.Common.EdFi.IStudentAssessmentRegistration.TestingEducationOrgan private ICollection _studentAssessmentRegistrationAssessmentAccommodations; private ICollection _studentAssessmentRegistrationAssessmentAccommodationsCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentRegistrationAssessmentAccommodations { get @@ -125893,6 +145886,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentRegistrationAssessmentAccommodations"); + } + foreach (var item in _studentAssessmentRegistrationAssessmentAccommodations) if (item.StudentAssessmentRegistration == null) item.StudentAssessmentRegistration = this; @@ -125931,6 +145929,8 @@ public virtual ICollection _studentAssessmentRegistrationAssessmentCustomizations; private ICollection _studentAssessmentRegistrationAssessmentCustomizationsCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentRegistrationAssessmentCustomizations { get @@ -125940,6 +145940,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentRegistrationAssessmentCustomizations"); + } + foreach (var item in _studentAssessmentRegistrationAssessmentCustomizations) if (item.StudentAssessmentRegistration == null) item.StudentAssessmentRegistration = this; @@ -126082,6 +146087,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentRegistrationAssessmentAccommodation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -126089,8 +146095,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentRegistrationAssessmentAccommodation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126098,7 +146104,7 @@ public StudentAssessmentRegistrationAssessmentAccommodation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessmentRegistration StudentAssessmentRegistration { get; set; } Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrationAssessmentAccommodation.StudentAssessmentRegistration @@ -126108,6 +146114,7 @@ Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrati } [DomainSignature] + [Key(1)] public virtual int AccommodationDescriptorId { get @@ -126127,6 +146134,7 @@ public virtual int AccommodationDescriptorId private int _accommodationDescriptorId; private string _accommodationDescriptor; + [IgnoreMember] public virtual string AccommodationDescriptor { get @@ -126164,14 +146172,27 @@ public virtual string AccommodationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessmentRegistration", "StudentAssessmentRegistrationAssessmentAccommodation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -126190,7 +146211,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessmentRegistration", "StudentAssessmentRegistrationAssessmentAccommodation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -126218,7 +146279,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessmentRegistration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentRegistration as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); @@ -126306,6 +146367,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentRegistrationAssessmentCustomization : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentRegistrationAssessmentCustomization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -126313,8 +146375,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentRegistrationAssessmentCustomization() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126322,7 +146384,7 @@ public StudentAssessmentRegistrationAssessmentCustomization() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessmentRegistration StudentAssessmentRegistration { get; set; } Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrationAssessmentCustomization.StudentAssessmentRegistration @@ -126332,6 +146394,7 @@ Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrati } [DomainSignature] + [Key(1)] public virtual string CustomizationKey { get; set; } // ------------------------------------------------------------- @@ -126343,6 +146406,7 @@ Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrati // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string CustomizationValue { get; set; } // ------------------------------------------------------------- @@ -126356,14 +146420,27 @@ Entities.Common.EdFi.IStudentAssessmentRegistration IStudentAssessmentRegistrati // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessmentRegistration", "StudentAssessmentRegistrationAssessmentCustomization")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -126382,7 +146459,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessmentRegistration", "StudentAssessmentRegistrationAssessmentCustomization")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -126409,7 +146526,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessmentRegistration as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentRegistration as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CustomizationKey", CustomizationKey); @@ -126497,29 +146614,39 @@ namespace EdFi.Ods.Entities.NHibernate.StudentAssessmentRegistrationBatteryPartA /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentAssessmentRegistrationBatteryPartAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string AdministrationIdentifier { get; set; } + [Key(1)] public virtual string AssessmentBatteryPartName { get; set; } + [Key(2)] public virtual string AssessmentIdentifier { get; set; } + [Key(3)] public virtual long AssigningEducationOrganizationId { get; set; } + [Key(4)] public virtual long EducationOrganizationId { get; set; } + [Key(5)] public virtual string Namespace { get; set; } + [Key(6)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -126590,6 +146717,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentRegistrationBatteryPartAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -126598,8 +146726,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentRegistrationBatteryPartAssociation() { StudentAssessmentRegistrationBatteryPartAssociationAccommodations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126608,18 +146736,25 @@ public StudentAssessmentRegistrationBatteryPartAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string AdministrationIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string AssessmentBatteryPartName { get; set; } [DomainSignature] + [Key(8)] public virtual string AssessmentIdentifier { get; set; } [DomainSignature] + [Key(9)] public virtual long AssigningEducationOrganizationId { get; set; } [DomainSignature] + [Key(10)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(11)] public virtual string Namespace { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(12)] public virtual int StudentUSI { get @@ -126645,6 +146780,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -126690,14 +146826,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessmentRegistrationBatteryPartAssociation", "StudentAssessmentRegistrationBatteryPartAssociation")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -126716,12 +146865,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessmentRegistrationBatteryPartAssociation", "StudentAssessmentRegistrationBatteryPartAssociation")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.AssessmentBatteryPartAggregate.EdFi.AssessmentBatteryPartReferenceData AssessmentBatteryPartReferenceData { get; set; } /// @@ -126742,6 +146932,7 @@ string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation set { } } + [Key(16)] public virtual NHibernate.StudentAssessmentRegistrationAggregate.EdFi.StudentAssessmentRegistrationReferenceData StudentAssessmentRegistrationReferenceData { get; set; } /// @@ -126770,6 +146961,8 @@ string Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation private ICollection _studentAssessmentRegistrationBatteryPartAssociationAccommodations; private ICollection _studentAssessmentRegistrationBatteryPartAssociationAccommodationsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentAssessmentRegistrationBatteryPartAssociationAccommodations { get @@ -126779,6 +146972,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentAssessmentRegistrationBatteryPartAssociationAccommodations"); + } + foreach (var item in _studentAssessmentRegistrationBatteryPartAssociationAccommodations) if (item.StudentAssessmentRegistrationBatteryPartAssociation == null) item.StudentAssessmentRegistrationBatteryPartAssociation = this; @@ -126920,6 +147118,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentAssessmentRegistrationBatteryPartAssociationAccommodation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociationAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -126927,8 +147126,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentAssessmentRegistrationBatteryPartAssociationAccommodation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -126936,7 +147135,7 @@ public StudentAssessmentRegistrationBatteryPartAssociationAccommodation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentAssessmentRegistrationBatteryPartAssociation StudentAssessmentRegistrationBatteryPartAssociation { get; set; } Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation IStudentAssessmentRegistrationBatteryPartAssociationAccommodation.StudentAssessmentRegistrationBatteryPartAssociation @@ -126946,6 +147145,7 @@ Entities.Common.EdFi.IStudentAssessmentRegistrationBatteryPartAssociation IStude } [DomainSignature] + [Key(1)] public virtual int AccommodationDescriptorId { get @@ -126965,6 +147165,7 @@ public virtual int AccommodationDescriptorId private int _accommodationDescriptorId; private string _accommodationDescriptor; + [IgnoreMember] public virtual string AccommodationDescriptor { get @@ -127002,14 +147203,27 @@ public virtual string AccommodationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentAssessmentRegistrationBatteryPartAssociation", "StudentAssessmentRegistrationBatteryPartAssociationAccommodation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -127028,7 +147242,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentAssessmentRegistrationBatteryPartAssociation", "StudentAssessmentRegistrationBatteryPartAssociationAccommodation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -127056,7 +147310,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentAssessmentRegistrationBatteryPartAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentAssessmentRegistrationBatteryPartAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); @@ -127149,6 +147403,7 @@ namespace EdFi.Ods.Entities.NHibernate.StudentCharacteristicDescriptorAggregate. /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCharacteristicDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IStudentCharacteristicDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -127157,6 +147412,7 @@ public class StudentCharacteristicDescriptor : DescriptorAggregate.EdFi.Descript // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int StudentCharacteristicDescriptorId { get { return base.DescriptorId; } @@ -127323,26 +147579,33 @@ namespace EdFi.Ods.Entities.NHibernate.StudentCohortAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentCohortAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual string CohortIdentifier { get; set; } + [Key(2)] public virtual long EducationOrganizationId { get; set; } + [Key(3)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -127410,6 +147673,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCohortAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentCohortAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -127418,8 +147682,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentCohortAssociation() { StudentCohortAssociationSections = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -127428,6 +147692,7 @@ public StudentCohortAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -127438,10 +147703,13 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual string CohortIdentifier { get; set; } [DomainSignature] + [Key(8)] public virtual long EducationOrganizationId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(9)] public virtual int StudentUSI { get @@ -127467,6 +147735,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -127500,6 +147769,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual DateTime? EndDate { get { return _endDate; } @@ -127531,14 +147801,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentCohortAssociation", "StudentCohortAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -127557,12 +147840,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentCohortAssociation", "StudentCohortAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.CohortAggregate.EdFi.CohortReferenceData CohortReferenceData { get; set; } /// @@ -127583,6 +147907,7 @@ string Entities.Common.EdFi.IStudentCohortAssociation.CohortDiscriminator set { } } + [Key(14)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -127611,6 +147936,8 @@ string Entities.Common.EdFi.IStudentCohortAssociation.StudentDiscriminator private ICollection _studentCohortAssociationSections; private ICollection _studentCohortAssociationSectionsCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentCohortAssociationSections { get @@ -127620,6 +147947,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentCohortAssociationSections"); + } + foreach (var item in _studentCohortAssociationSections) if (item.StudentCohortAssociation == null) item.StudentCohortAssociation = this; @@ -127758,6 +148090,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCohortAssociationSection : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentCohortAssociationSection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -127765,8 +148098,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentCohortAssociationSection() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -127774,7 +148107,7 @@ public StudentCohortAssociationSection() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentCohortAssociation StudentCohortAssociation { get; set; } Entities.Common.EdFi.IStudentCohortAssociation IStudentCohortAssociationSection.StudentCohortAssociation @@ -127784,14 +148117,19 @@ Entities.Common.EdFi.IStudentCohortAssociation IStudentCohortAssociationSection. } [DomainSignature] + [Key(1)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(2)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(3)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(4)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(5)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- @@ -127815,14 +148153,27 @@ Entities.Common.EdFi.IStudentCohortAssociation IStudentCohortAssociationSection. // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentCohortAssociation", "StudentCohortAssociationSection")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -127841,12 +148192,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentCohortAssociation", "StudentCohortAssociationSection")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(8)] public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// @@ -127888,7 +148280,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentCohortAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentCohortAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LocalCourseCode", LocalCourseCode); @@ -127980,30 +148372,41 @@ namespace EdFi.Ods.Entities.NHibernate.StudentCompetencyObjectiveAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentCompetencyObjectiveReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int GradingPeriodDescriptorId { get; set; } + [Key(1)] public virtual string GradingPeriodName { get; set; } + [Key(2)] public virtual long GradingPeriodSchoolId { get; set; } + [Key(3)] public virtual short GradingPeriodSchoolYear { get; set; } + [Key(4)] public virtual long ObjectiveEducationOrganizationId { get; set; } + [Key(5)] public virtual string Objective { get; set; } + [Key(6)] public virtual int ObjectiveGradeLevelDescriptorId { get; set; } + [Key(7)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(8)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(9)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -128075,6 +148478,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCompetencyObjective : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentCompetencyObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -128084,8 +148488,8 @@ public StudentCompetencyObjective() { StudentCompetencyObjectiveGeneralStudentProgramAssociations = new HashSet(); StudentCompetencyObjectiveStudentSectionAssociations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -128094,6 +148498,7 @@ public StudentCompetencyObjective() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int GradingPeriodDescriptorId { get @@ -128113,6 +148518,7 @@ public virtual int GradingPeriodDescriptorId private int _gradingPeriodDescriptorId; private string _gradingPeriodDescriptor; + [IgnoreMember] public virtual string GradingPeriodDescriptor { get @@ -128129,16 +148535,22 @@ public virtual string GradingPeriodDescriptor } } [DomainSignature] + [Key(7)] public virtual string GradingPeriodName { get; set; } [DomainSignature] + [Key(8)] public virtual long GradingPeriodSchoolId { get; set; } [DomainSignature] + [Key(9)] public virtual short GradingPeriodSchoolYear { get; set; } [DomainSignature] + [Key(10)] public virtual long ObjectiveEducationOrganizationId { get; set; } [DomainSignature] + [Key(11)] public virtual string Objective { get; set; } [DomainSignature] + [Key(12)] public virtual int ObjectiveGradeLevelDescriptorId { get @@ -128158,6 +148570,7 @@ public virtual int ObjectiveGradeLevelDescriptorId private int _objectiveGradeLevelDescriptorId; private string _objectiveGradeLevelDescriptor; + [IgnoreMember] public virtual string ObjectiveGradeLevelDescriptor { get @@ -128174,6 +148587,7 @@ public virtual string ObjectiveGradeLevelDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(13)] public virtual int StudentUSI { get @@ -128199,6 +148613,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -128232,6 +148647,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(14)] public virtual int CompetencyLevelDescriptorId { get @@ -128251,6 +148667,7 @@ public virtual int CompetencyLevelDescriptorId private int _competencyLevelDescriptorId; private string _competencyLevelDescriptor; + [IgnoreMember] public virtual string CompetencyLevelDescriptor { get @@ -128266,6 +148683,7 @@ public virtual string CompetencyLevelDescriptor _competencyLevelDescriptorId = default(int); } } + [Key(15)] public virtual string DiagnosticStatement { get; set; } // ------------------------------------------------------------- @@ -128279,14 +148697,27 @@ public virtual string CompetencyLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentCompetencyObjective", "StudentCompetencyObjective")] + [Key(16)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -128305,12 +148736,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentCompetencyObjective", "StudentCompetencyObjective")] + [Key(17)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(18)] public virtual NHibernate.GradingPeriodAggregate.EdFi.GradingPeriodReferenceData GradingPeriodReferenceData { get; set; } /// @@ -128331,6 +148803,7 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.GradingPeriodDiscriminat set { } } + [Key(19)] public virtual NHibernate.CompetencyObjectiveAggregate.EdFi.CompetencyObjectiveReferenceData ObjectiveCompetencyObjectiveReferenceData { get; set; } /// @@ -128351,6 +148824,7 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.ObjectiveCompetencyObjec set { } } + [Key(20)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -128379,6 +148853,8 @@ string Entities.Common.EdFi.IStudentCompetencyObjective.StudentDiscriminator private ICollection _studentCompetencyObjectiveGeneralStudentProgramAssociations; private ICollection _studentCompetencyObjectiveGeneralStudentProgramAssociationsCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentCompetencyObjectiveGeneralStudentProgramAssociations { get @@ -128388,6 +148864,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentCompetencyObjectiveGeneralStudentProgramAssociations"); + } + foreach (var item in _studentCompetencyObjectiveGeneralStudentProgramAssociations) if (item.StudentCompetencyObjective == null) item.StudentCompetencyObjective = this; @@ -128426,6 +148907,8 @@ public virtual ICollection _studentCompetencyObjectiveStudentSectionAssociations; private ICollection _studentCompetencyObjectiveStudentSectionAssociationsCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentCompetencyObjectiveStudentSectionAssociations { get @@ -128435,6 +148918,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentCompetencyObjectiveStudentSectionAssociations"); + } + foreach (var item in _studentCompetencyObjectiveStudentSectionAssociations) if (item.StudentCompetencyObjective == null) item.StudentCompetencyObjective = this; @@ -128580,6 +149068,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCompetencyObjectiveGeneralStudentProgramAssociation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentCompetencyObjectiveGeneralStudentProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -128587,8 +149076,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentCompetencyObjectiveGeneralStudentProgramAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -128596,7 +149085,7 @@ public StudentCompetencyObjectiveGeneralStudentProgramAssociation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentCompetencyObjective StudentCompetencyObjective { get; set; } Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveGeneralStudentProgramAssociation.StudentCompetencyObjective @@ -128606,6 +149095,7 @@ Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveGene } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -128616,12 +149106,16 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(2)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(3)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(4)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(5)] public virtual int ProgramTypeDescriptorId { get @@ -128641,6 +149135,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -128678,14 +149173,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentCompetencyObjective", "StudentCompetencyObjectiveGeneralStudentProgramAssociation")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -128704,12 +149212,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentCompetencyObjective", "StudentCompetencyObjectiveGeneralStudentProgramAssociation")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(8)] public virtual NHibernate.GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociationReferenceData GeneralStudentProgramAssociationReferenceData { get; set; } /// @@ -128754,7 +149303,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentCompetencyObjective as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentCompetencyObjective as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -128846,6 +149395,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCompetencyObjectiveStudentSectionAssociation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentCompetencyObjectiveStudentSectionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -128853,8 +149403,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentCompetencyObjectiveStudentSectionAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -128862,7 +149412,7 @@ public StudentCompetencyObjectiveStudentSectionAssociation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentCompetencyObjective StudentCompetencyObjective { get; set; } Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveStudentSectionAssociation.StudentCompetencyObjective @@ -128872,6 +149422,7 @@ Entities.Common.EdFi.IStudentCompetencyObjective IStudentCompetencyObjectiveStud } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -128882,14 +149433,19 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(2)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(3)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(4)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(5)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(6)] public virtual string SessionName { get; set; } // ------------------------------------------------------------- @@ -128913,14 +149469,27 @@ public virtual DateTime BeginDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentCompetencyObjective", "StudentCompetencyObjectiveStudentSectionAssociation")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -128939,12 +149508,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentCompetencyObjective", "StudentCompetencyObjectiveStudentSectionAssociation")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(9)] public virtual NHibernate.StudentSectionAssociationAggregate.EdFi.StudentSectionAssociationReferenceData StudentSectionAssociationReferenceData { get; set; } /// @@ -128988,7 +149598,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentCompetencyObjective as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentCompetencyObjective as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -129081,24 +149691,29 @@ namespace EdFi.Ods.Entities.NHibernate.StudentContactAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentContactAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int ContactUSI { get; set; } + [Key(1)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -129164,6 +149779,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentContactAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentContactAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -129171,8 +149787,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentContactAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -129181,6 +149797,7 @@ public StudentContactAssociation() // Primary Key // ------------------------------------------------------------- [Display(Name="ContactUniqueId")][DomainSignature] + [Key(6)] public virtual int ContactUSI { get @@ -129206,6 +149823,7 @@ public virtual int ContactUSI private int _contactUSI; private string _contactUniqueId; + [IgnoreMember] public virtual string ContactUniqueId { get @@ -129230,6 +149848,7 @@ public virtual string ContactUniqueId } } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(7)] public virtual int StudentUSI { get @@ -129255,6 +149874,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -129288,12 +149908,19 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual int? ContactPriority { get; set; } + [Key(9)] public virtual string ContactRestrictions { get; set; } + [Key(10)] public virtual bool? EmergencyContactStatus { get; set; } + [Key(11)] public virtual bool? LegalGuardian { get; set; } + [Key(12)] public virtual bool? LivesWith { get; set; } + [Key(13)] public virtual bool? PrimaryContactStatus { get; set; } + [Key(14)] public virtual int? RelationDescriptorId { get @@ -129313,6 +149940,7 @@ public virtual int? RelationDescriptorId private int? _relationDescriptorId; private string _relationDescriptor; + [IgnoreMember] public virtual string RelationDescriptor { get @@ -129340,14 +149968,27 @@ public virtual string RelationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentContactAssociation", "StudentContactAssociation")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -129366,12 +150007,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentContactAssociation", "StudentContactAssociation")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.ContactAggregate.EdFi.ContactReferenceData ContactReferenceData { get; set; } /// @@ -129392,6 +150074,7 @@ string Entities.Common.EdFi.IStudentContactAssociation.ContactDiscriminator set { } } + [Key(18)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -129524,14 +150207,15 @@ namespace EdFi.Ods.Entities.NHibernate.StudentCTEProgramAssociationAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCTEProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentCTEProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentCTEProgramAssociation() { StudentCTEProgramAssociationCTEProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -129540,14 +150224,19 @@ public StudentCTEProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -129567,6 +150256,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -129583,6 +150273,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -129608,6 +150299,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -129656,8 +150348,11 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual bool? NonTraditionalGenderStatus { get; set; } + [Key(20)] public virtual bool? PrivateCTEProgram { get; set; } + [Key(21)] public virtual int? TechnicalSkillsAssessmentDescriptorId { get @@ -129677,6 +150372,7 @@ public virtual int? TechnicalSkillsAssessmentDescriptorId private int? _technicalSkillsAssessmentDescriptorId; private string _technicalSkillsAssessmentDescriptor; + [IgnoreMember] public virtual string TechnicalSkillsAssessmentDescriptor { get @@ -129704,14 +150400,27 @@ public virtual string TechnicalSkillsAssessmentDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociation")] + [Key(22)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -129730,7 +150439,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociation")] + [Key(23)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -129744,6 +150493,8 @@ public IDictionary Extensions private ICollection _studentCTEProgramAssociationCTEProgramServices; private ICollection _studentCTEProgramAssociationCTEProgramServicesCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentCTEProgramAssociationCTEProgramServices { get @@ -129753,6 +150504,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentCTEProgramAssociationCTEProgramServices"); + } + foreach (var item in _studentCTEProgramAssociationCTEProgramServices) if (item.StudentCTEProgramAssociation == null) item.StudentCTEProgramAssociation = this; @@ -129896,6 +150652,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentCTEProgramAssociationCTEProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentCTEProgramAssociationCTEProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -129903,8 +150660,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentCTEProgramAssociationCTEProgramService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -129912,7 +150669,7 @@ public StudentCTEProgramAssociationCTEProgramService() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentCTEProgramAssociation StudentCTEProgramAssociation { get; set; } Entities.Common.EdFi.IStudentCTEProgramAssociation IStudentCTEProgramAssociationCTEProgramService.StudentCTEProgramAssociation @@ -129922,6 +150679,7 @@ Entities.Common.EdFi.IStudentCTEProgramAssociation IStudentCTEProgramAssociation } [DomainSignature] + [Key(1)] public virtual int CTEProgramServiceDescriptorId { get @@ -129941,6 +150699,7 @@ public virtual int CTEProgramServiceDescriptorId private int _cteProgramServiceDescriptorId; private string _cteProgramServiceDescriptor; + [IgnoreMember] public virtual string CTEProgramServiceDescriptor { get @@ -129966,8 +150725,11 @@ public virtual string CTEProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string CIPCode { get; set; } + [Key(3)] public virtual bool? PrimaryIndicator { get; set; } + [Key(4)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -129987,6 +150749,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(5)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -130018,14 +150781,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociationCTEProgramService")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -130044,7 +150820,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentCTEProgramAssociation", "StudentCTEProgramAssociationCTEProgramService")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -130073,7 +150889,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentCTEProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentCTEProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CTEProgramServiceDescriptorId", CTEProgramServiceDescriptorId); @@ -130161,26 +150977,33 @@ namespace EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentBehaviorAssociat /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentDisciplineIncidentBehaviorAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int BehaviorDescriptorId { get; set; } + [Key(1)] public virtual string IncidentIdentifier { get; set; } + [Key(2)] public virtual long SchoolId { get; set; } + [Key(3)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -130248,6 +151071,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentDisciplineIncidentBehaviorAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -130257,8 +151081,8 @@ public StudentDisciplineIncidentBehaviorAssociation() { StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes = new HashSet(); StudentDisciplineIncidentBehaviorAssociationWeapons = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -130267,6 +151091,7 @@ public StudentDisciplineIncidentBehaviorAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int BehaviorDescriptorId { get @@ -130286,6 +151111,7 @@ public virtual int BehaviorDescriptorId private int _behaviorDescriptorId; private string _behaviorDescriptor; + [IgnoreMember] public virtual string BehaviorDescriptor { get @@ -130302,10 +151128,13 @@ public virtual string BehaviorDescriptor } } [DomainSignature] + [Key(7)] public virtual string IncidentIdentifier { get; set; } [DomainSignature] + [Key(8)] public virtual long SchoolId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(9)] public virtual int StudentUSI { get @@ -130331,6 +151160,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -130364,6 +151194,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual string BehaviorDetailedDescription { get; set; } // ------------------------------------------------------------- @@ -130377,14 +151208,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -130403,12 +151247,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } /// @@ -130429,6 +151314,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Discip set { } } + [Key(14)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -130457,6 +151343,8 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation.Studen private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes; private ICollection _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodesCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes { get @@ -130466,6 +151354,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes"); + } + foreach (var item in _studentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCodes) if (item.StudentDisciplineIncidentBehaviorAssociation == null) item.StudentDisciplineIncidentBehaviorAssociation = this; @@ -130504,6 +151397,8 @@ public virtual ICollection _studentDisciplineIncidentBehaviorAssociationWeapons; private ICollection _studentDisciplineIncidentBehaviorAssociationWeaponsCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentDisciplineIncidentBehaviorAssociationWeapons { get @@ -130513,6 +151408,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentDisciplineIncidentBehaviorAssociationWeapons"); + } + foreach (var item in _studentDisciplineIncidentBehaviorAssociationWeapons) if (item.StudentDisciplineIncidentBehaviorAssociation == null) item.StudentDisciplineIncidentBehaviorAssociation = this; @@ -130652,6 +151552,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -130659,8 +151560,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -130668,7 +151569,7 @@ public StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipati // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentDisciplineIncidentBehaviorAssociation StudentDisciplineIncidentBehaviorAssociation { get; set; } Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentBehaviorAssociation @@ -130678,6 +151579,7 @@ Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisci } [DomainSignature] + [Key(1)] public virtual int DisciplineIncidentParticipationCodeDescriptorId { get @@ -130697,6 +151599,7 @@ public virtual int DisciplineIncidentParticipationCodeDescriptorId private int _disciplineIncidentParticipationCodeDescriptorId; private string _disciplineIncidentParticipationCodeDescriptor; + [IgnoreMember] public virtual string DisciplineIncidentParticipationCodeDescriptor { get @@ -130734,14 +151637,27 @@ public virtual string DisciplineIncidentParticipationCodeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -130760,7 +151676,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociationDisciplineIncidentParticipationCode")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -130789,7 +151745,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentDisciplineIncidentBehaviorAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentDisciplineIncidentBehaviorAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); @@ -130877,6 +151833,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentDisciplineIncidentBehaviorAssociationWeapon : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociationWeapon, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -130884,8 +151841,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentDisciplineIncidentBehaviorAssociationWeapon() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -130893,7 +151850,7 @@ public StudentDisciplineIncidentBehaviorAssociationWeapon() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentDisciplineIncidentBehaviorAssociation StudentDisciplineIncidentBehaviorAssociation { get; set; } Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisciplineIncidentBehaviorAssociationWeapon.StudentDisciplineIncidentBehaviorAssociation @@ -130903,6 +151860,7 @@ Entities.Common.EdFi.IStudentDisciplineIncidentBehaviorAssociation IStudentDisci } [DomainSignature] + [Key(1)] public virtual int WeaponDescriptorId { get @@ -130922,6 +151880,7 @@ public virtual int WeaponDescriptorId private int _weaponDescriptorId; private string _weaponDescriptor; + [IgnoreMember] public virtual string WeaponDescriptor { get @@ -130959,14 +151918,27 @@ public virtual string WeaponDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociationWeapon")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -130985,7 +151957,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentDisciplineIncidentBehaviorAssociation", "StudentDisciplineIncidentBehaviorAssociationWeapon")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -131014,7 +152026,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentDisciplineIncidentBehaviorAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentDisciplineIncidentBehaviorAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("WeaponDescriptorId", WeaponDescriptorId); @@ -131102,25 +152114,31 @@ namespace EdFi.Ods.Entities.NHibernate.StudentDisciplineIncidentNonOffenderAssoc /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentDisciplineIncidentNonOffenderAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string IncidentIdentifier { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } + [Key(2)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -131187,6 +152205,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentDisciplineIncidentNonOffenderAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -131195,8 +152214,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentDisciplineIncidentNonOffenderAssociation() { StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -131205,10 +152224,13 @@ public StudentDisciplineIncidentNonOffenderAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string IncidentIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] public virtual int StudentUSI { get @@ -131234,6 +152256,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -131279,14 +152302,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociation")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -131305,12 +152341,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociation")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(11)] public virtual NHibernate.DisciplineIncidentAggregate.EdFi.DisciplineIncidentReferenceData DisciplineIncidentReferenceData { get; set; } /// @@ -131331,6 +152408,7 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Dis set { } } + [Key(12)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -131359,6 +152437,8 @@ string Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation.Stu private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes; private ICollection _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodesCovariant; + [Key(13)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes { get @@ -131368,6 +152448,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes"); + } + foreach (var item in _studentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCodes) if (item.StudentDisciplineIncidentNonOffenderAssociation == null) item.StudentDisciplineIncidentNonOffenderAssociation = this; @@ -131505,6 +152590,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -131512,8 +152598,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -131521,7 +152607,7 @@ public StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticip // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentDisciplineIncidentNonOffenderAssociation StudentDisciplineIncidentNonOffenderAssociation { get; set; } Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation IStudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode.StudentDisciplineIncidentNonOffenderAssociation @@ -131531,6 +152617,7 @@ Entities.Common.EdFi.IStudentDisciplineIncidentNonOffenderAssociation IStudentDi } [DomainSignature] + [Key(1)] public virtual int DisciplineIncidentParticipationCodeDescriptorId { get @@ -131550,6 +152637,7 @@ public virtual int DisciplineIncidentParticipationCodeDescriptorId private int _disciplineIncidentParticipationCodeDescriptorId; private string _disciplineIncidentParticipationCodeDescriptor; + [IgnoreMember] public virtual string DisciplineIncidentParticipationCodeDescriptor { get @@ -131587,14 +152675,27 @@ public virtual string DisciplineIncidentParticipationCodeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -131613,7 +152714,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentDisciplineIncidentNonOffenderAssociation", "StudentDisciplineIncidentNonOffenderAssociationDisciplineIncidentParticipationCode")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -131641,7 +152782,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentDisciplineIncidentNonOffenderAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentDisciplineIncidentNonOffenderAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DisciplineIncidentParticipationCodeDescriptorId", DisciplineIncidentParticipationCodeDescriptorId); @@ -131729,24 +152870,29 @@ namespace EdFi.Ods.Entities.NHibernate.StudentEducationOrganizationAssessmentAcc /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentEducationOrganizationAssessmentAccommodationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -131812,6 +152958,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssessmentAccommodation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -131820,8 +152967,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssessmentAccommodation() { StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -131830,8 +152977,10 @@ public StudentEducationOrganizationAssessmentAccommodation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(7)] public virtual int StudentUSI { get @@ -131857,6 +153006,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -131902,14 +153052,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssessmentAccommodation", "StudentEducationOrganizationAssessmentAccommodation")] + [Key(8)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -131928,12 +153091,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssessmentAccommodation", "StudentEducationOrganizationAssessmentAccommodation")] + [Key(9)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(10)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -131954,6 +153158,7 @@ string Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation set { } } + [Key(11)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -131982,6 +153187,8 @@ string Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation private ICollection _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations; private ICollection _studentEducationOrganizationAssessmentAccommodationGeneralAccommodationsCovariant; + [Key(12)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations { get @@ -131991,6 +153198,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodations"); + } + foreach (var item in _studentEducationOrganizationAssessmentAccommodationGeneralAccommodations) if (item.StudentEducationOrganizationAssessmentAccommodation == null) item.StudentEducationOrganizationAssessmentAccommodation = this; @@ -132127,6 +153339,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -132134,8 +153347,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -132143,7 +153356,7 @@ public StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssessmentAccommodation StudentEducationOrganizationAssessmentAccommodation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation IStudentEducationOrganizationAssessmentAccommodationGeneralAccommodation.StudentEducationOrganizationAssessmentAccommodation @@ -132153,6 +153366,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssessmentAccommodation IStude } [DomainSignature] + [Key(1)] public virtual int AccommodationDescriptorId { get @@ -132172,6 +153386,7 @@ public virtual int AccommodationDescriptorId private int _accommodationDescriptorId; private string _accommodationDescriptor; + [IgnoreMember] public virtual string AccommodationDescriptor { get @@ -132209,14 +153424,27 @@ public virtual string AccommodationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssessmentAccommodation", "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -132235,7 +153463,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssessmentAccommodation", "StudentEducationOrganizationAssessmentAccommodationGeneralAccommodation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -132263,7 +153531,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssessmentAccommodation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssessmentAccommodation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AccommodationDescriptorId", AccommodationDescriptorId); @@ -132351,24 +153619,29 @@ namespace EdFi.Ods.Entities.NHibernate.StudentEducationOrganizationAssociationAg /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentEducationOrganizationAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -132434,6 +153707,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentEducationOrganizationAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -132455,8 +153729,8 @@ public StudentEducationOrganizationAssociation() StudentEducationOrganizationAssociationStudentIndicators = new HashSet(); StudentEducationOrganizationAssociationTelephones = new HashSet(); StudentEducationOrganizationAssociationTribalAffiliations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -132465,8 +153739,10 @@ public StudentEducationOrganizationAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(7)] public virtual int StudentUSI { get @@ -132492,6 +153768,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -132525,6 +153802,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual int? BarrierToInternetAccessInResidenceDescriptorId { get @@ -132544,6 +153822,7 @@ public virtual int? BarrierToInternetAccessInResidenceDescriptorId private int? _barrierToInternetAccessInResidenceDescriptorId; private string _barrierToInternetAccessInResidenceDescriptor; + [IgnoreMember] public virtual string BarrierToInternetAccessInResidenceDescriptor { get @@ -132559,9 +153838,13 @@ public virtual string BarrierToInternetAccessInResidenceDescriptor _barrierToInternetAccessInResidenceDescriptorId = default(int?); } } + [Key(9)] public virtual string GenderIdentity { get; set; } + [Key(10)] public virtual bool? HispanicLatinoEthnicity { get; set; } + [Key(11)] public virtual bool? InternetAccessInResidence { get; set; } + [Key(12)] public virtual int? InternetAccessTypeInResidenceDescriptorId { get @@ -132581,6 +153864,7 @@ public virtual int? InternetAccessTypeInResidenceDescriptorId private int? _internetAccessTypeInResidenceDescriptorId; private string _internetAccessTypeInResidenceDescriptor; + [IgnoreMember] public virtual string InternetAccessTypeInResidenceDescriptor { get @@ -132596,6 +153880,7 @@ public virtual string InternetAccessTypeInResidenceDescriptor _internetAccessTypeInResidenceDescriptorId = default(int?); } } + [Key(13)] public virtual int? InternetPerformanceInResidenceDescriptorId { get @@ -132615,6 +153900,7 @@ public virtual int? InternetPerformanceInResidenceDescriptorId private int? _internetPerformanceInResidenceDescriptorId; private string _internetPerformanceInResidenceDescriptor; + [IgnoreMember] public virtual string InternetPerformanceInResidenceDescriptor { get @@ -132630,6 +153916,7 @@ public virtual string InternetPerformanceInResidenceDescriptor _internetPerformanceInResidenceDescriptorId = default(int?); } } + [Key(14)] public virtual int? LimitedEnglishProficiencyDescriptorId { get @@ -132649,6 +153936,7 @@ public virtual int? LimitedEnglishProficiencyDescriptorId private int? _limitedEnglishProficiencyDescriptorId; private string _limitedEnglishProficiencyDescriptor; + [IgnoreMember] public virtual string LimitedEnglishProficiencyDescriptor { get @@ -132664,7 +153952,9 @@ public virtual string LimitedEnglishProficiencyDescriptor _limitedEnglishProficiencyDescriptorId = default(int?); } } + [Key(15)] public virtual string LoginId { get; set; } + [Key(16)] public virtual int? PrimaryLearningDeviceAccessDescriptorId { get @@ -132684,6 +153974,7 @@ public virtual int? PrimaryLearningDeviceAccessDescriptorId private int? _primaryLearningDeviceAccessDescriptorId; private string _primaryLearningDeviceAccessDescriptor; + [IgnoreMember] public virtual string PrimaryLearningDeviceAccessDescriptor { get @@ -132699,6 +153990,7 @@ public virtual string PrimaryLearningDeviceAccessDescriptor _primaryLearningDeviceAccessDescriptorId = default(int?); } } + [Key(17)] public virtual int? PrimaryLearningDeviceAwayFromSchoolDescriptorId { get @@ -132718,6 +154010,7 @@ public virtual int? PrimaryLearningDeviceAwayFromSchoolDescriptorId private int? _primaryLearningDeviceAwayFromSchoolDescriptorId; private string _primaryLearningDeviceAwayFromSchoolDescriptor; + [IgnoreMember] public virtual string PrimaryLearningDeviceAwayFromSchoolDescriptor { get @@ -132733,6 +154026,7 @@ public virtual string PrimaryLearningDeviceAwayFromSchoolDescriptor _primaryLearningDeviceAwayFromSchoolDescriptorId = default(int?); } } + [Key(18)] public virtual int? PrimaryLearningDeviceProviderDescriptorId { get @@ -132752,6 +154046,7 @@ public virtual int? PrimaryLearningDeviceProviderDescriptorId private int? _primaryLearningDeviceProviderDescriptorId; private string _primaryLearningDeviceProviderDescriptor; + [IgnoreMember] public virtual string PrimaryLearningDeviceProviderDescriptor { get @@ -132767,7 +154062,9 @@ public virtual string PrimaryLearningDeviceProviderDescriptor _primaryLearningDeviceProviderDescriptorId = default(int?); } } + [Key(19)] public virtual string ProfileThumbnail { get; set; } + [Key(20)] public virtual int? SexDescriptorId { get @@ -132787,6 +154084,7 @@ public virtual int? SexDescriptorId private int? _sexDescriptorId; private string _sexDescriptor; + [IgnoreMember] public virtual string SexDescriptor { get @@ -132802,6 +154100,7 @@ public virtual string SexDescriptor _sexDescriptorId = default(int?); } } + [Key(21)] public virtual int? SupporterMilitaryConnectionDescriptorId { get @@ -132821,6 +154120,7 @@ public virtual int? SupporterMilitaryConnectionDescriptorId private int? _supporterMilitaryConnectionDescriptorId; private string _supporterMilitaryConnectionDescriptor; + [IgnoreMember] public virtual string SupporterMilitaryConnectionDescriptor { get @@ -132848,14 +154148,27 @@ public virtual string SupporterMilitaryConnectionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociation")] + [Key(22)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -132874,12 +154187,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociation")] + [Key(23)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(24)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -132900,6 +154254,7 @@ string Entities.Common.EdFi.IStudentEducationOrganizationAssociation.EducationOr set { } } + [Key(25)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -132928,6 +154283,8 @@ string Entities.Common.EdFi.IStudentEducationOrganizationAssociation.StudentDisc private ICollection _studentEducationOrganizationAssociationAddresses; private ICollection _studentEducationOrganizationAssociationAddressesCovariant; + [Key(26)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationAddresses { get @@ -132937,6 +154294,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationAddresses"); + } + foreach (var item in _studentEducationOrganizationAssociationAddresses) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -132975,6 +154337,8 @@ public virtual ICollection _studentEducationOrganizationAssociationAncestryEthnicOrigins; private ICollection _studentEducationOrganizationAssociationAncestryEthnicOriginsCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationAncestryEthnicOrigins { get @@ -132984,6 +154348,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationAncestryEthnicOrigins"); + } + foreach (var item in _studentEducationOrganizationAssociationAncestryEthnicOrigins) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133022,6 +154391,8 @@ public virtual ICollection _studentEducationOrganizationAssociationCohortYears; private ICollection _studentEducationOrganizationAssociationCohortYearsCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationCohortYears { get @@ -133031,6 +154402,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationCohortYears"); + } + foreach (var item in _studentEducationOrganizationAssociationCohortYears) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133069,6 +154445,8 @@ public virtual ICollection _studentEducationOrganizationAssociationDisabilities; private ICollection _studentEducationOrganizationAssociationDisabilitiesCovariant; + [Key(29)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationDisabilities { get @@ -133078,6 +154456,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationDisabilities"); + } + foreach (var item in _studentEducationOrganizationAssociationDisabilities) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133116,6 +154499,8 @@ public virtual ICollection _studentEducationOrganizationAssociationDisplacedStudents; private ICollection _studentEducationOrganizationAssociationDisplacedStudentsCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationDisplacedStudents { get @@ -133125,6 +154510,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationDisplacedStudents"); + } + foreach (var item in _studentEducationOrganizationAssociationDisplacedStudents) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133163,6 +154553,8 @@ public virtual ICollection _studentEducationOrganizationAssociationElectronicMails; private ICollection _studentEducationOrganizationAssociationElectronicMailsCovariant; + [Key(31)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationElectronicMails { get @@ -133172,6 +154564,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationElectronicMails"); + } + foreach (var item in _studentEducationOrganizationAssociationElectronicMails) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133210,6 +154607,8 @@ public virtual ICollection _studentEducationOrganizationAssociationInternationalAddresses; private ICollection _studentEducationOrganizationAssociationInternationalAddressesCovariant; + [Key(32)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationInternationalAddresses { get @@ -133219,6 +154618,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationInternationalAddresses"); + } + foreach (var item in _studentEducationOrganizationAssociationInternationalAddresses) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133257,6 +154661,8 @@ public virtual ICollection _studentEducationOrganizationAssociationLanguages; private ICollection _studentEducationOrganizationAssociationLanguagesCovariant; + [Key(33)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationLanguages { get @@ -133266,6 +154672,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationLanguages"); + } + foreach (var item in _studentEducationOrganizationAssociationLanguages) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133304,6 +154715,8 @@ public virtual ICollection _studentEducationOrganizationAssociationRaces; private ICollection _studentEducationOrganizationAssociationRacesCovariant; + [Key(34)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationRaces { get @@ -133313,6 +154726,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationRaces"); + } + foreach (var item in _studentEducationOrganizationAssociationRaces) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133351,6 +154769,8 @@ public virtual ICollection _studentEducationOrganizationAssociationStudentCharacteristics; private ICollection _studentEducationOrganizationAssociationStudentCharacteristicsCovariant; + [Key(35)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationStudentCharacteristics { get @@ -133360,6 +154780,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationStudentCharacteristics"); + } + foreach (var item in _studentEducationOrganizationAssociationStudentCharacteristics) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133398,6 +154823,8 @@ public virtual ICollection _studentEducationOrganizationAssociationStudentIdentificationCodes; private ICollection _studentEducationOrganizationAssociationStudentIdentificationCodesCovariant; + [Key(36)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationStudentIdentificationCodes { get @@ -133407,6 +154834,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationStudentIdentificationCodes"); + } + foreach (var item in _studentEducationOrganizationAssociationStudentIdentificationCodes) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133445,6 +154877,8 @@ public virtual ICollection _studentEducationOrganizationAssociationStudentIndicators; private ICollection _studentEducationOrganizationAssociationStudentIndicatorsCovariant; + [Key(37)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationStudentIndicators { get @@ -133454,6 +154888,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationStudentIndicators"); + } + foreach (var item in _studentEducationOrganizationAssociationStudentIndicators) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133492,6 +154931,8 @@ public virtual ICollection _studentEducationOrganizationAssociationTelephones; private ICollection _studentEducationOrganizationAssociationTelephonesCovariant; + [Key(38)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationTelephones { get @@ -133501,6 +154942,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationTelephones"); + } + foreach (var item in _studentEducationOrganizationAssociationTelephones) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133539,6 +154985,8 @@ public virtual ICollection _studentEducationOrganizationAssociationTribalAffiliations; private ICollection _studentEducationOrganizationAssociationTribalAffiliationsCovariant; + [Key(39)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationTribalAffiliations { get @@ -133548,6 +154996,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationTribalAffiliations"); + } + foreach (var item in _studentEducationOrganizationAssociationTribalAffiliations) if (item.StudentEducationOrganizationAssociation == null) item.StudentEducationOrganizationAssociation = this; @@ -133693,6 +155146,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationAddress : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -133701,8 +155155,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationAddress() { StudentEducationOrganizationAssociationAddressPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -133710,7 +155164,7 @@ public StudentEducationOrganizationAssociationAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationAddress.StudentEducationOrganizationAssociation @@ -133720,6 +155174,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int AddressTypeDescriptorId { get @@ -133739,6 +155194,7 @@ public virtual int AddressTypeDescriptorId private int _addressTypeDescriptorId; private string _addressTypeDescriptor; + [IgnoreMember] public virtual string AddressTypeDescriptor { get @@ -133755,10 +155211,13 @@ public virtual string AddressTypeDescriptor } } [DomainSignature] + [Key(2)] public virtual string City { get; set; } [DomainSignature] + [Key(3)] public virtual string PostalCode { get; set; } [DomainSignature] + [Key(4)] public virtual int StateAbbreviationDescriptorId { get @@ -133778,6 +155237,7 @@ public virtual int StateAbbreviationDescriptorId private int _stateAbbreviationDescriptorId; private string _stateAbbreviationDescriptor; + [IgnoreMember] public virtual string StateAbbreviationDescriptor { get @@ -133794,6 +155254,7 @@ public virtual string StateAbbreviationDescriptor } } [DomainSignature] + [Key(5)] public virtual string StreetNumberName { get; set; } // ------------------------------------------------------------- @@ -133805,12 +155266,19 @@ public virtual string StateAbbreviationDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(6)] public virtual string ApartmentRoomSuiteNumber { get; set; } + [Key(7)] public virtual string BuildingSiteNumber { get; set; } + [Key(8)] public virtual string CongressionalDistrict { get; set; } + [Key(9)] public virtual string CountyFIPSCode { get; set; } + [Key(10)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(11)] public virtual string Latitude { get; set; } + [Key(12)] public virtual int? LocaleDescriptorId { get @@ -133830,6 +155298,7 @@ public virtual int? LocaleDescriptorId private int? _localeDescriptorId; private string _localeDescriptor; + [IgnoreMember] public virtual string LocaleDescriptor { get @@ -133845,7 +155314,9 @@ public virtual string LocaleDescriptor _localeDescriptorId = default(int?); } } + [Key(13)] public virtual string Longitude { get; set; } + [Key(14)] public virtual string NameOfCounty { get; set; } // ------------------------------------------------------------- @@ -133859,14 +155330,27 @@ public virtual string LocaleDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationAddress")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -133885,7 +155369,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationAddress")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -133899,6 +155423,8 @@ public IDictionary Extensions private ICollection _studentEducationOrganizationAssociationAddressPeriods; private ICollection _studentEducationOrganizationAssociationAddressPeriodsCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationAddressPeriods { get @@ -133908,6 +155434,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationAddressPeriods"); + } + foreach (var item in _studentEducationOrganizationAssociationAddressPeriods) if (item.StudentEducationOrganizationAssociationAddress == null) item.StudentEducationOrganizationAssociationAddress = this; @@ -133962,7 +155493,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); @@ -134054,6 +155585,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationAddressPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationAddressPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -134061,8 +155593,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationAddressPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -134070,7 +155602,7 @@ public StudentEducationOrganizationAssociationAddressPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociationAddress StudentEducationOrganizationAssociationAddress { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociationAddress IStudentEducationOrganizationAssociationAddressPeriod.StudentEducationOrganizationAssociationAddress @@ -134080,6 +155612,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociationAddress IStudentEdu } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -134099,6 +155632,7 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual DateTime? EndDate { get { return _endDate; } @@ -134130,14 +155664,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationAddressPeriod")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -134156,7 +155703,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationAddressPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -134185,7 +155772,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociationAddress as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociationAddress as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -134273,6 +155860,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationAncestryEthnicOrigin : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationAncestryEthnicOrigin, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -134280,8 +155868,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationAncestryEthnicOrigin() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -134289,7 +155877,7 @@ public StudentEducationOrganizationAssociationAncestryEthnicOrigin() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationAncestryEthnicOrigin.StudentEducationOrganizationAssociation @@ -134299,6 +155887,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int AncestryEthnicOriginDescriptorId { get @@ -134318,6 +155907,7 @@ public virtual int AncestryEthnicOriginDescriptorId private int _ancestryEthnicOriginDescriptorId; private string _ancestryEthnicOriginDescriptor; + [IgnoreMember] public virtual string AncestryEthnicOriginDescriptor { get @@ -134355,14 +155945,27 @@ public virtual string AncestryEthnicOriginDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationAncestryEthnicOrigin")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -134381,7 +155984,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationAncestryEthnicOrigin")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -134409,7 +156052,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AncestryEthnicOriginDescriptorId", AncestryEthnicOriginDescriptorId); @@ -134497,6 +156140,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationCohortYear : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationCohortYear, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -134504,8 +156148,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationCohortYear() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -134513,7 +156157,7 @@ public StudentEducationOrganizationAssociationCohortYear() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationCohortYear.StudentEducationOrganizationAssociation @@ -134523,6 +156167,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int CohortYearTypeDescriptorId { get @@ -134542,6 +156187,7 @@ public virtual int CohortYearTypeDescriptorId private int _cohortYearTypeDescriptorId; private string _cohortYearTypeDescriptor; + [IgnoreMember] public virtual string CohortYearTypeDescriptor { get @@ -134558,6 +156204,7 @@ public virtual string CohortYearTypeDescriptor } } [DomainSignature] + [Key(2)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- @@ -134569,6 +156216,7 @@ public virtual string CohortYearTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual int? TermDescriptorId { get @@ -134588,6 +156236,7 @@ public virtual int? TermDescriptorId private int? _termDescriptorId; private string _termDescriptor; + [IgnoreMember] public virtual string TermDescriptor { get @@ -134615,14 +156264,27 @@ public virtual string TermDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationCohortYear")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -134641,12 +156303,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationCohortYear")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -134681,7 +156384,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CohortYearTypeDescriptorId", CohortYearTypeDescriptorId); @@ -134770,6 +156473,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationDisability : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationDisability, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -134778,8 +156482,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationDisability() { StudentEducationOrganizationAssociationDisabilityDesignations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -134787,7 +156491,7 @@ public StudentEducationOrganizationAssociationDisability() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationDisability.StudentEducationOrganizationAssociation @@ -134797,6 +156501,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int DisabilityDescriptorId { get @@ -134816,6 +156521,7 @@ public virtual int DisabilityDescriptorId private int _disabilityDescriptorId; private string _disabilityDescriptor; + [IgnoreMember] public virtual string DisabilityDescriptor { get @@ -134841,6 +156547,7 @@ public virtual string DisabilityDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? DisabilityDeterminationSourceTypeDescriptorId { get @@ -134860,6 +156567,7 @@ public virtual int? DisabilityDeterminationSourceTypeDescriptorId private int? _disabilityDeterminationSourceTypeDescriptorId; private string _disabilityDeterminationSourceTypeDescriptor; + [IgnoreMember] public virtual string DisabilityDeterminationSourceTypeDescriptor { get @@ -134875,7 +156583,9 @@ public virtual string DisabilityDeterminationSourceTypeDescriptor _disabilityDeterminationSourceTypeDescriptorId = default(int?); } } + [Key(3)] public virtual string DisabilityDiagnosis { get; set; } + [Key(4)] public virtual int? OrderOfDisability { get; set; } // ------------------------------------------------------------- @@ -134889,14 +156599,27 @@ public virtual string DisabilityDeterminationSourceTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationDisability")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -134915,7 +156638,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationDisability")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -134929,6 +156692,8 @@ public IDictionary Extensions private ICollection _studentEducationOrganizationAssociationDisabilityDesignations; private ICollection _studentEducationOrganizationAssociationDisabilityDesignationsCovariant; + [Key(7)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationDisabilityDesignations { get @@ -134938,6 +156703,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationDisabilityDesignations"); + } + foreach (var item in _studentEducationOrganizationAssociationDisabilityDesignations) if (item.StudentEducationOrganizationAssociationDisability == null) item.StudentEducationOrganizationAssociationDisability = this; @@ -134991,7 +156761,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DisabilityDescriptorId", DisabilityDescriptorId); @@ -135079,6 +156849,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationDisabilityDesignation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationDisabilityDesignation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -135086,8 +156857,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationDisabilityDesignation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -135095,7 +156866,7 @@ public StudentEducationOrganizationAssociationDisabilityDesignation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociationDisability StudentEducationOrganizationAssociationDisability { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociationDisability IStudentEducationOrganizationAssociationDisabilityDesignation.StudentEducationOrganizationAssociationDisability @@ -135105,6 +156876,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociationDisability IStudent } [DomainSignature] + [Key(1)] public virtual int DisabilityDesignationDescriptorId { get @@ -135124,6 +156896,7 @@ public virtual int DisabilityDesignationDescriptorId private int _disabilityDesignationDescriptorId; private string _disabilityDesignationDescriptor; + [IgnoreMember] public virtual string DisabilityDesignationDescriptor { get @@ -135161,14 +156934,27 @@ public virtual string DisabilityDesignationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationDisabilityDesignation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -135187,7 +156973,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationDisabilityDesignation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -135216,7 +157042,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociationDisability as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociationDisability as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DisabilityDesignationDescriptorId", DisabilityDesignationDescriptorId); @@ -135304,6 +157130,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationDisplacedStudent : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationDisplacedStudent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -135311,8 +157138,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationDisplacedStudent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -135320,7 +157147,7 @@ public StudentEducationOrganizationAssociationDisplacedStudent() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationDisplacedStudent.StudentEducationOrganizationAssociation @@ -135330,6 +157157,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual string CrisisEventName { get; set; } // ------------------------------------------------------------- @@ -135341,7 +157169,9 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? CrisisHomelessnessIndicator { get; set; } + [Key(3)] public virtual DateTime? DisplacedStudentEndDate { get { return _displacedStudentEndDate; } @@ -135361,6 +157191,7 @@ public virtual DateTime? DisplacedStudentEndDate private DateTime? _displacedStudentEndDate; + [Key(4)] public virtual DateTime? DisplacedStudentStartDate { get { return _displacedStudentStartDate; } @@ -135380,6 +157211,7 @@ public virtual DateTime? DisplacedStudentStartDate private DateTime? _displacedStudentStartDate; + [Key(5)] public virtual int DisplacedStudentStatusDescriptorId { get @@ -135399,6 +157231,7 @@ public virtual int DisplacedStudentStatusDescriptorId private int _displacedStudentStatusDescriptorId; private string _displacedStudentStatusDescriptor; + [IgnoreMember] public virtual string DisplacedStudentStatusDescriptor { get @@ -135426,14 +157259,27 @@ public virtual string DisplacedStudentStatusDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationDisplacedStudent")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -135452,12 +157298,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationDisplacedStudent")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(8)] public virtual NHibernate.CrisisEventAggregate.EdFi.CrisisEventReferenceData CrisisEventReferenceData { get; set; } /// @@ -135500,7 +157387,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("CrisisEventName", CrisisEventName); @@ -135588,6 +157475,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationElectronicMail : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationElectronicMail, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -135595,8 +157483,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationElectronicMail() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -135604,7 +157492,7 @@ public StudentEducationOrganizationAssociationElectronicMail() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationElectronicMail.StudentEducationOrganizationAssociation @@ -135614,8 +157502,10 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual string ElectronicMailAddress { get; set; } [DomainSignature] + [Key(2)] public virtual int ElectronicMailTypeDescriptorId { get @@ -135635,6 +157525,7 @@ public virtual int ElectronicMailTypeDescriptorId private int _electronicMailTypeDescriptorId; private string _electronicMailTypeDescriptor; + [IgnoreMember] public virtual string ElectronicMailTypeDescriptor { get @@ -135660,7 +157551,9 @@ public virtual string ElectronicMailTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(4)] public virtual bool? PrimaryEmailAddressIndicator { get; set; } // ------------------------------------------------------------- @@ -135674,14 +157567,27 @@ public virtual string ElectronicMailTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationElectronicMail")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -135700,7 +157606,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationElectronicMail")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -135728,7 +157674,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ElectronicMailAddress", ElectronicMailAddress); @@ -135817,6 +157763,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationInternationalAddress : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationInternationalAddress, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -135824,8 +157771,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationInternationalAddress() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -135833,7 +157780,7 @@ public StudentEducationOrganizationAssociationInternationalAddress() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationInternationalAddress.StudentEducationOrganizationAssociation @@ -135843,6 +157790,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int AddressTypeDescriptorId { get @@ -135862,6 +157810,7 @@ public virtual int AddressTypeDescriptorId private int _addressTypeDescriptorId; private string _addressTypeDescriptor; + [IgnoreMember] public virtual string AddressTypeDescriptor { get @@ -135887,10 +157836,15 @@ public virtual string AddressTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string AddressLine1 { get; set; } + [Key(3)] public virtual string AddressLine2 { get; set; } + [Key(4)] public virtual string AddressLine3 { get; set; } + [Key(5)] public virtual string AddressLine4 { get; set; } + [Key(6)] public virtual DateTime? BeginDate { get { return _beginDate; } @@ -135910,6 +157864,7 @@ public virtual DateTime? BeginDate private DateTime? _beginDate; + [Key(7)] public virtual int CountryDescriptorId { get @@ -135929,6 +157884,7 @@ public virtual int CountryDescriptorId private int _countryDescriptorId; private string _countryDescriptor; + [IgnoreMember] public virtual string CountryDescriptor { get @@ -135944,6 +157900,7 @@ public virtual string CountryDescriptor _countryDescriptorId = default(int); } } + [Key(8)] public virtual DateTime? EndDate { get { return _endDate; } @@ -135963,7 +157920,9 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(9)] public virtual string Latitude { get; set; } + [Key(10)] public virtual string Longitude { get; set; } // ------------------------------------------------------------- @@ -135977,14 +157936,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationInternationalAddress")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -136003,7 +157975,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationInternationalAddress")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -136032,7 +158044,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AddressTypeDescriptorId", AddressTypeDescriptorId); @@ -136120,6 +158132,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationLanguage : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationLanguage, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -136128,8 +158141,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationLanguage() { StudentEducationOrganizationAssociationLanguageUses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -136137,7 +158150,7 @@ public StudentEducationOrganizationAssociationLanguage() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationLanguage.StudentEducationOrganizationAssociation @@ -136147,6 +158160,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int LanguageDescriptorId { get @@ -136166,6 +158180,7 @@ public virtual int LanguageDescriptorId private int _languageDescriptorId; private string _languageDescriptor; + [IgnoreMember] public virtual string LanguageDescriptor { get @@ -136203,14 +158218,27 @@ public virtual string LanguageDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationLanguage")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -136229,7 +158257,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationLanguage")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -136243,6 +158311,8 @@ public IDictionary Extensions private ICollection _studentEducationOrganizationAssociationLanguageUses; private ICollection _studentEducationOrganizationAssociationLanguageUsesCovariant; + [Key(4)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationLanguageUses { get @@ -136252,6 +158322,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationLanguageUses"); + } + foreach (var item in _studentEducationOrganizationAssociationLanguageUses) if (item.StudentEducationOrganizationAssociationLanguage == null) item.StudentEducationOrganizationAssociationLanguage = this; @@ -136304,7 +158379,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LanguageDescriptorId", LanguageDescriptorId); @@ -136392,6 +158467,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationLanguageUse : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationLanguageUse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -136399,8 +158475,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationLanguageUse() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -136408,7 +158484,7 @@ public StudentEducationOrganizationAssociationLanguageUse() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociationLanguage StudentEducationOrganizationAssociationLanguage { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociationLanguage IStudentEducationOrganizationAssociationLanguageUse.StudentEducationOrganizationAssociationLanguage @@ -136418,6 +158494,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociationLanguage IStudentEd } [DomainSignature] + [Key(1)] public virtual int LanguageUseDescriptorId { get @@ -136437,6 +158514,7 @@ public virtual int LanguageUseDescriptorId private int _languageUseDescriptorId; private string _languageUseDescriptor; + [IgnoreMember] public virtual string LanguageUseDescriptor { get @@ -136474,14 +158552,27 @@ public virtual string LanguageUseDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationLanguageUse")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -136500,7 +158591,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationLanguageUse")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -136529,7 +158660,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociationLanguage as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociationLanguage as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LanguageUseDescriptorId", LanguageUseDescriptorId); @@ -136617,6 +158748,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationRace : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationRace, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -136624,8 +158756,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationRace() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -136633,7 +158765,7 @@ public StudentEducationOrganizationAssociationRace() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationRace.StudentEducationOrganizationAssociation @@ -136643,6 +158775,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int RaceDescriptorId { get @@ -136662,6 +158795,7 @@ public virtual int RaceDescriptorId private int _raceDescriptorId; private string _raceDescriptor; + [IgnoreMember] public virtual string RaceDescriptor { get @@ -136699,14 +158833,27 @@ public virtual string RaceDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationRace")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -136725,7 +158872,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationRace")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -136753,7 +158940,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("RaceDescriptorId", RaceDescriptorId); @@ -136841,6 +159028,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationStudentCharacteristic : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentCharacteristic, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -136849,8 +159037,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationStudentCharacteristic() { StudentEducationOrganizationAssociationStudentCharacteristicPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -136858,7 +159046,7 @@ public StudentEducationOrganizationAssociationStudentCharacteristic() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationStudentCharacteristic.StudentEducationOrganizationAssociation @@ -136868,6 +159056,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int StudentCharacteristicDescriptorId { get @@ -136887,6 +159076,7 @@ public virtual int StudentCharacteristicDescriptorId private int _studentCharacteristicDescriptorId; private string _studentCharacteristicDescriptor; + [IgnoreMember] public virtual string StudentCharacteristicDescriptor { get @@ -136912,6 +159102,7 @@ public virtual string StudentCharacteristicDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string DesignatedBy { get; set; } // ------------------------------------------------------------- @@ -136925,14 +159116,27 @@ public virtual string StudentCharacteristicDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentCharacteristic")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -136951,7 +159155,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentCharacteristic")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -136965,6 +159209,8 @@ public IDictionary Extensions private ICollection _studentEducationOrganizationAssociationStudentCharacteristicPeriods; private ICollection _studentEducationOrganizationAssociationStudentCharacteristicPeriodsCovariant; + [Key(5)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationStudentCharacteristicPeriods { get @@ -136974,6 +159220,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationStudentCharacteristicPeriods"); + } + foreach (var item in _studentEducationOrganizationAssociationStudentCharacteristicPeriods) if (item.StudentEducationOrganizationAssociationStudentCharacteristic == null) item.StudentEducationOrganizationAssociationStudentCharacteristic = this; @@ -137026,7 +159277,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("StudentCharacteristicDescriptorId", StudentCharacteristicDescriptorId); @@ -137114,6 +159365,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationStudentCharacteristicPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentCharacteristicPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -137121,8 +159373,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationStudentCharacteristicPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -137130,7 +159382,7 @@ public StudentEducationOrganizationAssociationStudentCharacteristicPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociationStudentCharacteristic StudentEducationOrganizationAssociationStudentCharacteristic { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentCharacteristic IStudentEducationOrganizationAssociationStudentCharacteristicPeriod.StudentEducationOrganizationAssociationStudentCharacteristic @@ -137140,6 +159392,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentCharacterist } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -137159,6 +159412,7 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual DateTime? EndDate { get { return _endDate; } @@ -137190,14 +159444,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentCharacteristicPeriod")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -137216,7 +159483,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentCharacteristicPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -137244,7 +159551,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociationStudentCharacteristic as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociationStudentCharacteristic as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -137332,6 +159639,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationStudentIdentificationCode : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentIdentificationCode, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -137339,8 +159647,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationStudentIdentificationCode() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -137348,7 +159656,7 @@ public StudentEducationOrganizationAssociationStudentIdentificationCode() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationStudentIdentificationCode.StudentEducationOrganizationAssociation @@ -137358,8 +159666,10 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual string AssigningOrganizationIdentificationCode { get; set; } [DomainSignature] + [Key(2)] public virtual int StudentIdentificationSystemDescriptorId { get @@ -137379,6 +159689,7 @@ public virtual int StudentIdentificationSystemDescriptorId private int _studentIdentificationSystemDescriptorId; private string _studentIdentificationSystemDescriptor; + [IgnoreMember] public virtual string StudentIdentificationSystemDescriptor { get @@ -137404,6 +159715,7 @@ public virtual string StudentIdentificationSystemDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual string IdentificationCode { get; set; } // ------------------------------------------------------------- @@ -137417,14 +159729,27 @@ public virtual string StudentIdentificationSystemDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentIdentificationCode")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -137443,7 +159768,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentIdentificationCode")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -137471,7 +159836,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AssigningOrganizationIdentificationCode", AssigningOrganizationIdentificationCode); @@ -137560,6 +159925,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationStudentIndicator : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentIndicator, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -137568,8 +159934,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationStudentIndicator() { StudentEducationOrganizationAssociationStudentIndicatorPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -137577,7 +159943,7 @@ public StudentEducationOrganizationAssociationStudentIndicator() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationStudentIndicator.StudentEducationOrganizationAssociation @@ -137587,6 +159953,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual string IndicatorName { get; set; } // ------------------------------------------------------------- @@ -137598,8 +159965,11 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string DesignatedBy { get; set; } + [Key(3)] public virtual string Indicator { get; set; } + [Key(4)] public virtual string IndicatorGroup { get; set; } // ------------------------------------------------------------- @@ -137613,14 +159983,27 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentIndicator")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -137639,7 +160022,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentIndicator")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -137653,6 +160076,8 @@ public IDictionary Extensions private ICollection _studentEducationOrganizationAssociationStudentIndicatorPeriods; private ICollection _studentEducationOrganizationAssociationStudentIndicatorPeriodsCovariant; + [Key(7)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentEducationOrganizationAssociationStudentIndicatorPeriods { get @@ -137662,6 +160087,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentEducationOrganizationAssociationStudentIndicatorPeriods"); + } + foreach (var item in _studentEducationOrganizationAssociationStudentIndicatorPeriods) if (item.StudentEducationOrganizationAssociationStudentIndicator == null) item.StudentEducationOrganizationAssociationStudentIndicator = this; @@ -137713,7 +160143,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("IndicatorName", IndicatorName); @@ -137801,6 +160231,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationStudentIndicatorPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentIndicatorPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -137808,8 +160239,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationStudentIndicatorPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -137817,7 +160248,7 @@ public StudentEducationOrganizationAssociationStudentIndicatorPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociationStudentIndicator StudentEducationOrganizationAssociationStudentIndicator { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentIndicator IStudentEducationOrganizationAssociationStudentIndicatorPeriod.StudentEducationOrganizationAssociationStudentIndicator @@ -137827,6 +160258,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociationStudentIndicator IS } [DomainSignature] + [Key(1)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -137846,6 +160278,7 @@ public virtual DateTime BeginDate // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual DateTime? EndDate { get { return _endDate; } @@ -137877,14 +160310,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentIndicatorPeriod")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -137903,7 +160349,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationStudentIndicatorPeriod")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -137930,7 +160416,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociationStudentIndicator as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociationStudentIndicator as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("BeginDate", BeginDate); @@ -138018,6 +160504,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationTelephone : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationTelephone, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -138025,8 +160512,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationTelephone() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -138034,7 +160521,7 @@ public StudentEducationOrganizationAssociationTelephone() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationTelephone.StudentEducationOrganizationAssociation @@ -138044,8 +160531,10 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual string TelephoneNumber { get; set; } [DomainSignature] + [Key(2)] public virtual int TelephoneNumberTypeDescriptorId { get @@ -138065,6 +160554,7 @@ public virtual int TelephoneNumberTypeDescriptorId private int _telephoneNumberTypeDescriptorId; private string _telephoneNumberTypeDescriptor; + [IgnoreMember] public virtual string TelephoneNumberTypeDescriptor { get @@ -138090,8 +160580,11 @@ public virtual string TelephoneNumberTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(3)] public virtual bool? DoNotPublishIndicator { get; set; } + [Key(4)] public virtual int? OrderOfPriority { get; set; } + [Key(5)] public virtual bool? TextMessageCapabilityIndicator { get; set; } // ------------------------------------------------------------- @@ -138105,14 +160598,27 @@ public virtual string TelephoneNumberTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationTelephone")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -138131,7 +160637,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationTelephone")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -138159,7 +160705,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TelephoneNumber", TelephoneNumber); @@ -138248,6 +160794,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationAssociationTribalAffiliation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentEducationOrganizationAssociationTribalAffiliation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -138255,8 +160802,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationAssociationTribalAffiliation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -138264,7 +160811,7 @@ public StudentEducationOrganizationAssociationTribalAffiliation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentEducationOrganizationAssociation StudentEducationOrganizationAssociation { get; set; } Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationOrganizationAssociationTribalAffiliation.StudentEducationOrganizationAssociation @@ -138274,6 +160821,7 @@ Entities.Common.EdFi.IStudentEducationOrganizationAssociation IStudentEducationO } [DomainSignature] + [Key(1)] public virtual int TribalAffiliationDescriptorId { get @@ -138293,6 +160841,7 @@ public virtual int TribalAffiliationDescriptorId private int _tribalAffiliationDescriptorId; private string _tribalAffiliationDescriptor; + [IgnoreMember] public virtual string TribalAffiliationDescriptor { get @@ -138330,14 +160879,27 @@ public virtual string TribalAffiliationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationTribalAffiliation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -138356,7 +160918,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationAssociation", "StudentEducationOrganizationAssociationTribalAffiliation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -138384,7 +160986,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentEducationOrganizationAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TribalAffiliationDescriptorId", TribalAffiliationDescriptorId); @@ -138472,26 +161074,33 @@ namespace EdFi.Ods.Entities.NHibernate.StudentEducationOrganizationResponsibilit /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentEducationOrganizationResponsibilityAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual int ResponsibilityDescriptorId { get; set; } + [Key(3)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -138559,6 +161168,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentEducationOrganizationResponsibilityAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentEducationOrganizationResponsibilityAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -138566,8 +161176,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentEducationOrganizationResponsibilityAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -138576,6 +161186,7 @@ public StudentEducationOrganizationResponsibilityAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -138586,8 +161197,10 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual int ResponsibilityDescriptorId { get @@ -138607,6 +161220,7 @@ public virtual int ResponsibilityDescriptorId private int _responsibilityDescriptorId; private string _responsibilityDescriptor; + [IgnoreMember] public virtual string ResponsibilityDescriptor { get @@ -138623,6 +161237,7 @@ public virtual string ResponsibilityDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(9)] public virtual int StudentUSI { get @@ -138648,6 +161263,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -138681,6 +161297,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual DateTime? EndDate { get { return _endDate; } @@ -138712,14 +161329,27 @@ public virtual DateTime? EndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentEducationOrganizationResponsibilityAssociation", "StudentEducationOrganizationResponsibilityAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -138738,12 +161368,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentEducationOrganizationResponsibilityAssociation", "StudentEducationOrganizationResponsibilityAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -138764,6 +161435,7 @@ string Entities.Common.EdFi.IStudentEducationOrganizationResponsibilityAssociati set { } } + [Key(14)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -138893,25 +161565,31 @@ namespace EdFi.Ods.Entities.NHibernate.StudentGradebookEntryAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentGradebookEntryReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string GradebookEntryIdentifier { get; set; } + [Key(1)] public virtual string Namespace { get; set; } + [Key(2)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -138978,6 +161656,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentGradebookEntry : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentGradebookEntry, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -138985,8 +161664,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentGradebookEntry() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -138995,10 +161674,13 @@ public StudentGradebookEntry() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string GradebookEntryIdentifier { get; set; } [DomainSignature] + [Key(7)] public virtual string Namespace { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] public virtual int StudentUSI { get @@ -139024,6 +161706,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -139057,6 +161740,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual int? AssignmentLateStatusDescriptorId { get @@ -139076,6 +161760,7 @@ public virtual int? AssignmentLateStatusDescriptorId private int? _assignmentLateStatusDescriptorId; private string _assignmentLateStatusDescriptor; + [IgnoreMember] public virtual string AssignmentLateStatusDescriptor { get @@ -139091,6 +161776,7 @@ public virtual string AssignmentLateStatusDescriptor _assignmentLateStatusDescriptorId = default(int?); } } + [Key(10)] public virtual int? CompetencyLevelDescriptorId { get @@ -139110,6 +161796,7 @@ public virtual int? CompetencyLevelDescriptorId private int? _competencyLevelDescriptorId; private string _competencyLevelDescriptor; + [IgnoreMember] public virtual string CompetencyLevelDescriptor { get @@ -139125,6 +161812,7 @@ public virtual string CompetencyLevelDescriptor _competencyLevelDescriptorId = default(int?); } } + [Key(11)] public virtual DateTime? DateFulfilled { get { return _dateFulfilled; } @@ -139144,10 +161832,15 @@ public virtual DateTime? DateFulfilled private DateTime? _dateFulfilled; + [Key(12)] public virtual string DiagnosticStatement { get; set; } + [Key(13)] public virtual string LetterGradeEarned { get; set; } + [Key(14)] public virtual decimal? NumericGradeEarned { get; set; } + [Key(15)] public virtual decimal? PointsEarned { get; set; } + [Key(16)] public virtual int? SubmissionStatusDescriptorId { get @@ -139167,6 +161860,7 @@ public virtual int? SubmissionStatusDescriptorId private int? _submissionStatusDescriptorId; private string _submissionStatusDescriptor; + [IgnoreMember] public virtual string SubmissionStatusDescriptor { get @@ -139182,6 +161876,7 @@ public virtual string SubmissionStatusDescriptor _submissionStatusDescriptorId = default(int?); } } + [Key(17)] public virtual TimeSpan? TimeFulfilled { get; set; } // ------------------------------------------------------------- @@ -139195,14 +161890,27 @@ public virtual string SubmissionStatusDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentGradebookEntry", "StudentGradebookEntry")] + [Key(18)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -139221,12 +161929,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentGradebookEntry", "StudentGradebookEntry")] + [Key(19)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(20)] public virtual NHibernate.GradebookEntryAggregate.EdFi.GradebookEntryReferenceData GradebookEntryReferenceData { get; set; } /// @@ -139247,6 +161996,7 @@ string Entities.Common.EdFi.IStudentGradebookEntry.GradebookEntryDiscriminator set { } } + [Key(21)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -139377,24 +162127,29 @@ namespace EdFi.Ods.Entities.NHibernate.StudentHealthAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentHealthReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -139460,6 +162215,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentHealth : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentHealth, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -139469,8 +162225,8 @@ public StudentHealth() { StudentHealthAdditionalImmunizations = new HashSet(); StudentHealthRequiredImmunizations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -139479,8 +162235,10 @@ public StudentHealth() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(7)] public virtual int StudentUSI { get @@ -139506,6 +162264,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -139539,6 +162298,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual DateTime AsOfDate { get { return _asOfDate; } @@ -139548,6 +162308,7 @@ public virtual DateTime AsOfDate private DateTime _asOfDate; + [Key(9)] public virtual DateTime? NonMedicalImmunizationExemptionDate { get { return _nonMedicalImmunizationExemptionDate; } @@ -139567,6 +162328,7 @@ public virtual DateTime? NonMedicalImmunizationExemptionDate private DateTime? _nonMedicalImmunizationExemptionDate; + [Key(10)] public virtual int? NonMedicalImmunizationExemptionDescriptorId { get @@ -139586,6 +162348,7 @@ public virtual int? NonMedicalImmunizationExemptionDescriptorId private int? _nonMedicalImmunizationExemptionDescriptorId; private string _nonMedicalImmunizationExemptionDescriptor; + [IgnoreMember] public virtual string NonMedicalImmunizationExemptionDescriptor { get @@ -139613,14 +162376,27 @@ public virtual string NonMedicalImmunizationExemptionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentHealth", "StudentHealth")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -139639,12 +162415,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentHealth", "StudentHealth")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -139665,6 +162482,7 @@ string Entities.Common.EdFi.IStudentHealth.EducationOrganizationDiscriminator set { } } + [Key(14)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -139693,6 +162511,8 @@ string Entities.Common.EdFi.IStudentHealth.StudentDiscriminator private ICollection _studentHealthAdditionalImmunizations; private ICollection _studentHealthAdditionalImmunizationsCovariant; + [Key(15)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentHealthAdditionalImmunizations { get @@ -139702,6 +162522,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentHealthAdditionalImmunizations"); + } + foreach (var item in _studentHealthAdditionalImmunizations) if (item.StudentHealth == null) item.StudentHealth = this; @@ -139740,6 +162565,8 @@ public virtual ICollection _studentHealthRequiredImmunizations; private ICollection _studentHealthRequiredImmunizationsCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentHealthRequiredImmunizations { get @@ -139749,6 +162576,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentHealthRequiredImmunizations"); + } + foreach (var item in _studentHealthRequiredImmunizations) if (item.StudentHealth == null) item.StudentHealth = this; @@ -139886,6 +162718,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentHealthAdditionalImmunization : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentHealthAdditionalImmunization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -139894,8 +162727,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentHealthAdditionalImmunization() { StudentHealthAdditionalImmunizationDates = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -139903,7 +162736,7 @@ public StudentHealthAdditionalImmunization() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentHealth StudentHealth { get; set; } Entities.Common.EdFi.IStudentHealth IStudentHealthAdditionalImmunization.StudentHealth @@ -139913,6 +162746,7 @@ Entities.Common.EdFi.IStudentHealth IStudentHealthAdditionalImmunization.Student } [DomainSignature] + [Key(1)] public virtual string ImmunizationName { get; set; } // ------------------------------------------------------------- @@ -139936,14 +162770,27 @@ Entities.Common.EdFi.IStudentHealth IStudentHealthAdditionalImmunization.Student // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthAdditionalImmunization")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -139962,7 +162809,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthAdditionalImmunization")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -139976,6 +162863,8 @@ public IDictionary Extensions private ICollection _studentHealthAdditionalImmunizationDates; private ICollection _studentHealthAdditionalImmunizationDatesCovariant; + [Key(4)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentHealthAdditionalImmunizationDates { get @@ -139985,6 +162874,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentHealthAdditionalImmunizationDates"); + } + foreach (var item in _studentHealthAdditionalImmunizationDates) if (item.StudentHealthAdditionalImmunization == null) item.StudentHealthAdditionalImmunization = this; @@ -140036,7 +162930,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentHealth as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentHealth as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ImmunizationName", ImmunizationName); @@ -140124,6 +163018,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentHealthAdditionalImmunizationDate : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentHealthAdditionalImmunizationDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -140131,8 +163026,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentHealthAdditionalImmunizationDate() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -140140,7 +163035,7 @@ public StudentHealthAdditionalImmunizationDate() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentHealthAdditionalImmunization StudentHealthAdditionalImmunization { get; set; } Entities.Common.EdFi.IStudentHealthAdditionalImmunization IStudentHealthAdditionalImmunizationDate.StudentHealthAdditionalImmunization @@ -140150,6 +163045,7 @@ Entities.Common.EdFi.IStudentHealthAdditionalImmunization IStudentHealthAddition } [DomainSignature] + [Key(1)] public virtual DateTime ImmunizationDate { get { return _immunizationDate; } @@ -140181,14 +163077,27 @@ public virtual DateTime ImmunizationDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthAdditionalImmunizationDate")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -140207,7 +163116,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthAdditionalImmunizationDate")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -140234,7 +163183,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentHealthAdditionalImmunization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentHealthAdditionalImmunization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ImmunizationDate", ImmunizationDate); @@ -140322,6 +163271,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentHealthRequiredImmunization : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentHealthRequiredImmunization, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -140330,8 +163280,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentHealthRequiredImmunization() { StudentHealthRequiredImmunizationDates = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -140339,7 +163289,7 @@ public StudentHealthRequiredImmunization() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentHealth StudentHealth { get; set; } Entities.Common.EdFi.IStudentHealth IStudentHealthRequiredImmunization.StudentHealth @@ -140349,6 +163299,7 @@ Entities.Common.EdFi.IStudentHealth IStudentHealthRequiredImmunization.StudentHe } [DomainSignature] + [Key(1)] public virtual int ImmunizationTypeDescriptorId { get @@ -140368,6 +163319,7 @@ public virtual int ImmunizationTypeDescriptorId private int _immunizationTypeDescriptorId; private string _immunizationTypeDescriptor; + [IgnoreMember] public virtual string ImmunizationTypeDescriptor { get @@ -140393,7 +163345,9 @@ public virtual string ImmunizationTypeDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual string MedicalExemption { get; set; } + [Key(3)] public virtual DateTime? MedicalExemptionDate { get { return _medicalExemptionDate; } @@ -140425,14 +163379,27 @@ public virtual DateTime? MedicalExemptionDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthRequiredImmunization")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -140451,7 +163418,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthRequiredImmunization")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -140465,6 +163472,8 @@ public IDictionary Extensions private ICollection _studentHealthRequiredImmunizationDates; private ICollection _studentHealthRequiredImmunizationDatesCovariant; + [Key(6)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentHealthRequiredImmunizationDates { get @@ -140474,6 +163483,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentHealthRequiredImmunizationDates"); + } + foreach (var item in _studentHealthRequiredImmunizationDates) if (item.StudentHealthRequiredImmunization == null) item.StudentHealthRequiredImmunization = this; @@ -140526,7 +163540,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentHealth as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentHealth as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ImmunizationTypeDescriptorId", ImmunizationTypeDescriptorId); @@ -140614,6 +163628,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentHealthRequiredImmunizationDate : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentHealthRequiredImmunizationDate, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -140621,8 +163636,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentHealthRequiredImmunizationDate() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -140630,7 +163645,7 @@ public StudentHealthRequiredImmunizationDate() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentHealthRequiredImmunization StudentHealthRequiredImmunization { get; set; } Entities.Common.EdFi.IStudentHealthRequiredImmunization IStudentHealthRequiredImmunizationDate.StudentHealthRequiredImmunization @@ -140640,6 +163655,7 @@ Entities.Common.EdFi.IStudentHealthRequiredImmunization IStudentHealthRequiredIm } [DomainSignature] + [Key(1)] public virtual DateTime ImmunizationDate { get { return _immunizationDate; } @@ -140671,14 +163687,27 @@ public virtual DateTime ImmunizationDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthRequiredImmunizationDate")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -140697,7 +163726,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentHealth", "StudentHealthRequiredImmunizationDate")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -140725,7 +163794,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentHealthRequiredImmunization as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentHealthRequiredImmunization as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ImmunizationDate", ImmunizationDate); @@ -140818,14 +163887,15 @@ namespace EdFi.Ods.Entities.NHibernate.StudentHomelessProgramAssociationAggregat /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentHomelessProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentHomelessProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentHomelessProgramAssociation() { StudentHomelessProgramAssociationHomelessProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -140834,14 +163904,19 @@ public StudentHomelessProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -140861,6 +163936,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -140877,6 +163953,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -140902,6 +163979,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -140950,7 +164028,9 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual bool? AwaitingFosterCare { get; set; } + [Key(20)] public virtual int? HomelessPrimaryNighttimeResidenceDescriptorId { get @@ -140970,6 +164050,7 @@ public virtual int? HomelessPrimaryNighttimeResidenceDescriptorId private int? _homelessPrimaryNighttimeResidenceDescriptorId; private string _homelessPrimaryNighttimeResidenceDescriptor; + [IgnoreMember] public virtual string HomelessPrimaryNighttimeResidenceDescriptor { get @@ -140985,6 +164066,7 @@ public virtual string HomelessPrimaryNighttimeResidenceDescriptor _homelessPrimaryNighttimeResidenceDescriptorId = default(int?); } } + [Key(21)] public virtual bool? HomelessUnaccompaniedYouth { get; set; } // ------------------------------------------------------------- @@ -140998,14 +164080,27 @@ public virtual string HomelessPrimaryNighttimeResidenceDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentHomelessProgramAssociation", "StudentHomelessProgramAssociation")] + [Key(22)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -141024,7 +164119,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentHomelessProgramAssociation", "StudentHomelessProgramAssociation")] + [Key(23)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -141038,6 +164173,8 @@ public IDictionary Extensions private ICollection _studentHomelessProgramAssociationHomelessProgramServices; private ICollection _studentHomelessProgramAssociationHomelessProgramServicesCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentHomelessProgramAssociationHomelessProgramServices { get @@ -141047,6 +164184,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentHomelessProgramAssociationHomelessProgramServices"); + } + foreach (var item in _studentHomelessProgramAssociationHomelessProgramServices) if (item.StudentHomelessProgramAssociation == null) item.StudentHomelessProgramAssociation = this; @@ -141190,6 +164332,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentHomelessProgramAssociationHomelessProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentHomelessProgramAssociationHomelessProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -141197,8 +164340,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentHomelessProgramAssociationHomelessProgramService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -141206,7 +164349,7 @@ public StudentHomelessProgramAssociationHomelessProgramService() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentHomelessProgramAssociation StudentHomelessProgramAssociation { get; set; } Entities.Common.EdFi.IStudentHomelessProgramAssociation IStudentHomelessProgramAssociationHomelessProgramService.StudentHomelessProgramAssociation @@ -141216,6 +164359,7 @@ Entities.Common.EdFi.IStudentHomelessProgramAssociation IStudentHomelessProgramA } [DomainSignature] + [Key(1)] public virtual int HomelessProgramServiceDescriptorId { get @@ -141235,6 +164379,7 @@ public virtual int HomelessProgramServiceDescriptorId private int _homelessProgramServiceDescriptorId; private string _homelessProgramServiceDescriptor; + [IgnoreMember] public virtual string HomelessProgramServiceDescriptor { get @@ -141260,7 +164405,9 @@ public virtual string HomelessProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -141280,6 +164427,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -141311,14 +164459,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentHomelessProgramAssociation", "StudentHomelessProgramAssociationHomelessProgramService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -141337,7 +164498,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentHomelessProgramAssociation", "StudentHomelessProgramAssociationHomelessProgramService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -141366,7 +164567,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentHomelessProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentHomelessProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("HomelessProgramServiceDescriptorId", HomelessProgramServiceDescriptorId); @@ -141459,6 +164660,7 @@ namespace EdFi.Ods.Entities.NHibernate.StudentIdentificationSystemDescriptorAggr /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentIdentificationSystemDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IStudentIdentificationSystemDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -141467,6 +164669,7 @@ public class StudentIdentificationSystemDescriptor : DescriptorAggregate.EdFi.De // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int StudentIdentificationSystemDescriptorId { get { return base.DescriptorId; } @@ -141633,25 +164836,31 @@ namespace EdFi.Ods.Entities.NHibernate.StudentInterventionAssociationAggregate.E /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentInterventionAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string InterventionIdentificationCode { get; set; } + [Key(2)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -141718,6 +164927,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentInterventionAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentInterventionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -141726,8 +164936,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentInterventionAssociation() { StudentInterventionAssociationInterventionEffectivenesses = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -141736,10 +164946,13 @@ public StudentInterventionAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string InterventionIdentificationCode { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] public virtual int StudentUSI { get @@ -141765,6 +164978,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -141798,9 +165012,13 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual long? CohortEducationOrganizationId { get; set; } + [Key(10)] public virtual string CohortIdentifier { get; set; } + [Key(11)] public virtual string DiagnosticStatement { get; set; } + [Key(12)] public virtual int? Dosage { get; set; } // ------------------------------------------------------------- @@ -141814,14 +165032,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentInterventionAssociation", "StudentInterventionAssociation")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -141840,12 +165071,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentInterventionAssociation", "StudentInterventionAssociation")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.CohortAggregate.EdFi.CohortReferenceData CohortReferenceData { get; set; } /// @@ -141866,6 +165138,7 @@ string Entities.Common.EdFi.IStudentInterventionAssociation.CohortDiscriminator set { } } + [Key(16)] public virtual NHibernate.InterventionAggregate.EdFi.InterventionReferenceData InterventionReferenceData { get; set; } /// @@ -141886,6 +165159,7 @@ string Entities.Common.EdFi.IStudentInterventionAssociation.InterventionDiscrimi set { } } + [Key(17)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -141914,6 +165188,8 @@ string Entities.Common.EdFi.IStudentInterventionAssociation.StudentDiscriminator private ICollection _studentInterventionAssociationInterventionEffectivenesses; private ICollection _studentInterventionAssociationInterventionEffectivenessesCovariant; + [Key(18)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentInterventionAssociationInterventionEffectivenesses { get @@ -141923,6 +165199,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentInterventionAssociationInterventionEffectivenesses"); + } + foreach (var item in _studentInterventionAssociationInterventionEffectivenesses) if (item.StudentInterventionAssociation == null) item.StudentInterventionAssociation = this; @@ -142060,6 +165341,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentInterventionAssociationInterventionEffectiveness : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentInterventionAssociationInterventionEffectiveness, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -142067,8 +165349,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentInterventionAssociationInterventionEffectiveness() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -142076,7 +165358,7 @@ public StudentInterventionAssociationInterventionEffectiveness() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentInterventionAssociation StudentInterventionAssociation { get; set; } Entities.Common.EdFi.IStudentInterventionAssociation IStudentInterventionAssociationInterventionEffectiveness.StudentInterventionAssociation @@ -142086,6 +165368,7 @@ Entities.Common.EdFi.IStudentInterventionAssociation IStudentInterventionAssocia } [DomainSignature] + [Key(1)] public virtual int DiagnosisDescriptorId { get @@ -142105,6 +165388,7 @@ public virtual int DiagnosisDescriptorId private int _diagnosisDescriptorId; private string _diagnosisDescriptor; + [IgnoreMember] public virtual string DiagnosisDescriptor { get @@ -142121,6 +165405,7 @@ public virtual string DiagnosisDescriptor } } [DomainSignature] + [Key(2)] public virtual int GradeLevelDescriptorId { get @@ -142140,6 +165425,7 @@ public virtual int GradeLevelDescriptorId private int _gradeLevelDescriptorId; private string _gradeLevelDescriptor; + [IgnoreMember] public virtual string GradeLevelDescriptor { get @@ -142156,6 +165442,7 @@ public virtual string GradeLevelDescriptor } } [DomainSignature] + [Key(3)] public virtual int PopulationServedDescriptorId { get @@ -142175,6 +165462,7 @@ public virtual int PopulationServedDescriptorId private int _populationServedDescriptorId; private string _populationServedDescriptor; + [IgnoreMember] public virtual string PopulationServedDescriptor { get @@ -142200,7 +165488,9 @@ public virtual string PopulationServedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(4)] public virtual int? ImprovementIndex { get; set; } + [Key(5)] public virtual int InterventionEffectivenessRatingDescriptorId { get @@ -142220,6 +165510,7 @@ public virtual int InterventionEffectivenessRatingDescriptorId private int _interventionEffectivenessRatingDescriptorId; private string _interventionEffectivenessRatingDescriptor; + [IgnoreMember] public virtual string InterventionEffectivenessRatingDescriptor { get @@ -142247,14 +165538,27 @@ public virtual string InterventionEffectivenessRatingDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentInterventionAssociation", "StudentInterventionAssociationInterventionEffectiveness")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -142273,7 +165577,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentInterventionAssociation", "StudentInterventionAssociationInterventionEffectiveness")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -142304,7 +165648,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentInterventionAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentInterventionAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DiagnosisDescriptorId", DiagnosisDescriptorId); @@ -142394,27 +165738,35 @@ namespace EdFi.Ods.Entities.NHibernate.StudentInterventionAttendanceEventAggrega /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentInterventionAttendanceEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int AttendanceEventCategoryDescriptorId { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual DateTime EventDate { get; set; } + [Key(3)] public virtual string InterventionIdentificationCode { get; set; } + [Key(4)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -142483,6 +165835,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentInterventionAttendanceEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentInterventionAttendanceEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -142490,8 +165843,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentInterventionAttendanceEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -142500,6 +165853,7 @@ public StudentInterventionAttendanceEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int AttendanceEventCategoryDescriptorId { get @@ -142519,6 +165873,7 @@ public virtual int AttendanceEventCategoryDescriptorId private int _attendanceEventCategoryDescriptorId; private string _attendanceEventCategoryDescriptor; + [IgnoreMember] public virtual string AttendanceEventCategoryDescriptor { get @@ -142535,8 +165890,10 @@ public virtual string AttendanceEventCategoryDescriptor } } [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual DateTime EventDate { get { return _eventDate; } @@ -142547,8 +165904,10 @@ public virtual DateTime EventDate private DateTime _eventDate; [DomainSignature] + [Key(9)] public virtual string InterventionIdentificationCode { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(10)] public virtual int StudentUSI { get @@ -142574,6 +165933,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -142607,7 +165967,9 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(11)] public virtual string AttendanceEventReason { get; set; } + [Key(12)] public virtual int? EducationalEnvironmentDescriptorId { get @@ -142627,6 +165989,7 @@ public virtual int? EducationalEnvironmentDescriptorId private int? _educationalEnvironmentDescriptorId; private string _educationalEnvironmentDescriptor; + [IgnoreMember] public virtual string EducationalEnvironmentDescriptor { get @@ -142642,7 +166005,9 @@ public virtual string EducationalEnvironmentDescriptor _educationalEnvironmentDescriptorId = default(int?); } } + [Key(13)] public virtual decimal? EventDuration { get; set; } + [Key(14)] public virtual int? InterventionDuration { get; set; } // ------------------------------------------------------------- @@ -142656,14 +166021,27 @@ public virtual string EducationalEnvironmentDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentInterventionAttendanceEvent", "StudentInterventionAttendanceEvent")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -142682,12 +166060,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentInterventionAttendanceEvent", "StudentInterventionAttendanceEvent")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.InterventionAggregate.EdFi.InterventionReferenceData InterventionReferenceData { get; set; } /// @@ -142708,6 +166127,7 @@ string Entities.Common.EdFi.IStudentInterventionAttendanceEvent.InterventionDisc set { } } + [Key(18)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -142844,6 +166264,7 @@ namespace EdFi.Ods.Entities.NHibernate.StudentLanguageInstructionProgramAssociat /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentLanguageInstructionProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -142851,8 +166272,8 @@ public StudentLanguageInstructionProgramAssociation() { StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessments = new HashSet(); StudentLanguageInstructionProgramAssociationLanguageInstructionProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -142861,14 +166282,19 @@ public StudentLanguageInstructionProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -142888,6 +166314,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -142904,6 +166331,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -142929,6 +166357,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -142977,7 +166406,9 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual int? Dosage { get; set; } + [Key(20)] public virtual bool? EnglishLearnerParticipation { get; set; } // ------------------------------------------------------------- @@ -142991,14 +166422,27 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentLanguageInstructionProgramAssociation", "StudentLanguageInstructionProgramAssociation")] + [Key(21)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -143017,7 +166461,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentLanguageInstructionProgramAssociation", "StudentLanguageInstructionProgramAssociation")] + [Key(22)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -143031,6 +166515,8 @@ public IDictionary Extensions private ICollection _studentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessments; private ICollection _studentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessmentsCovariant; + [Key(23)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessments { get @@ -143040,6 +166526,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessments"); + } + foreach (var item in _studentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessments) if (item.StudentLanguageInstructionProgramAssociation == null) item.StudentLanguageInstructionProgramAssociation = this; @@ -143078,6 +166569,8 @@ public virtual ICollection _studentLanguageInstructionProgramAssociationLanguageInstructionProgramServices; private ICollection _studentLanguageInstructionProgramAssociationLanguageInstructionProgramServicesCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentLanguageInstructionProgramAssociationLanguageInstructionProgramServices { get @@ -143087,6 +166580,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentLanguageInstructionProgramAssociationLanguageInstructionProgramServices"); + } + foreach (var item in _studentLanguageInstructionProgramAssociationLanguageInstructionProgramServices) if (item.StudentLanguageInstructionProgramAssociation == null) item.StudentLanguageInstructionProgramAssociation = this; @@ -143229,6 +166727,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessment : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessment, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -143236,8 +166735,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessment() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -143245,7 +166744,7 @@ public StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAss // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentLanguageInstructionProgramAssociation StudentLanguageInstructionProgramAssociation { get; set; } Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociation IStudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessment.StudentLanguageInstructionProgramAssociation @@ -143255,6 +166754,7 @@ Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociation IStudentLangu } [DomainSignature] + [Key(1)] public virtual short SchoolYear { get; set; } // ------------------------------------------------------------- @@ -143266,6 +166766,7 @@ Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociation IStudentLangu // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? MonitoredDescriptorId { get @@ -143285,6 +166786,7 @@ public virtual int? MonitoredDescriptorId private int? _monitoredDescriptorId; private string _monitoredDescriptor; + [IgnoreMember] public virtual string MonitoredDescriptor { get @@ -143300,6 +166802,7 @@ public virtual string MonitoredDescriptor _monitoredDescriptorId = default(int?); } } + [Key(3)] public virtual int? ParticipationDescriptorId { get @@ -143319,6 +166822,7 @@ public virtual int? ParticipationDescriptorId private int? _participationDescriptorId; private string _participationDescriptor; + [IgnoreMember] public virtual string ParticipationDescriptor { get @@ -143334,6 +166838,7 @@ public virtual string ParticipationDescriptor _participationDescriptorId = default(int?); } } + [Key(4)] public virtual int? ProficiencyDescriptorId { get @@ -143353,6 +166858,7 @@ public virtual int? ProficiencyDescriptorId private int? _proficiencyDescriptorId; private string _proficiencyDescriptor; + [IgnoreMember] public virtual string ProficiencyDescriptor { get @@ -143368,6 +166874,7 @@ public virtual string ProficiencyDescriptor _proficiencyDescriptorId = default(int?); } } + [Key(5)] public virtual int? ProgressDescriptorId { get @@ -143387,6 +166894,7 @@ public virtual int? ProgressDescriptorId private int? _progressDescriptorId; private string _progressDescriptor; + [IgnoreMember] public virtual string ProgressDescriptor { get @@ -143414,14 +166922,27 @@ public virtual string ProgressDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentLanguageInstructionProgramAssociation", "StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessment")] + [Key(6)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -143440,12 +166961,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentLanguageInstructionProgramAssociation", "StudentLanguageInstructionProgramAssociationEnglishLanguageProficiencyAssessment")] + [Key(7)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(8)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -143483,7 +167045,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentLanguageInstructionProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentLanguageInstructionProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SchoolYear", SchoolYear); @@ -143571,6 +167133,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentLanguageInstructionProgramAssociationLanguageInstructionProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociationLanguageInstructionProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -143578,8 +167141,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentLanguageInstructionProgramAssociationLanguageInstructionProgramService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -143587,7 +167150,7 @@ public StudentLanguageInstructionProgramAssociationLanguageInstructionProgramSer // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentLanguageInstructionProgramAssociation StudentLanguageInstructionProgramAssociation { get; set; } Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociation IStudentLanguageInstructionProgramAssociationLanguageInstructionProgramService.StudentLanguageInstructionProgramAssociation @@ -143597,6 +167160,7 @@ Entities.Common.EdFi.IStudentLanguageInstructionProgramAssociation IStudentLangu } [DomainSignature] + [Key(1)] public virtual int LanguageInstructionProgramServiceDescriptorId { get @@ -143616,6 +167180,7 @@ public virtual int LanguageInstructionProgramServiceDescriptorId private int _languageInstructionProgramServiceDescriptorId; private string _languageInstructionProgramServiceDescriptor; + [IgnoreMember] public virtual string LanguageInstructionProgramServiceDescriptor { get @@ -143641,7 +167206,9 @@ public virtual string LanguageInstructionProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -143661,6 +167228,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -143692,14 +167260,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentLanguageInstructionProgramAssociation", "StudentLanguageInstructionProgramAssociationLanguageInstructionProgramService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -143718,7 +167299,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentLanguageInstructionProgramAssociation", "StudentLanguageInstructionProgramAssociationLanguageInstructionProgramService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -143747,7 +167368,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentLanguageInstructionProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentLanguageInstructionProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("LanguageInstructionProgramServiceDescriptorId", LanguageInstructionProgramServiceDescriptorId); @@ -143840,14 +167461,15 @@ namespace EdFi.Ods.Entities.NHibernate.StudentMigrantEducationProgramAssociation /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentMigrantEducationProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentMigrantEducationProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentMigrantEducationProgramAssociation() { StudentMigrantEducationProgramAssociationMigrantEducationProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -143856,14 +167478,19 @@ public StudentMigrantEducationProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -143883,6 +167510,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -143899,6 +167527,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -143924,6 +167553,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -143972,6 +167602,7 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual int? ContinuationOfServicesReasonDescriptorId { get @@ -143991,6 +167622,7 @@ public virtual int? ContinuationOfServicesReasonDescriptorId private int? _continuationOfServicesReasonDescriptorId; private string _continuationOfServicesReasonDescriptor; + [IgnoreMember] public virtual string ContinuationOfServicesReasonDescriptor { get @@ -144006,6 +167638,7 @@ public virtual string ContinuationOfServicesReasonDescriptor _continuationOfServicesReasonDescriptorId = default(int?); } } + [Key(20)] public virtual DateTime? EligibilityExpirationDate { get { return _eligibilityExpirationDate; } @@ -144025,6 +167658,7 @@ public virtual DateTime? EligibilityExpirationDate private DateTime? _eligibilityExpirationDate; + [Key(21)] public virtual DateTime LastQualifyingMove { get { return _lastQualifyingMove; } @@ -144034,7 +167668,9 @@ public virtual DateTime LastQualifyingMove private DateTime _lastQualifyingMove; + [Key(22)] public virtual bool PriorityForServices { get; set; } + [Key(23)] public virtual DateTime? QualifyingArrivalDate { get { return _qualifyingArrivalDate; } @@ -144054,6 +167690,7 @@ public virtual DateTime? QualifyingArrivalDate private DateTime? _qualifyingArrivalDate; + [Key(24)] public virtual DateTime? StateResidencyDate { get { return _stateResidencyDate; } @@ -144073,6 +167710,7 @@ public virtual DateTime? StateResidencyDate private DateTime? _stateResidencyDate; + [Key(25)] public virtual DateTime? USInitialEntry { get { return _usInitialEntry; } @@ -144092,6 +167730,7 @@ public virtual DateTime? USInitialEntry private DateTime? _usInitialEntry; + [Key(26)] public virtual DateTime? USInitialSchoolEntry { get { return _usInitialSchoolEntry; } @@ -144111,6 +167750,7 @@ public virtual DateTime? USInitialSchoolEntry private DateTime? _usInitialSchoolEntry; + [Key(27)] public virtual DateTime? USMostRecentEntry { get { return _usMostRecentEntry; } @@ -144142,14 +167782,27 @@ public virtual DateTime? USMostRecentEntry // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentMigrantEducationProgramAssociation", "StudentMigrantEducationProgramAssociation")] + [Key(28)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -144168,7 +167821,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentMigrantEducationProgramAssociation", "StudentMigrantEducationProgramAssociation")] + [Key(29)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -144182,6 +167875,8 @@ public IDictionary Extensions private ICollection _studentMigrantEducationProgramAssociationMigrantEducationProgramServices; private ICollection _studentMigrantEducationProgramAssociationMigrantEducationProgramServicesCovariant; + [Key(30)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentMigrantEducationProgramAssociationMigrantEducationProgramServices { get @@ -144191,6 +167886,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentMigrantEducationProgramAssociationMigrantEducationProgramServices"); + } + foreach (var item in _studentMigrantEducationProgramAssociationMigrantEducationProgramServices) if (item.StudentMigrantEducationProgramAssociation == null) item.StudentMigrantEducationProgramAssociation = this; @@ -144334,6 +168034,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentMigrantEducationProgramAssociationMigrantEducationProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentMigrantEducationProgramAssociationMigrantEducationProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -144341,8 +168042,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentMigrantEducationProgramAssociationMigrantEducationProgramService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -144350,7 +168051,7 @@ public StudentMigrantEducationProgramAssociationMigrantEducationProgramService() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentMigrantEducationProgramAssociation StudentMigrantEducationProgramAssociation { get; set; } Entities.Common.EdFi.IStudentMigrantEducationProgramAssociation IStudentMigrantEducationProgramAssociationMigrantEducationProgramService.StudentMigrantEducationProgramAssociation @@ -144360,6 +168061,7 @@ Entities.Common.EdFi.IStudentMigrantEducationProgramAssociation IStudentMigrantE } [DomainSignature] + [Key(1)] public virtual int MigrantEducationProgramServiceDescriptorId { get @@ -144379,6 +168081,7 @@ public virtual int MigrantEducationProgramServiceDescriptorId private int _migrantEducationProgramServiceDescriptorId; private string _migrantEducationProgramServiceDescriptor; + [IgnoreMember] public virtual string MigrantEducationProgramServiceDescriptor { get @@ -144404,7 +168107,9 @@ public virtual string MigrantEducationProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -144424,6 +168129,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -144455,14 +168161,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentMigrantEducationProgramAssociation", "StudentMigrantEducationProgramAssociationMigrantEducationProgramService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -144481,7 +168200,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentMigrantEducationProgramAssociation", "StudentMigrantEducationProgramAssociationMigrantEducationProgramService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -144510,7 +168269,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentMigrantEducationProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentMigrantEducationProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("MigrantEducationProgramServiceDescriptorId", MigrantEducationProgramServiceDescriptorId); @@ -144603,14 +168362,15 @@ namespace EdFi.Ods.Entities.NHibernate.StudentNeglectedOrDelinquentProgramAssoci /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentNeglectedOrDelinquentProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentNeglectedOrDelinquentProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentNeglectedOrDelinquentProgramAssociation() { StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -144619,14 +168379,19 @@ public StudentNeglectedOrDelinquentProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -144646,6 +168411,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -144662,6 +168428,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -144687,6 +168454,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -144735,6 +168503,7 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual int? ELAProgressLevelDescriptorId { get @@ -144754,6 +168523,7 @@ public virtual int? ELAProgressLevelDescriptorId private int? _elaProgressLevelDescriptorId; private string _elaProgressLevelDescriptor; + [IgnoreMember] public virtual string ELAProgressLevelDescriptor { get @@ -144769,6 +168539,7 @@ public virtual string ELAProgressLevelDescriptor _elaProgressLevelDescriptorId = default(int?); } } + [Key(20)] public virtual int? MathematicsProgressLevelDescriptorId { get @@ -144788,6 +168559,7 @@ public virtual int? MathematicsProgressLevelDescriptorId private int? _mathematicsProgressLevelDescriptorId; private string _mathematicsProgressLevelDescriptor; + [IgnoreMember] public virtual string MathematicsProgressLevelDescriptor { get @@ -144803,6 +168575,7 @@ public virtual string MathematicsProgressLevelDescriptor _mathematicsProgressLevelDescriptorId = default(int?); } } + [Key(21)] public virtual int? NeglectedOrDelinquentProgramDescriptorId { get @@ -144822,6 +168595,7 @@ public virtual int? NeglectedOrDelinquentProgramDescriptorId private int? _neglectedOrDelinquentProgramDescriptorId; private string _neglectedOrDelinquentProgramDescriptor; + [IgnoreMember] public virtual string NeglectedOrDelinquentProgramDescriptor { get @@ -144849,14 +168623,27 @@ public virtual string NeglectedOrDelinquentProgramDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentNeglectedOrDelinquentProgramAssociation", "StudentNeglectedOrDelinquentProgramAssociation")] + [Key(22)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -144875,7 +168662,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentNeglectedOrDelinquentProgramAssociation", "StudentNeglectedOrDelinquentProgramAssociation")] + [Key(23)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -144889,6 +168716,8 @@ public IDictionary Extensions private ICollection _studentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramServices; private ICollection _studentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramServicesCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramServices { get @@ -144898,6 +168727,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramServices"); + } + foreach (var item in _studentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramServices) if (item.StudentNeglectedOrDelinquentProgramAssociation == null) item.StudentNeglectedOrDelinquentProgramAssociation = this; @@ -145043,6 +168877,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -145050,8 +168885,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -145059,7 +168894,7 @@ public StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgra // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentNeglectedOrDelinquentProgramAssociation StudentNeglectedOrDelinquentProgramAssociation { get; set; } Entities.Common.EdFi.IStudentNeglectedOrDelinquentProgramAssociation IStudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramService.StudentNeglectedOrDelinquentProgramAssociation @@ -145069,6 +168904,7 @@ Entities.Common.EdFi.IStudentNeglectedOrDelinquentProgramAssociation IStudentNeg } [DomainSignature] + [Key(1)] public virtual int NeglectedOrDelinquentProgramServiceDescriptorId { get @@ -145088,6 +168924,7 @@ public virtual int NeglectedOrDelinquentProgramServiceDescriptorId private int _neglectedOrDelinquentProgramServiceDescriptorId; private string _neglectedOrDelinquentProgramServiceDescriptor; + [IgnoreMember] public virtual string NeglectedOrDelinquentProgramServiceDescriptor { get @@ -145113,7 +168950,9 @@ public virtual string NeglectedOrDelinquentProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -145133,6 +168972,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -145164,14 +169004,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentNeglectedOrDelinquentProgramAssociation", "StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -145190,7 +169043,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentNeglectedOrDelinquentProgramAssociation", "StudentNeglectedOrDelinquentProgramAssociationNeglectedOrDelinquentProgramService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -145219,7 +169112,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentNeglectedOrDelinquentProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentNeglectedOrDelinquentProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("NeglectedOrDelinquentProgramServiceDescriptorId", NeglectedOrDelinquentProgramServiceDescriptorId); @@ -145312,14 +169205,15 @@ namespace EdFi.Ods.Entities.NHibernate.StudentProgramAssociationAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentProgramAssociation() { StudentProgramAssociationServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -145328,14 +169222,19 @@ public StudentProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -145355,6 +169254,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -145371,6 +169271,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -145396,6 +169297,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -145456,14 +169358,27 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentProgramAssociation", "StudentProgramAssociation")] + [Key(19)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -145482,7 +169397,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentProgramAssociation", "StudentProgramAssociation")] + [Key(20)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -145496,6 +169451,8 @@ public IDictionary Extensions private ICollection _studentProgramAssociationServices; private ICollection _studentProgramAssociationServicesCovariant; + [Key(21)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentProgramAssociationServices { get @@ -145505,6 +169462,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentProgramAssociationServices"); + } + foreach (var item in _studentProgramAssociationServices) if (item.StudentProgramAssociation == null) item.StudentProgramAssociation = this; @@ -145647,6 +169609,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentProgramAssociationService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentProgramAssociationService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -145654,8 +169617,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentProgramAssociationService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -145663,7 +169626,7 @@ public StudentProgramAssociationService() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentProgramAssociation StudentProgramAssociation { get; set; } Entities.Common.EdFi.IStudentProgramAssociation IStudentProgramAssociationService.StudentProgramAssociation @@ -145673,6 +169636,7 @@ Entities.Common.EdFi.IStudentProgramAssociation IStudentProgramAssociationServic } [DomainSignature] + [Key(1)] public virtual int ServiceDescriptorId { get @@ -145692,6 +169656,7 @@ public virtual int ServiceDescriptorId private int _serviceDescriptorId; private string _serviceDescriptor; + [IgnoreMember] public virtual string ServiceDescriptor { get @@ -145717,7 +169682,9 @@ public virtual string ServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -145737,6 +169704,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -145768,14 +169736,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentProgramAssociation", "StudentProgramAssociationService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -145794,7 +169775,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentProgramAssociation", "StudentProgramAssociationService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -145823,7 +169844,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ServiceDescriptorId", ServiceDescriptorId); @@ -145911,29 +169932,39 @@ namespace EdFi.Ods.Entities.NHibernate.StudentProgramAttendanceEventAggregate.Ed /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentProgramAttendanceEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int AttendanceEventCategoryDescriptorId { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual DateTime EventDate { get; set; } + [Key(3)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(4)] public virtual string ProgramName { get; set; } + [Key(5)] public virtual int ProgramTypeDescriptorId { get; set; } + [Key(6)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -146004,6 +170035,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentProgramAttendanceEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentProgramAttendanceEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -146011,8 +170043,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentProgramAttendanceEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -146021,6 +170053,7 @@ public StudentProgramAttendanceEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int AttendanceEventCategoryDescriptorId { get @@ -146040,6 +170073,7 @@ public virtual int AttendanceEventCategoryDescriptorId private int _attendanceEventCategoryDescriptorId; private string _attendanceEventCategoryDescriptor; + [IgnoreMember] public virtual string AttendanceEventCategoryDescriptor { get @@ -146056,8 +170090,10 @@ public virtual string AttendanceEventCategoryDescriptor } } [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual DateTime EventDate { get { return _eventDate; } @@ -146068,10 +170104,13 @@ public virtual DateTime EventDate private DateTime _eventDate; [DomainSignature] + [Key(9)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(10)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(11)] public virtual int ProgramTypeDescriptorId { get @@ -146091,6 +170130,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -146107,6 +170147,7 @@ public virtual string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(12)] public virtual int StudentUSI { get @@ -146132,6 +170173,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -146165,7 +170207,9 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(13)] public virtual string AttendanceEventReason { get; set; } + [Key(14)] public virtual int? EducationalEnvironmentDescriptorId { get @@ -146185,6 +170229,7 @@ public virtual int? EducationalEnvironmentDescriptorId private int? _educationalEnvironmentDescriptorId; private string _educationalEnvironmentDescriptor; + [IgnoreMember] public virtual string EducationalEnvironmentDescriptor { get @@ -146200,7 +170245,9 @@ public virtual string EducationalEnvironmentDescriptor _educationalEnvironmentDescriptorId = default(int?); } } + [Key(15)] public virtual decimal? EventDuration { get; set; } + [Key(16)] public virtual int? ProgramAttendanceDuration { get; set; } // ------------------------------------------------------------- @@ -146214,14 +170261,27 @@ public virtual string EducationalEnvironmentDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentProgramAttendanceEvent", "StudentProgramAttendanceEvent")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -146240,12 +170300,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentProgramAttendanceEvent", "StudentProgramAttendanceEvent")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(19)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -146266,6 +170367,7 @@ string Entities.Common.EdFi.IStudentProgramAttendanceEvent.EducationOrganization set { } } + [Key(20)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -146286,6 +170388,7 @@ string Entities.Common.EdFi.IStudentProgramAttendanceEvent.ProgramDiscriminator set { } } + [Key(21)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -146420,30 +170523,41 @@ namespace EdFi.Ods.Entities.NHibernate.StudentProgramEvaluationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentProgramEvaluationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime EvaluationDate { get; set; } + [Key(1)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(2)] public virtual int ProgramEvaluationPeriodDescriptorId { get; set; } + [Key(3)] public virtual string ProgramEvaluationTitle { get; set; } + [Key(4)] public virtual int ProgramEvaluationTypeDescriptorId { get; set; } + [Key(5)] public virtual string ProgramName { get; set; } + [Key(6)] public virtual int ProgramTypeDescriptorId { get; set; } + [Key(7)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(8)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(9)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -146515,6 +170629,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentProgramEvaluation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentProgramEvaluation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -146525,8 +170640,8 @@ public StudentProgramEvaluation() StudentProgramEvaluationExternalEvaluators = new HashSet(); StudentProgramEvaluationStudentEvaluationElements = new HashSet(); StudentProgramEvaluationStudentEvaluationObjectives = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -146535,6 +170650,7 @@ public StudentProgramEvaluation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime EvaluationDate { get { return _evaluationDate; } @@ -146545,8 +170661,10 @@ public virtual DateTime EvaluationDate private DateTime _evaluationDate; [DomainSignature] + [Key(7)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual int ProgramEvaluationPeriodDescriptorId { get @@ -146566,6 +170684,7 @@ public virtual int ProgramEvaluationPeriodDescriptorId private int _programEvaluationPeriodDescriptorId; private string _programEvaluationPeriodDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationPeriodDescriptor { get @@ -146582,8 +170701,10 @@ public virtual string ProgramEvaluationPeriodDescriptor } } [DomainSignature] + [Key(9)] public virtual string ProgramEvaluationTitle { get; set; } [DomainSignature] + [Key(10)] public virtual int ProgramEvaluationTypeDescriptorId { get @@ -146603,6 +170724,7 @@ public virtual int ProgramEvaluationTypeDescriptorId private int _programEvaluationTypeDescriptorId; private string _programEvaluationTypeDescriptor; + [IgnoreMember] public virtual string ProgramEvaluationTypeDescriptor { get @@ -146619,8 +170741,10 @@ public virtual string ProgramEvaluationTypeDescriptor } } [DomainSignature] + [Key(11)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(12)] public virtual int ProgramTypeDescriptorId { get @@ -146640,6 +170764,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -146656,6 +170781,7 @@ public virtual string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(13)] public virtual int StudentUSI { get @@ -146681,6 +170807,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -146714,8 +170841,11 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(14)] public virtual long? EducationOrganizationId { get; set; } + [Key(15)] public virtual int? EvaluationDuration { get; set; } + [Key(16)] public virtual int? StaffEvaluatorStaffUSI { get @@ -146745,6 +170875,7 @@ public virtual int? StaffEvaluatorStaffUSI private int? _staffEvaluatorStaffUSI; private string _staffEvaluatorStaffUniqueId; + [IgnoreMember] public virtual string StaffEvaluatorStaffUniqueId { get @@ -146768,8 +170899,11 @@ public virtual string StaffEvaluatorStaffUniqueId _staffEvaluatorStaffUniqueId = value; } } + [Key(17)] public virtual string SummaryEvaluationComment { get; set; } + [Key(18)] public virtual decimal? SummaryEvaluationNumericRating { get; set; } + [Key(19)] public virtual int? SummaryEvaluationRatingLevelDescriptorId { get @@ -146789,6 +170923,7 @@ public virtual int? SummaryEvaluationRatingLevelDescriptorId private int? _summaryEvaluationRatingLevelDescriptorId; private string _summaryEvaluationRatingLevelDescriptor; + [IgnoreMember] public virtual string SummaryEvaluationRatingLevelDescriptor { get @@ -146816,14 +170951,27 @@ public virtual string SummaryEvaluationRatingLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluation")] + [Key(20)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -146842,12 +170990,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluation")] + [Key(21)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(22)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -146868,6 +171057,7 @@ string Entities.Common.EdFi.IStudentProgramEvaluation.EducationOrganizationDiscr set { } } + [Key(23)] public virtual NHibernate.ProgramEvaluationAggregate.EdFi.ProgramEvaluationReferenceData ProgramEvaluationReferenceData { get; set; } /// @@ -146888,6 +171078,7 @@ string Entities.Common.EdFi.IStudentProgramEvaluation.ProgramEvaluationDiscrimin set { } } + [Key(24)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffEvaluatorStaffReferenceData { get; set; } /// @@ -146908,6 +171099,7 @@ string Entities.Common.EdFi.IStudentProgramEvaluation.StaffEvaluatorStaffDiscrim set { } } + [Key(25)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -146936,6 +171128,8 @@ string Entities.Common.EdFi.IStudentProgramEvaluation.StudentDiscriminator private ICollection _studentProgramEvaluationExternalEvaluators; private ICollection _studentProgramEvaluationExternalEvaluatorsCovariant; + [Key(26)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentProgramEvaluationExternalEvaluators { get @@ -146945,6 +171139,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentProgramEvaluationExternalEvaluators"); + } + foreach (var item in _studentProgramEvaluationExternalEvaluators) if (item.StudentProgramEvaluation == null) item.StudentProgramEvaluation = this; @@ -146983,6 +171182,8 @@ public virtual ICollection _studentProgramEvaluationStudentEvaluationElements; private ICollection _studentProgramEvaluationStudentEvaluationElementsCovariant; + [Key(27)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentProgramEvaluationStudentEvaluationElements { get @@ -146992,6 +171193,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentProgramEvaluationStudentEvaluationElements"); + } + foreach (var item in _studentProgramEvaluationStudentEvaluationElements) if (item.StudentProgramEvaluation == null) item.StudentProgramEvaluation = this; @@ -147030,6 +171236,8 @@ public virtual ICollection _studentProgramEvaluationStudentEvaluationObjectives; private ICollection _studentProgramEvaluationStudentEvaluationObjectivesCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentProgramEvaluationStudentEvaluationObjectives { get @@ -147039,6 +171247,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentProgramEvaluationStudentEvaluationObjectives"); + } + foreach (var item in _studentProgramEvaluationStudentEvaluationObjectives) if (item.StudentProgramEvaluation == null) item.StudentProgramEvaluation = this; @@ -147185,6 +171398,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentProgramEvaluationExternalEvaluator : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentProgramEvaluationExternalEvaluator, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -147192,8 +171406,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentProgramEvaluationExternalEvaluator() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -147201,7 +171415,7 @@ public StudentProgramEvaluationExternalEvaluator() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentProgramEvaluation StudentProgramEvaluation { get; set; } Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationExternalEvaluator.StudentProgramEvaluation @@ -147211,6 +171425,7 @@ Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationExternal } [DomainSignature] + [Key(1)] public virtual string ExternalEvaluator { get; set; } // ------------------------------------------------------------- @@ -147234,14 +171449,27 @@ Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationExternal // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluationExternalEvaluator")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -147260,7 +171488,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluationExternalEvaluator")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -147290,7 +171558,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentProgramEvaluation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentProgramEvaluation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ExternalEvaluator", ExternalEvaluator); @@ -147378,6 +171646,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentProgramEvaluationStudentEvaluationElement : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentProgramEvaluationStudentEvaluationElement, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -147385,8 +171654,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentProgramEvaluationStudentEvaluationElement() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -147394,7 +171663,7 @@ public StudentProgramEvaluationStudentEvaluationElement() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentProgramEvaluation StudentProgramEvaluation { get; set; } Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationStudentEvaluationElement.StudentProgramEvaluation @@ -147404,6 +171673,7 @@ Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationStudentE } [DomainSignature] + [Key(1)] public virtual string ProgramEvaluationElementTitle { get; set; } // ------------------------------------------------------------- @@ -147415,7 +171685,9 @@ Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationStudentE // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? EvaluationElementNumericRating { get; set; } + [Key(3)] public virtual int? EvaluationElementRatingLevelDescriptorId { get @@ -147435,6 +171707,7 @@ public virtual int? EvaluationElementRatingLevelDescriptorId private int? _evaluationElementRatingLevelDescriptorId; private string _evaluationElementRatingLevelDescriptor; + [IgnoreMember] public virtual string EvaluationElementRatingLevelDescriptor { get @@ -147462,14 +171735,27 @@ public virtual string EvaluationElementRatingLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluationStudentEvaluationElement")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -147488,12 +171774,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluationStudentEvaluationElement")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.ProgramEvaluationElementAggregate.EdFi.ProgramEvaluationElementReferenceData ProgramEvaluationElementReferenceData { get; set; } /// @@ -147539,7 +171866,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentProgramEvaluation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentProgramEvaluation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ProgramEvaluationElementTitle", ProgramEvaluationElementTitle); @@ -147627,6 +171954,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentProgramEvaluationStudentEvaluationObjective : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentProgramEvaluationStudentEvaluationObjective, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -147634,8 +171962,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentProgramEvaluationStudentEvaluationObjective() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -147643,7 +171971,7 @@ public StudentProgramEvaluationStudentEvaluationObjective() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentProgramEvaluation StudentProgramEvaluation { get; set; } Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationStudentEvaluationObjective.StudentProgramEvaluation @@ -147653,6 +171981,7 @@ Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationStudentE } [DomainSignature] + [Key(1)] public virtual string ProgramEvaluationObjectiveTitle { get; set; } // ------------------------------------------------------------- @@ -147664,7 +171993,9 @@ Entities.Common.EdFi.IStudentProgramEvaluation IStudentProgramEvaluationStudentE // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual decimal? EvaluationObjectiveNumericRating { get; set; } + [Key(3)] public virtual int? EvaluationObjectiveRatingLevelDescriptorId { get @@ -147684,6 +172015,7 @@ public virtual int? EvaluationObjectiveRatingLevelDescriptorId private int? _evaluationObjectiveRatingLevelDescriptorId; private string _evaluationObjectiveRatingLevelDescriptor; + [IgnoreMember] public virtual string EvaluationObjectiveRatingLevelDescriptor { get @@ -147711,14 +172043,27 @@ public virtual string EvaluationObjectiveRatingLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluationStudentEvaluationObjective")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -147737,12 +172082,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentProgramEvaluation", "StudentProgramEvaluationStudentEvaluationObjective")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.ProgramEvaluationObjectiveAggregate.EdFi.ProgramEvaluationObjectiveReferenceData ProgramEvaluationObjectiveReferenceData { get; set; } /// @@ -147788,7 +172174,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentProgramEvaluation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentProgramEvaluation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ProgramEvaluationObjectiveTitle", ProgramEvaluationObjectiveTitle); @@ -147876,25 +172262,31 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSchoolAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentSchoolAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime EntryDate { get; set; } + [Key(1)] public virtual long SchoolId { get; set; } + [Key(2)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -147961,6 +172353,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSchoolAssociation : AggregateRootWithCompositeKey, IHasCascadableKeyValues, Entities.Common.EdFi.IStudentSchoolAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -147970,8 +172363,8 @@ public StudentSchoolAssociation() { StudentSchoolAssociationAlternativeGraduationPlans = new HashSet(); StudentSchoolAssociationEducationPlans = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -147980,6 +172373,7 @@ public StudentSchoolAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime EntryDate { get { return _entryDate; } @@ -147990,8 +172384,10 @@ public virtual DateTime EntryDate private DateTime _entryDate; [DomainSignature] + [Key(7)] public virtual long SchoolId { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(8)] public virtual int StudentUSI { get @@ -148017,6 +172413,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -148050,10 +172447,15 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual string CalendarCode { get; set; } + [Key(10)] public virtual short? ClassOfSchoolYear { get; set; } + [Key(11)] public virtual long? EducationOrganizationId { get; set; } + [Key(12)] public virtual bool? EmployedWhileEnrolled { get; set; } + [Key(13)] public virtual int? EnrollmentTypeDescriptorId { get @@ -148073,6 +172475,7 @@ public virtual int? EnrollmentTypeDescriptorId private int? _enrollmentTypeDescriptorId; private string _enrollmentTypeDescriptor; + [IgnoreMember] public virtual string EnrollmentTypeDescriptor { get @@ -148088,6 +172491,7 @@ public virtual string EnrollmentTypeDescriptor _enrollmentTypeDescriptorId = default(int?); } } + [Key(14)] public virtual int EntryGradeLevelDescriptorId { get @@ -148107,6 +172511,7 @@ public virtual int EntryGradeLevelDescriptorId private int _entryGradeLevelDescriptorId; private string _entryGradeLevelDescriptor; + [IgnoreMember] public virtual string EntryGradeLevelDescriptor { get @@ -148122,6 +172527,7 @@ public virtual string EntryGradeLevelDescriptor _entryGradeLevelDescriptorId = default(int); } } + [Key(15)] public virtual int? EntryGradeLevelReasonDescriptorId { get @@ -148141,6 +172547,7 @@ public virtual int? EntryGradeLevelReasonDescriptorId private int? _entryGradeLevelReasonDescriptorId; private string _entryGradeLevelReasonDescriptor; + [IgnoreMember] public virtual string EntryGradeLevelReasonDescriptor { get @@ -148156,6 +172563,7 @@ public virtual string EntryGradeLevelReasonDescriptor _entryGradeLevelReasonDescriptorId = default(int?); } } + [Key(16)] public virtual int? EntryTypeDescriptorId { get @@ -148175,6 +172583,7 @@ public virtual int? EntryTypeDescriptorId private int? _entryTypeDescriptorId; private string _entryTypeDescriptor; + [IgnoreMember] public virtual string EntryTypeDescriptor { get @@ -148190,6 +172599,7 @@ public virtual string EntryTypeDescriptor _entryTypeDescriptorId = default(int?); } } + [Key(17)] public virtual DateTime? ExitWithdrawDate { get { return _exitWithdrawDate; } @@ -148209,6 +172619,7 @@ public virtual DateTime? ExitWithdrawDate private DateTime? _exitWithdrawDate; + [Key(18)] public virtual int? ExitWithdrawTypeDescriptorId { get @@ -148228,6 +172639,7 @@ public virtual int? ExitWithdrawTypeDescriptorId private int? _exitWithdrawTypeDescriptorId; private string _exitWithdrawTypeDescriptor; + [IgnoreMember] public virtual string ExitWithdrawTypeDescriptor { get @@ -148243,7 +172655,9 @@ public virtual string ExitWithdrawTypeDescriptor _exitWithdrawTypeDescriptorId = default(int?); } } + [Key(19)] public virtual decimal? FullTimeEquivalency { get; set; } + [Key(20)] public virtual int? GraduationPlanTypeDescriptorId { get @@ -148263,6 +172677,7 @@ public virtual int? GraduationPlanTypeDescriptorId private int? _graduationPlanTypeDescriptorId; private string _graduationPlanTypeDescriptor; + [IgnoreMember] public virtual string GraduationPlanTypeDescriptor { get @@ -148278,7 +172693,9 @@ public virtual string GraduationPlanTypeDescriptor _graduationPlanTypeDescriptorId = default(int?); } } + [Key(21)] public virtual short? GraduationSchoolYear { get; set; } + [Key(22)] public virtual int? NextYearGradeLevelDescriptorId { get @@ -148298,6 +172715,7 @@ public virtual int? NextYearGradeLevelDescriptorId private int? _nextYearGradeLevelDescriptorId; private string _nextYearGradeLevelDescriptor; + [IgnoreMember] public virtual string NextYearGradeLevelDescriptor { get @@ -148313,9 +172731,13 @@ public virtual string NextYearGradeLevelDescriptor _nextYearGradeLevelDescriptorId = default(int?); } } + [Key(23)] public virtual long? NextYearSchoolId { get; set; } + [Key(24)] public virtual bool? PrimarySchool { get; set; } + [Key(25)] public virtual bool? RepeatGradeIndicator { get; set; } + [Key(26)] public virtual int? ResidencyStatusDescriptorId { get @@ -148335,6 +172757,7 @@ public virtual int? ResidencyStatusDescriptorId private int? _residencyStatusDescriptorId; private string _residencyStatusDescriptor; + [IgnoreMember] public virtual string ResidencyStatusDescriptor { get @@ -148350,7 +172773,9 @@ public virtual string ResidencyStatusDescriptor _residencyStatusDescriptorId = default(int?); } } + [Key(27)] public virtual bool? SchoolChoice { get; set; } + [Key(28)] public virtual int? SchoolChoiceBasisDescriptorId { get @@ -148370,6 +172795,7 @@ public virtual int? SchoolChoiceBasisDescriptorId private int? _schoolChoiceBasisDescriptorId; private string _schoolChoiceBasisDescriptor; + [IgnoreMember] public virtual string SchoolChoiceBasisDescriptor { get @@ -148385,8 +172811,11 @@ public virtual string SchoolChoiceBasisDescriptor _schoolChoiceBasisDescriptorId = default(int?); } } + [Key(29)] public virtual bool? SchoolChoiceTransfer { get; set; } + [Key(30)] public virtual short? SchoolYear { get; set; } + [Key(31)] public virtual bool? TermCompletionIndicator { get; set; } // ------------------------------------------------------------- @@ -148400,14 +172829,27 @@ public virtual string SchoolChoiceBasisDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSchoolAssociation", "StudentSchoolAssociation")] + [Key(32)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -148426,12 +172868,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSchoolAssociation", "StudentSchoolAssociation")] + [Key(33)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(34)] public virtual NHibernate.CalendarAggregate.EdFi.CalendarReferenceData CalendarReferenceData { get; set; } /// @@ -148452,6 +172935,7 @@ string Entities.Common.EdFi.IStudentSchoolAssociation.CalendarDiscriminator set { } } + [Key(35)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData ClassOfSchoolYearTypeReferenceData { get; set; } /// @@ -148463,6 +172947,7 @@ string Entities.Common.EdFi.IStudentSchoolAssociation.CalendarDiscriminator set { } } + [Key(36)] public virtual NHibernate.GraduationPlanAggregate.EdFi.GraduationPlanReferenceData GraduationPlanReferenceData { get; set; } /// @@ -148483,6 +172968,7 @@ string Entities.Common.EdFi.IStudentSchoolAssociation.GraduationPlanDiscriminato set { } } + [Key(37)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData NextYearSchoolReferenceData { get; set; } /// @@ -148494,6 +172980,7 @@ string Entities.Common.EdFi.IStudentSchoolAssociation.GraduationPlanDiscriminato set { } } + [Key(38)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// @@ -148505,6 +172992,7 @@ string Entities.Common.EdFi.IStudentSchoolAssociation.GraduationPlanDiscriminato set { } } + [Key(39)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -148516,6 +173004,7 @@ string Entities.Common.EdFi.IStudentSchoolAssociation.GraduationPlanDiscriminato set { } } + [Key(40)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -148544,6 +173033,8 @@ string Entities.Common.EdFi.IStudentSchoolAssociation.StudentDiscriminator private ICollection _studentSchoolAssociationAlternativeGraduationPlans; private ICollection _studentSchoolAssociationAlternativeGraduationPlansCovariant; + [Key(41)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSchoolAssociationAlternativeGraduationPlans { get @@ -148553,6 +173044,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSchoolAssociationAlternativeGraduationPlans"); + } + foreach (var item in _studentSchoolAssociationAlternativeGraduationPlans) if (item.StudentSchoolAssociation == null) item.StudentSchoolAssociation = this; @@ -148591,6 +173087,8 @@ public virtual ICollection _studentSchoolAssociationEducationPlans; private ICollection _studentSchoolAssociationEducationPlansCovariant; + [Key(42)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSchoolAssociationEducationPlans { get @@ -148600,6 +173098,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSchoolAssociationEducationPlans"); + } + foreach (var item in _studentSchoolAssociationEducationPlans) if (item.StudentSchoolAssociation == null) item.StudentSchoolAssociation = this; @@ -148752,6 +173255,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSchoolAssociationAlternativeGraduationPlan : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSchoolAssociationAlternativeGraduationPlan, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -148759,8 +173263,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSchoolAssociationAlternativeGraduationPlan() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -148768,7 +173272,7 @@ public StudentSchoolAssociationAlternativeGraduationPlan() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSchoolAssociation StudentSchoolAssociation { get; set; } Entities.Common.EdFi.IStudentSchoolAssociation IStudentSchoolAssociationAlternativeGraduationPlan.StudentSchoolAssociation @@ -148778,8 +173282,10 @@ Entities.Common.EdFi.IStudentSchoolAssociation IStudentSchoolAssociationAlternat } [DomainSignature] + [Key(1)] public virtual long AlternativeEducationOrganizationId { get; set; } [DomainSignature] + [Key(2)] public virtual int AlternativeGraduationPlanTypeDescriptorId { get @@ -148799,6 +173305,7 @@ public virtual int AlternativeGraduationPlanTypeDescriptorId private int _alternativeGraduationPlanTypeDescriptorId; private string _alternativeGraduationPlanTypeDescriptor; + [IgnoreMember] public virtual string AlternativeGraduationPlanTypeDescriptor { get @@ -148815,6 +173322,7 @@ public virtual string AlternativeGraduationPlanTypeDescriptor } } [DomainSignature] + [Key(3)] public virtual short AlternativeGraduationSchoolYear { get; set; } // ------------------------------------------------------------- @@ -148838,14 +173346,27 @@ public virtual string AlternativeGraduationPlanTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSchoolAssociation", "StudentSchoolAssociationAlternativeGraduationPlan")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -148864,12 +173385,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSchoolAssociation", "StudentSchoolAssociationAlternativeGraduationPlan")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.GraduationPlanAggregate.EdFi.GraduationPlanReferenceData AlternativeGraduationPlanReferenceData { get; set; } /// @@ -148912,7 +173474,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSchoolAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSchoolAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("AlternativeEducationOrganizationId", AlternativeEducationOrganizationId); @@ -149002,6 +173564,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSchoolAssociationEducationPlan : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSchoolAssociationEducationPlan, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -149009,8 +173572,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSchoolAssociationEducationPlan() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -149018,7 +173581,7 @@ public StudentSchoolAssociationEducationPlan() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSchoolAssociation StudentSchoolAssociation { get; set; } Entities.Common.EdFi.IStudentSchoolAssociation IStudentSchoolAssociationEducationPlan.StudentSchoolAssociation @@ -149028,6 +173591,7 @@ Entities.Common.EdFi.IStudentSchoolAssociation IStudentSchoolAssociationEducatio } [DomainSignature] + [Key(1)] public virtual int EducationPlanDescriptorId { get @@ -149047,6 +173611,7 @@ public virtual int EducationPlanDescriptorId private int _educationPlanDescriptorId; private string _educationPlanDescriptor; + [IgnoreMember] public virtual string EducationPlanDescriptor { get @@ -149084,14 +173649,27 @@ public virtual string EducationPlanDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSchoolAssociation", "StudentSchoolAssociationEducationPlan")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -149110,7 +173688,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSchoolAssociation", "StudentSchoolAssociationEducationPlan")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -149138,7 +173756,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSchoolAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSchoolAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("EducationPlanDescriptorId", EducationPlanDescriptorId); @@ -149226,28 +173844,37 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSchoolAttendanceEventAggregate.EdF /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentSchoolAttendanceEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int AttendanceEventCategoryDescriptorId { get; set; } + [Key(1)] public virtual DateTime EventDate { get; set; } + [Key(2)] public virtual long SchoolId { get; set; } + [Key(3)] public virtual short SchoolYear { get; set; } + [Key(4)] public virtual string SessionName { get; set; } + [Key(5)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(6)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(7)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -149317,6 +173944,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSchoolAttendanceEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentSchoolAttendanceEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -149324,8 +173952,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSchoolAttendanceEvent() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -149334,6 +173962,7 @@ public StudentSchoolAttendanceEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int AttendanceEventCategoryDescriptorId { get @@ -149353,6 +173982,7 @@ public virtual int AttendanceEventCategoryDescriptorId private int _attendanceEventCategoryDescriptorId; private string _attendanceEventCategoryDescriptor; + [IgnoreMember] public virtual string AttendanceEventCategoryDescriptor { get @@ -149369,6 +173999,7 @@ public virtual string AttendanceEventCategoryDescriptor } } [DomainSignature] + [Key(7)] public virtual DateTime EventDate { get { return _eventDate; } @@ -149379,12 +174010,16 @@ public virtual DateTime EventDate private DateTime _eventDate; [DomainSignature] + [Key(8)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(9)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(10)] public virtual string SessionName { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(11)] public virtual int StudentUSI { get @@ -149410,6 +174045,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -149443,9 +174079,13 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(12)] public virtual TimeSpan? ArrivalTime { get; set; } + [Key(13)] public virtual string AttendanceEventReason { get; set; } + [Key(14)] public virtual TimeSpan? DepartureTime { get; set; } + [Key(15)] public virtual int? EducationalEnvironmentDescriptorId { get @@ -149465,6 +174105,7 @@ public virtual int? EducationalEnvironmentDescriptorId private int? _educationalEnvironmentDescriptorId; private string _educationalEnvironmentDescriptor; + [IgnoreMember] public virtual string EducationalEnvironmentDescriptor { get @@ -149480,7 +174121,9 @@ public virtual string EducationalEnvironmentDescriptor _educationalEnvironmentDescriptorId = default(int?); } } + [Key(16)] public virtual decimal? EventDuration { get; set; } + [Key(17)] public virtual int? SchoolAttendanceDuration { get; set; } // ------------------------------------------------------------- @@ -149494,14 +174137,27 @@ public virtual string EducationalEnvironmentDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSchoolAttendanceEvent", "StudentSchoolAttendanceEvent")] + [Key(18)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -149520,12 +174176,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSchoolAttendanceEvent", "StudentSchoolAttendanceEvent")] + [Key(19)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(20)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData SchoolReferenceData { get; set; } /// @@ -149537,6 +174234,7 @@ public IDictionary Extensions set { } } + [Key(21)] public virtual NHibernate.SessionAggregate.EdFi.SessionReferenceData SessionReferenceData { get; set; } /// @@ -149557,6 +174255,7 @@ string Entities.Common.EdFi.IStudentSchoolAttendanceEvent.SessionDiscriminator set { } } + [Key(22)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -149694,14 +174393,15 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSchoolFoodServiceProgramAssociatio /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSchoolFoodServiceProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentSchoolFoodServiceProgramAssociation() { StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -149710,14 +174410,19 @@ public StudentSchoolFoodServiceProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -149737,6 +174442,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -149753,6 +174459,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -149778,6 +174485,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -149826,6 +174534,7 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual bool? DirectCertification { get; set; } // ------------------------------------------------------------- @@ -149839,14 +174548,27 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSchoolFoodServiceProgramAssociation", "StudentSchoolFoodServiceProgramAssociation")] + [Key(20)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -149865,7 +174587,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSchoolFoodServiceProgramAssociation", "StudentSchoolFoodServiceProgramAssociation")] + [Key(21)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -149879,6 +174641,8 @@ public IDictionary Extensions private ICollection _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices; private ICollection _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServicesCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices { get @@ -149888,6 +174652,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices"); + } + foreach (var item in _studentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramServices) if (item.StudentSchoolFoodServiceProgramAssociation == null) item.StudentSchoolFoodServiceProgramAssociation = this; @@ -150030,6 +174799,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -150037,8 +174807,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -150046,7 +174816,7 @@ public StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSchoolFoodServiceProgramAssociation StudentSchoolFoodServiceProgramAssociation { get; set; } Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation IStudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService.StudentSchoolFoodServiceProgramAssociation @@ -150056,6 +174826,7 @@ Entities.Common.EdFi.IStudentSchoolFoodServiceProgramAssociation IStudentSchoolF } [DomainSignature] + [Key(1)] public virtual int SchoolFoodServiceProgramServiceDescriptorId { get @@ -150075,6 +174846,7 @@ public virtual int SchoolFoodServiceProgramServiceDescriptorId private int _schoolFoodServiceProgramServiceDescriptorId; private string _schoolFoodServiceProgramServiceDescriptor; + [IgnoreMember] public virtual string SchoolFoodServiceProgramServiceDescriptor { get @@ -150100,7 +174872,9 @@ public virtual string SchoolFoodServiceProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -150120,6 +174894,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -150151,14 +174926,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSchoolFoodServiceProgramAssociation", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -150177,7 +174965,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSchoolFoodServiceProgramAssociation", "StudentSchoolFoodServiceProgramAssociationSchoolFoodServiceProgramService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -150206,7 +175034,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSchoolFoodServiceProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSchoolFoodServiceProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SchoolFoodServiceProgramServiceDescriptorId", SchoolFoodServiceProgramServiceDescriptorId); @@ -150299,13 +175127,14 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSection504ProgramAssociationAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSection504ProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentSection504ProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentSection504ProgramAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -150314,14 +175143,19 @@ public StudentSection504ProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -150341,6 +175175,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -150357,6 +175192,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -150382,6 +175218,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -150430,7 +175267,9 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual bool? AccommodationPlan { get; set; } + [Key(20)] public virtual int? Section504DisabilityDescriptorId { get @@ -150450,6 +175289,7 @@ public virtual int? Section504DisabilityDescriptorId private int? _section504DisabilityDescriptorId; private string _section504DisabilityDescriptor; + [IgnoreMember] public virtual string Section504DisabilityDescriptor { get @@ -150465,7 +175305,9 @@ public virtual string Section504DisabilityDescriptor _section504DisabilityDescriptorId = default(int?); } } + [Key(21)] public virtual bool Section504Eligibility { get; set; } + [Key(22)] public virtual DateTime? Section504EligibilityDecisionDate { get { return _section504EligibilityDecisionDate; } @@ -150485,6 +175327,7 @@ public virtual DateTime? Section504EligibilityDecisionDate private DateTime? _section504EligibilityDecisionDate; + [Key(23)] public virtual DateTime? Section504MeetingDate { get { return _section504MeetingDate; } @@ -150516,14 +175359,27 @@ public virtual DateTime? Section504MeetingDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSection504ProgramAssociation", "StudentSection504ProgramAssociation")] + [Key(24)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -150542,7 +175398,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSection504ProgramAssociation", "StudentSection504ProgramAssociation")] + [Key(25)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -150661,29 +175557,39 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSectionAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentSectionAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime BeginDate { get; set; } + [Key(1)] public virtual string LocalCourseCode { get; set; } + [Key(2)] public virtual long SchoolId { get; set; } + [Key(3)] public virtual short SchoolYear { get; set; } + [Key(4)] public virtual string SectionIdentifier { get; set; } + [Key(5)] public virtual string SessionName { get; set; } + [Key(6)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -150754,6 +175660,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSectionAssociation : AggregateRootWithCompositeKey, IHasCascadableKeyValues, Entities.Common.EdFi.IStudentSectionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -150762,8 +175669,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSectionAssociation() { StudentSectionAssociationPrograms = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -150772,6 +175679,7 @@ public StudentSectionAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime BeginDate { get { return _beginDate; } @@ -150782,16 +175690,22 @@ public virtual DateTime BeginDate private DateTime _beginDate; [DomainSignature] + [Key(7)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(8)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(9)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(10)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(11)] public virtual string SessionName { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(12)] public virtual int StudentUSI { get @@ -150817,6 +175731,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -150850,6 +175765,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(13)] public virtual int? AttemptStatusDescriptorId { get @@ -150869,6 +175785,7 @@ public virtual int? AttemptStatusDescriptorId private int? _attemptStatusDescriptorId; private string _attemptStatusDescriptor; + [IgnoreMember] public virtual string AttemptStatusDescriptor { get @@ -150884,8 +175801,11 @@ public virtual string AttemptStatusDescriptor _attemptStatusDescriptorId = default(int?); } } + [Key(14)] public virtual long? DualCreditEducationOrganizationId { get; set; } + [Key(15)] public virtual bool? DualCreditIndicator { get; set; } + [Key(16)] public virtual int? DualCreditInstitutionDescriptorId { get @@ -150905,6 +175825,7 @@ public virtual int? DualCreditInstitutionDescriptorId private int? _dualCreditInstitutionDescriptorId; private string _dualCreditInstitutionDescriptor; + [IgnoreMember] public virtual string DualCreditInstitutionDescriptor { get @@ -150920,6 +175841,7 @@ public virtual string DualCreditInstitutionDescriptor _dualCreditInstitutionDescriptorId = default(int?); } } + [Key(17)] public virtual int? DualCreditTypeDescriptorId { get @@ -150939,6 +175861,7 @@ public virtual int? DualCreditTypeDescriptorId private int? _dualCreditTypeDescriptorId; private string _dualCreditTypeDescriptor; + [IgnoreMember] public virtual string DualCreditTypeDescriptor { get @@ -150954,7 +175877,9 @@ public virtual string DualCreditTypeDescriptor _dualCreditTypeDescriptorId = default(int?); } } + [Key(18)] public virtual bool? DualHighSchoolCreditIndicator { get; set; } + [Key(19)] public virtual DateTime? EndDate { get { return _endDate; } @@ -150974,7 +175899,9 @@ public virtual DateTime? EndDate private DateTime? _endDate; + [Key(20)] public virtual bool? HomeroomIndicator { get; set; } + [Key(21)] public virtual int? RepeatIdentifierDescriptorId { get @@ -150994,6 +175921,7 @@ public virtual int? RepeatIdentifierDescriptorId private int? _repeatIdentifierDescriptorId; private string _repeatIdentifierDescriptor; + [IgnoreMember] public virtual string RepeatIdentifierDescriptor { get @@ -151009,6 +175937,7 @@ public virtual string RepeatIdentifierDescriptor _repeatIdentifierDescriptorId = default(int?); } } + [Key(22)] public virtual bool? TeacherStudentDataLinkExclusion { get; set; } // ------------------------------------------------------------- @@ -151022,14 +175951,27 @@ public virtual string RepeatIdentifierDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSectionAssociation", "StudentSectionAssociation")] + [Key(23)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -151048,12 +175990,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSectionAssociation", "StudentSectionAssociation")] + [Key(24)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(25)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData DualCreditEducationOrganizationReferenceData { get; set; } /// @@ -151074,6 +176057,7 @@ string Entities.Common.EdFi.IStudentSectionAssociation.DualCreditEducationOrgani set { } } + [Key(26)] public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// @@ -151094,6 +176078,7 @@ string Entities.Common.EdFi.IStudentSectionAssociation.SectionDiscriminator set { } } + [Key(27)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -151122,6 +176107,8 @@ string Entities.Common.EdFi.IStudentSectionAssociation.StudentDiscriminator private ICollection _studentSectionAssociationPrograms; private ICollection _studentSectionAssociationProgramsCovariant; + [Key(28)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSectionAssociationPrograms { get @@ -151131,6 +176118,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSectionAssociationPrograms"); + } + foreach (var item in _studentSectionAssociationPrograms) if (item.StudentSectionAssociation == null) item.StudentSectionAssociation = this; @@ -151282,6 +176274,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSectionAssociationProgram : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSectionAssociationProgram, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -151289,8 +176282,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSectionAssociationProgram() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -151298,7 +176291,7 @@ public StudentSectionAssociationProgram() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSectionAssociation StudentSectionAssociation { get; set; } Entities.Common.EdFi.IStudentSectionAssociation IStudentSectionAssociationProgram.StudentSectionAssociation @@ -151308,10 +176301,13 @@ Entities.Common.EdFi.IStudentSectionAssociation IStudentSectionAssociationProgra } [DomainSignature] + [Key(1)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(2)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(3)] public virtual int ProgramTypeDescriptorId { get @@ -151331,6 +176327,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -151368,14 +176365,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSectionAssociation", "StudentSectionAssociationProgram")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -151394,12 +176404,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSectionAssociation", "StudentSectionAssociationProgram")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(6)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -151442,7 +176493,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSectionAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSectionAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("EducationOrganizationId", EducationOrganizationId); @@ -151532,30 +176583,41 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSectionAttendanceEventAggregate.Ed /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentSectionAttendanceEventReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int AttendanceEventCategoryDescriptorId { get; set; } + [Key(1)] public virtual DateTime EventDate { get; set; } + [Key(2)] public virtual string LocalCourseCode { get; set; } + [Key(3)] public virtual long SchoolId { get; set; } + [Key(4)] public virtual short SchoolYear { get; set; } + [Key(5)] public virtual string SectionIdentifier { get; set; } + [Key(6)] public virtual string SessionName { get; set; } + [Key(7)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(8)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(9)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -151627,6 +176689,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSectionAttendanceEvent : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentSectionAttendanceEvent, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -151635,8 +176698,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSectionAttendanceEvent() { StudentSectionAttendanceEventClassPeriods = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -151645,6 +176708,7 @@ public StudentSectionAttendanceEvent() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual int AttendanceEventCategoryDescriptorId { get @@ -151664,6 +176728,7 @@ public virtual int AttendanceEventCategoryDescriptorId private int _attendanceEventCategoryDescriptorId; private string _attendanceEventCategoryDescriptor; + [IgnoreMember] public virtual string AttendanceEventCategoryDescriptor { get @@ -151680,6 +176745,7 @@ public virtual string AttendanceEventCategoryDescriptor } } [DomainSignature] + [Key(7)] public virtual DateTime EventDate { get { return _eventDate; } @@ -151690,16 +176756,22 @@ public virtual DateTime EventDate private DateTime _eventDate; [DomainSignature] + [Key(8)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(9)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(10)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(11)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(12)] public virtual string SessionName { get; set; } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(13)] public virtual int StudentUSI { get @@ -151725,6 +176797,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -151758,9 +176831,13 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(14)] public virtual TimeSpan? ArrivalTime { get; set; } + [Key(15)] public virtual string AttendanceEventReason { get; set; } + [Key(16)] public virtual TimeSpan? DepartureTime { get; set; } + [Key(17)] public virtual int? EducationalEnvironmentDescriptorId { get @@ -151780,6 +176857,7 @@ public virtual int? EducationalEnvironmentDescriptorId private int? _educationalEnvironmentDescriptorId; private string _educationalEnvironmentDescriptor; + [IgnoreMember] public virtual string EducationalEnvironmentDescriptor { get @@ -151795,7 +176873,9 @@ public virtual string EducationalEnvironmentDescriptor _educationalEnvironmentDescriptorId = default(int?); } } + [Key(18)] public virtual decimal? EventDuration { get; set; } + [Key(19)] public virtual int? SectionAttendanceDuration { get; set; } // ------------------------------------------------------------- @@ -151809,14 +176889,27 @@ public virtual string EducationalEnvironmentDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSectionAttendanceEvent", "StudentSectionAttendanceEvent")] + [Key(20)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -151835,12 +176928,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSectionAttendanceEvent", "StudentSectionAttendanceEvent")] + [Key(21)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(22)] public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// @@ -151861,6 +176995,7 @@ string Entities.Common.EdFi.IStudentSectionAttendanceEvent.SectionDiscriminator set { } } + [Key(23)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -151889,6 +177024,8 @@ string Entities.Common.EdFi.IStudentSectionAttendanceEvent.StudentDiscriminator private ICollection _studentSectionAttendanceEventClassPeriods; private ICollection _studentSectionAttendanceEventClassPeriodsCovariant; + [Key(24)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSectionAttendanceEventClassPeriods { get @@ -151898,6 +177035,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSectionAttendanceEventClassPeriods"); + } + foreach (var item in _studentSectionAttendanceEventClassPeriods) if (item.StudentSectionAttendanceEvent == null) item.StudentSectionAttendanceEvent = this; @@ -152042,6 +177184,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSectionAttendanceEventClassPeriod : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSectionAttendanceEventClassPeriod, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -152049,8 +177192,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSectionAttendanceEventClassPeriod() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -152058,7 +177201,7 @@ public StudentSectionAttendanceEventClassPeriod() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSectionAttendanceEvent StudentSectionAttendanceEvent { get; set; } Entities.Common.EdFi.IStudentSectionAttendanceEvent IStudentSectionAttendanceEventClassPeriod.StudentSectionAttendanceEvent @@ -152068,6 +177211,7 @@ Entities.Common.EdFi.IStudentSectionAttendanceEvent IStudentSectionAttendanceEve } [DomainSignature] + [Key(1)] public virtual string ClassPeriodName { get; set; } // ------------------------------------------------------------- @@ -152091,14 +177235,27 @@ Entities.Common.EdFi.IStudentSectionAttendanceEvent IStudentSectionAttendanceEve // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSectionAttendanceEvent", "StudentSectionAttendanceEventClassPeriod")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -152117,12 +177274,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSectionAttendanceEvent", "StudentSectionAttendanceEventClassPeriod")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(4)] public virtual NHibernate.ClassPeriodAggregate.EdFi.ClassPeriodReferenceData ClassPeriodReferenceData { get; set; } /// @@ -152165,7 +177363,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSectionAttendanceEvent as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSectionAttendanceEvent as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("ClassPeriodName", ClassPeriodName); @@ -152258,6 +177456,7 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSpecialEducationProgramAssociation /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSpecialEducationProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentSpecialEducationProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -152266,8 +177465,8 @@ public StudentSpecialEducationProgramAssociation() StudentSpecialEducationProgramAssociationDisabilities = new HashSet(); StudentSpecialEducationProgramAssociationServiceProviders = new HashSet(); StudentSpecialEducationProgramAssociationSpecialEducationProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -152276,14 +177475,19 @@ public StudentSpecialEducationProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -152303,6 +177507,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -152319,6 +177524,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -152344,6 +177550,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -152392,7 +177599,9 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual bool? IdeaEligibility { get; set; } + [Key(20)] public virtual DateTime? IEPBeginDate { get { return _iepBeginDate; } @@ -152412,6 +177621,7 @@ public virtual DateTime? IEPBeginDate private DateTime? _iepBeginDate; + [Key(21)] public virtual DateTime? IEPEndDate { get { return _iepEndDate; } @@ -152431,6 +177641,7 @@ public virtual DateTime? IEPEndDate private DateTime? _iepEndDate; + [Key(22)] public virtual DateTime? IEPReviewDate { get { return _iepReviewDate; } @@ -152450,6 +177661,7 @@ public virtual DateTime? IEPReviewDate private DateTime? _iepReviewDate; + [Key(23)] public virtual DateTime? LastEvaluationDate { get { return _lastEvaluationDate; } @@ -152469,11 +177681,17 @@ public virtual DateTime? LastEvaluationDate private DateTime? _lastEvaluationDate; + [Key(24)] public virtual bool? MedicallyFragile { get; set; } + [Key(25)] public virtual bool? MultiplyDisabled { get; set; } + [Key(26)] public virtual decimal? ReductionInHoursPerWeekComparedToPeers { get; set; } + [Key(27)] public virtual decimal? SchoolHoursPerWeek { get; set; } + [Key(28)] public virtual bool? ShortenedSchoolDayIndicator { get; set; } + [Key(29)] public virtual DateTime? SpecialEducationExitDate { get { return _specialEducationExitDate; } @@ -152493,7 +177711,9 @@ public virtual DateTime? SpecialEducationExitDate private DateTime? _specialEducationExitDate; + [Key(30)] public virtual string SpecialEducationExitExplained { get; set; } + [Key(31)] public virtual int? SpecialEducationExitReasonDescriptorId { get @@ -152513,6 +177733,7 @@ public virtual int? SpecialEducationExitReasonDescriptorId private int? _specialEducationExitReasonDescriptorId; private string _specialEducationExitReasonDescriptor; + [IgnoreMember] public virtual string SpecialEducationExitReasonDescriptor { get @@ -152528,7 +177749,9 @@ public virtual string SpecialEducationExitReasonDescriptor _specialEducationExitReasonDescriptorId = default(int?); } } + [Key(32)] public virtual decimal? SpecialEducationHoursPerWeek { get; set; } + [Key(33)] public virtual int? SpecialEducationSettingDescriptorId { get @@ -152548,6 +177771,7 @@ public virtual int? SpecialEducationSettingDescriptorId private int? _specialEducationSettingDescriptorId; private string _specialEducationSettingDescriptor; + [IgnoreMember] public virtual string SpecialEducationSettingDescriptor { get @@ -152575,14 +177799,27 @@ public virtual string SpecialEducationSettingDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociation")] + [Key(34)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -152601,7 +177838,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociation")] + [Key(35)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -152615,6 +177892,8 @@ public IDictionary Extensions private ICollection _studentSpecialEducationProgramAssociationDisabilities; private ICollection _studentSpecialEducationProgramAssociationDisabilitiesCovariant; + [Key(36)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSpecialEducationProgramAssociationDisabilities { get @@ -152624,6 +177903,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSpecialEducationProgramAssociationDisabilities"); + } + foreach (var item in _studentSpecialEducationProgramAssociationDisabilities) if (item.StudentSpecialEducationProgramAssociation == null) item.StudentSpecialEducationProgramAssociation = this; @@ -152662,6 +177946,8 @@ public virtual ICollection _studentSpecialEducationProgramAssociationServiceProviders; private ICollection _studentSpecialEducationProgramAssociationServiceProvidersCovariant; + [Key(37)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSpecialEducationProgramAssociationServiceProviders { get @@ -152671,6 +177957,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSpecialEducationProgramAssociationServiceProviders"); + } + foreach (var item in _studentSpecialEducationProgramAssociationServiceProviders) if (item.StudentSpecialEducationProgramAssociation == null) item.StudentSpecialEducationProgramAssociation = this; @@ -152709,6 +178000,8 @@ public virtual ICollection _studentSpecialEducationProgramAssociationSpecialEducationProgramServices; private ICollection _studentSpecialEducationProgramAssociationSpecialEducationProgramServicesCovariant; + [Key(38)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSpecialEducationProgramAssociationSpecialEducationProgramServices { get @@ -152718,6 +178011,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSpecialEducationProgramAssociationSpecialEducationProgramServices"); + } + foreach (var item in _studentSpecialEducationProgramAssociationSpecialEducationProgramServices) if (item.StudentSpecialEducationProgramAssociation == null) item.StudentSpecialEducationProgramAssociation = this; @@ -152862,6 +178160,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSpecialEducationProgramAssociationDisability : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationDisability, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -152870,8 +178169,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSpecialEducationProgramAssociationDisability() { StudentSpecialEducationProgramAssociationDisabilityDesignations = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -152879,7 +178178,7 @@ public StudentSpecialEducationProgramAssociationDisability() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSpecialEducationProgramAssociation StudentSpecialEducationProgramAssociation { get; set; } Entities.Common.EdFi.IStudentSpecialEducationProgramAssociation IStudentSpecialEducationProgramAssociationDisability.StudentSpecialEducationProgramAssociation @@ -152889,6 +178188,7 @@ Entities.Common.EdFi.IStudentSpecialEducationProgramAssociation IStudentSpecialE } [DomainSignature] + [Key(1)] public virtual int DisabilityDescriptorId { get @@ -152908,6 +178208,7 @@ public virtual int DisabilityDescriptorId private int _disabilityDescriptorId; private string _disabilityDescriptor; + [IgnoreMember] public virtual string DisabilityDescriptor { get @@ -152933,6 +178234,7 @@ public virtual string DisabilityDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? DisabilityDeterminationSourceTypeDescriptorId { get @@ -152952,6 +178254,7 @@ public virtual int? DisabilityDeterminationSourceTypeDescriptorId private int? _disabilityDeterminationSourceTypeDescriptorId; private string _disabilityDeterminationSourceTypeDescriptor; + [IgnoreMember] public virtual string DisabilityDeterminationSourceTypeDescriptor { get @@ -152967,7 +178270,9 @@ public virtual string DisabilityDeterminationSourceTypeDescriptor _disabilityDeterminationSourceTypeDescriptorId = default(int?); } } + [Key(3)] public virtual string DisabilityDiagnosis { get; set; } + [Key(4)] public virtual int? OrderOfDisability { get; set; } // ------------------------------------------------------------- @@ -152981,14 +178286,27 @@ public virtual string DisabilityDeterminationSourceTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationDisability")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -153007,7 +178325,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationDisability")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -153021,6 +178379,8 @@ public IDictionary Extensions private ICollection _studentSpecialEducationProgramAssociationDisabilityDesignations; private ICollection _studentSpecialEducationProgramAssociationDisabilityDesignationsCovariant; + [Key(7)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSpecialEducationProgramAssociationDisabilityDesignations { get @@ -153030,6 +178390,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSpecialEducationProgramAssociationDisabilityDesignations"); + } + foreach (var item in _studentSpecialEducationProgramAssociationDisabilityDesignations) if (item.StudentSpecialEducationProgramAssociationDisability == null) item.StudentSpecialEducationProgramAssociationDisability = this; @@ -153084,7 +178449,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSpecialEducationProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSpecialEducationProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DisabilityDescriptorId", DisabilityDescriptorId); @@ -153172,6 +178537,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSpecialEducationProgramAssociationDisabilityDesignation : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationDisabilityDesignation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -153179,8 +178545,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSpecialEducationProgramAssociationDisabilityDesignation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -153188,7 +178554,7 @@ public StudentSpecialEducationProgramAssociationDisabilityDesignation() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSpecialEducationProgramAssociationDisability StudentSpecialEducationProgramAssociationDisability { get; set; } Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationDisability IStudentSpecialEducationProgramAssociationDisabilityDesignation.StudentSpecialEducationProgramAssociationDisability @@ -153198,6 +178564,7 @@ Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationDisability IStude } [DomainSignature] + [Key(1)] public virtual int DisabilityDesignationDescriptorId { get @@ -153217,6 +178584,7 @@ public virtual int DisabilityDesignationDescriptorId private int _disabilityDesignationDescriptorId; private string _disabilityDesignationDescriptor; + [IgnoreMember] public virtual string DisabilityDesignationDescriptor { get @@ -153254,14 +178622,27 @@ public virtual string DisabilityDesignationDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationDisabilityDesignation")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -153280,7 +178661,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationDisabilityDesignation")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -153310,7 +178731,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSpecialEducationProgramAssociationDisability as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSpecialEducationProgramAssociationDisability as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("DisabilityDesignationDescriptorId", DisabilityDesignationDescriptorId); @@ -153398,6 +178819,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSpecialEducationProgramAssociationServiceProvider : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationServiceProvider, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -153405,8 +178827,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSpecialEducationProgramAssociationServiceProvider() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -153414,7 +178836,7 @@ public StudentSpecialEducationProgramAssociationServiceProvider() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSpecialEducationProgramAssociation StudentSpecialEducationProgramAssociation { get; set; } Entities.Common.EdFi.IStudentSpecialEducationProgramAssociation IStudentSpecialEducationProgramAssociationServiceProvider.StudentSpecialEducationProgramAssociation @@ -153424,6 +178846,7 @@ Entities.Common.EdFi.IStudentSpecialEducationProgramAssociation IStudentSpecialE } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(1)] public virtual int StaffUSI { get @@ -153449,6 +178872,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -153482,6 +178906,7 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryProvider { get; set; } // ------------------------------------------------------------- @@ -153495,14 +178920,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationServiceProvider")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -153521,12 +178959,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationServiceProvider")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -153569,7 +179048,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSpecialEducationProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSpecialEducationProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("StaffUSI", StaffUSI); @@ -153657,6 +179136,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSpecialEducationProgramAssociationSpecialEducationProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationSpecialEducationProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -153665,8 +179145,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSpecialEducationProgramAssociationSpecialEducationProgramService() { StudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProviders = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -153674,7 +179154,7 @@ public StudentSpecialEducationProgramAssociationSpecialEducationProgramService() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSpecialEducationProgramAssociation StudentSpecialEducationProgramAssociation { get; set; } Entities.Common.EdFi.IStudentSpecialEducationProgramAssociation IStudentSpecialEducationProgramAssociationSpecialEducationProgramService.StudentSpecialEducationProgramAssociation @@ -153684,6 +179164,7 @@ Entities.Common.EdFi.IStudentSpecialEducationProgramAssociation IStudentSpecialE } [DomainSignature] + [Key(1)] public virtual int SpecialEducationProgramServiceDescriptorId { get @@ -153703,6 +179184,7 @@ public virtual int SpecialEducationProgramServiceDescriptorId private int _specialEducationProgramServiceDescriptorId; private string _specialEducationProgramServiceDescriptor; + [IgnoreMember] public virtual string SpecialEducationProgramServiceDescriptor { get @@ -153728,7 +179210,9 @@ public virtual string SpecialEducationProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -153748,6 +179232,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -153779,14 +179264,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationSpecialEducationProgramService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -153805,7 +179303,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationSpecialEducationProgramService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -153819,6 +179357,8 @@ public IDictionary Extensions private ICollection _studentSpecialEducationProgramAssociationSpecialEducationProgramServiceProviders; private ICollection _studentSpecialEducationProgramAssociationSpecialEducationProgramServiceProvidersCovariant; + [Key(7)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProviders { get @@ -153828,6 +179368,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProviders"); + } + foreach (var item in _studentSpecialEducationProgramAssociationSpecialEducationProgramServiceProviders) if (item.StudentSpecialEducationProgramAssociationSpecialEducationProgramService == null) item.StudentSpecialEducationProgramAssociationSpecialEducationProgramService = this; @@ -153881,7 +179426,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSpecialEducationProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSpecialEducationProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SpecialEducationProgramServiceDescriptorId", SpecialEducationProgramServiceDescriptorId); @@ -153969,6 +179514,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProvider : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProvider, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -153976,8 +179522,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProvider() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -153985,7 +179531,7 @@ public StudentSpecialEducationProgramAssociationSpecialEducationProgramServicePr // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentSpecialEducationProgramAssociationSpecialEducationProgramService StudentSpecialEducationProgramAssociationSpecialEducationProgramService { get; set; } Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationSpecialEducationProgramService IStudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProvider.StudentSpecialEducationProgramAssociationSpecialEducationProgramService @@ -153995,6 +179541,7 @@ Entities.Common.EdFi.IStudentSpecialEducationProgramAssociationSpecialEducationP } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(1)] public virtual int StaffUSI { get @@ -154020,6 +179567,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -154053,6 +179601,7 @@ public virtual string StaffUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryProvider { get; set; } // ------------------------------------------------------------- @@ -154066,14 +179615,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProvider")] + [Key(3)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -154092,12 +179654,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSpecialEducationProgramAssociation", "StudentSpecialEducationProgramAssociationSpecialEducationProgramServiceProvider")] + [Key(4)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(5)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -154141,7 +179744,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentSpecialEducationProgramAssociationSpecialEducationProgramService as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentSpecialEducationProgramAssociationSpecialEducationProgramService as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("StaffUSI", StaffUSI); @@ -154229,28 +179832,37 @@ namespace EdFi.Ods.Entities.NHibernate.StudentSpecialEducationProgramEligibility /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentSpecialEducationProgramEligibilityAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual DateTime ConsentToEvaluationReceivedDate { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual long ProgramEducationOrganizationId { get; set; } + [Key(3)] public virtual string ProgramName { get; set; } + [Key(4)] public virtual int ProgramTypeDescriptorId { get; set; } + [Key(5)] public virtual int StudentUSI { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(6)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(7)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -154320,6 +179932,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentSpecialEducationProgramEligibilityAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -154327,8 +179940,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentSpecialEducationProgramEligibilityAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -154337,6 +179950,7 @@ public StudentSpecialEducationProgramEligibilityAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual DateTime ConsentToEvaluationReceivedDate { get { return _consentToEvaluationReceivedDate; } @@ -154347,12 +179961,16 @@ public virtual DateTime ConsentToEvaluationReceivedDate private DateTime _consentToEvaluationReceivedDate; [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [Key(9)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(10)] public virtual int ProgramTypeDescriptorId { get @@ -154372,6 +179990,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -154388,6 +180007,7 @@ public virtual string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [Key(11)] public virtual int StudentUSI { get @@ -154413,6 +180033,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -154446,6 +180067,7 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(12)] public virtual DateTime? ConsentToEvaluationDate { get { return _consentToEvaluationDate; } @@ -154465,6 +180087,7 @@ public virtual DateTime? ConsentToEvaluationDate private DateTime? _consentToEvaluationDate; + [Key(13)] public virtual DateTime? EligibilityConferenceDate { get { return _eligibilityConferenceDate; } @@ -154484,6 +180107,7 @@ public virtual DateTime? EligibilityConferenceDate private DateTime? _eligibilityConferenceDate; + [Key(14)] public virtual int? EligibilityDelayReasonDescriptorId { get @@ -154503,6 +180127,7 @@ public virtual int? EligibilityDelayReasonDescriptorId private int? _eligibilityDelayReasonDescriptorId; private string _eligibilityDelayReasonDescriptor; + [IgnoreMember] public virtual string EligibilityDelayReasonDescriptor { get @@ -154518,6 +180143,7 @@ public virtual string EligibilityDelayReasonDescriptor _eligibilityDelayReasonDescriptorId = default(int?); } } + [Key(15)] public virtual DateTime? EligibilityDeterminationDate { get { return _eligibilityDeterminationDate; } @@ -154537,6 +180163,7 @@ public virtual DateTime? EligibilityDeterminationDate private DateTime? _eligibilityDeterminationDate; + [Key(16)] public virtual DateTime? EligibilityEvaluationDate { get { return _eligibilityEvaluationDate; } @@ -154556,6 +180183,7 @@ public virtual DateTime? EligibilityEvaluationDate private DateTime? _eligibilityEvaluationDate; + [Key(17)] public virtual int? EligibilityEvaluationTypeDescriptorId { get @@ -154575,6 +180203,7 @@ public virtual int? EligibilityEvaluationTypeDescriptorId private int? _eligibilityEvaluationTypeDescriptorId; private string _eligibilityEvaluationTypeDescriptor; + [IgnoreMember] public virtual string EligibilityEvaluationTypeDescriptor { get @@ -154590,8 +180219,11 @@ public virtual string EligibilityEvaluationTypeDescriptor _eligibilityEvaluationTypeDescriptorId = default(int?); } } + [Key(18)] public virtual bool? EvaluationCompleteIndicator { get; set; } + [Key(19)] public virtual int? EvaluationDelayDays { get; set; } + [Key(20)] public virtual int? EvaluationDelayReasonDescriptorId { get @@ -154611,6 +180243,7 @@ public virtual int? EvaluationDelayReasonDescriptorId private int? _evaluationDelayReasonDescriptorId; private string _evaluationDelayReasonDescriptor; + [IgnoreMember] public virtual string EvaluationDelayReasonDescriptor { get @@ -154626,8 +180259,11 @@ public virtual string EvaluationDelayReasonDescriptor _evaluationDelayReasonDescriptorId = default(int?); } } + [Key(21)] public virtual string EvaluationLateReason { get; set; } + [Key(22)] public virtual bool? IDEAIndicator { get; set; } + [Key(23)] public virtual int IDEAPartDescriptorId { get @@ -154647,6 +180283,7 @@ public virtual int IDEAPartDescriptorId private int _ideaPartDescriptorId; private string _ideaPartDescriptor; + [IgnoreMember] public virtual string IDEAPartDescriptor { get @@ -154662,6 +180299,7 @@ public virtual string IDEAPartDescriptor _ideaPartDescriptorId = default(int); } } + [Key(24)] public virtual DateTime? OriginalECIServicesDate { get { return _originalECIServicesDate; } @@ -154681,6 +180319,7 @@ public virtual DateTime? OriginalECIServicesDate private DateTime? _originalECIServicesDate; + [Key(25)] public virtual DateTime? TransitionConferenceDate { get { return _transitionConferenceDate; } @@ -154700,6 +180339,7 @@ public virtual DateTime? TransitionConferenceDate private DateTime? _transitionConferenceDate; + [Key(26)] public virtual DateTime? TransitionNotificationDate { get { return _transitionNotificationDate; } @@ -154731,14 +180371,27 @@ public virtual DateTime? TransitionNotificationDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentSpecialEducationProgramEligibilityAssociation", "StudentSpecialEducationProgramEligibilityAssociation")] + [Key(27)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -154757,12 +180410,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentSpecialEducationProgramEligibilityAssociation", "StudentSpecialEducationProgramEligibilityAssociation")] + [Key(28)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(29)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -154783,6 +180477,7 @@ string Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociatio set { } } + [Key(30)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -154803,6 +180498,7 @@ string Entities.Common.EdFi.IStudentSpecialEducationProgramEligibilityAssociatio set { } } + [Key(31)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -154943,14 +180639,15 @@ namespace EdFi.Ods.Entities.NHibernate.StudentTitleIPartAProgramAssociationAggre /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentTitleIPartAProgramAssociation : GeneralStudentProgramAssociationAggregate.EdFi.GeneralStudentProgramAssociation, Entities.Common.EdFi.IStudentTitleIPartAProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { public StudentTitleIPartAProgramAssociation() { StudentTitleIPartAProgramAssociationTitleIPartAProgramServices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -154959,14 +180656,19 @@ public StudentTitleIPartAProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public override DateTime BeginDate { get; set; } [DomainSignature] + [IgnoreMember] public override long EducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override long ProgramEducationOrganizationId { get; set; } [DomainSignature] + [IgnoreMember] public override string ProgramName { get; set; } [DomainSignature] + [IgnoreMember] public override int ProgramTypeDescriptorId { get @@ -154986,6 +180688,7 @@ public override int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public override string ProgramTypeDescriptor { get @@ -155002,6 +180705,7 @@ public override string ProgramTypeDescriptor } } [Display(Name="StudentUniqueId")][DomainSignature] + [IgnoreMember] public override int StudentUSI { get @@ -155027,6 +180731,7 @@ public override int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public override string StudentUniqueId { get @@ -155075,6 +180780,7 @@ string IGeneralStudentProgramAssociation.ReasonExitedDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(19)] public virtual int TitleIPartAParticipantDescriptorId { get @@ -155094,6 +180800,7 @@ public virtual int TitleIPartAParticipantDescriptorId private int _titleIPartAParticipantDescriptorId; private string _titleIPartAParticipantDescriptor; + [IgnoreMember] public virtual string TitleIPartAParticipantDescriptor { get @@ -155121,14 +180828,27 @@ public virtual string TitleIPartAParticipantDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentTitleIPartAProgramAssociation", "StudentTitleIPartAProgramAssociation")] + [Key(20)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -155147,7 +180867,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentTitleIPartAProgramAssociation", "StudentTitleIPartAProgramAssociation")] + [Key(21)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -155161,6 +180921,8 @@ public IDictionary Extensions private ICollection _studentTitleIPartAProgramAssociationTitleIPartAProgramServices; private ICollection _studentTitleIPartAProgramAssociationTitleIPartAProgramServicesCovariant; + [Key(22)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentTitleIPartAProgramAssociationTitleIPartAProgramServices { get @@ -155170,6 +180932,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentTitleIPartAProgramAssociationTitleIPartAProgramServices"); + } + foreach (var item in _studentTitleIPartAProgramAssociationTitleIPartAProgramServices) if (item.StudentTitleIPartAProgramAssociation == null) item.StudentTitleIPartAProgramAssociation = this; @@ -155313,6 +181080,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentTitleIPartAProgramAssociationTitleIPartAProgramService : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentTitleIPartAProgramAssociationTitleIPartAProgramService, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -155320,8 +181088,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentTitleIPartAProgramAssociationTitleIPartAProgramService() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -155329,7 +181097,7 @@ public StudentTitleIPartAProgramAssociationTitleIPartAProgramService() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentTitleIPartAProgramAssociation StudentTitleIPartAProgramAssociation { get; set; } Entities.Common.EdFi.IStudentTitleIPartAProgramAssociation IStudentTitleIPartAProgramAssociationTitleIPartAProgramService.StudentTitleIPartAProgramAssociation @@ -155339,6 +181107,7 @@ Entities.Common.EdFi.IStudentTitleIPartAProgramAssociation IStudentTitleIPartAPr } [DomainSignature] + [Key(1)] public virtual int TitleIPartAProgramServiceDescriptorId { get @@ -155358,6 +181127,7 @@ public virtual int TitleIPartAProgramServiceDescriptorId private int _titleIPartAProgramServiceDescriptorId; private string _titleIPartAProgramServiceDescriptor; + [IgnoreMember] public virtual string TitleIPartAProgramServiceDescriptor { get @@ -155383,7 +181153,9 @@ public virtual string TitleIPartAProgramServiceDescriptor // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual bool? PrimaryIndicator { get; set; } + [Key(3)] public virtual DateTime? ServiceBeginDate { get { return _serviceBeginDate; } @@ -155403,6 +181175,7 @@ public virtual DateTime? ServiceBeginDate private DateTime? _serviceBeginDate; + [Key(4)] public virtual DateTime? ServiceEndDate { get { return _serviceEndDate; } @@ -155434,14 +181207,27 @@ public virtual DateTime? ServiceEndDate // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentTitleIPartAProgramAssociation", "StudentTitleIPartAProgramAssociationTitleIPartAProgramService")] + [Key(5)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -155460,7 +181246,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentTitleIPartAProgramAssociation", "StudentTitleIPartAProgramAssociationTitleIPartAProgramService")] + [Key(6)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -155489,7 +181315,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentTitleIPartAProgramAssociation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentTitleIPartAProgramAssociation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TitleIPartAProgramServiceDescriptorId", TitleIPartAProgramServiceDescriptorId); @@ -155577,24 +181403,29 @@ namespace EdFi.Ods.Entities.NHibernate.StudentTransportationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class StudentTransportationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual int StudentUSI { get; set; } + [Key(1)] public virtual long TransportationEducationOrganizationId { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -155660,6 +181491,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentTransportation : AggregateRootWithCompositeKey, Entities.Common.EdFi.IStudentTransportation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -155668,8 +181500,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentTransportation() { StudentTransportationStudentBusDetailsPersistentList = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -155678,6 +181510,7 @@ public StudentTransportation() // Primary Key // ------------------------------------------------------------- [Display(Name="StudentUniqueId")][DomainSignature] + [Key(6)] public virtual int StudentUSI { get @@ -155703,6 +181536,7 @@ public virtual int StudentUSI private int _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -155727,6 +181561,7 @@ public virtual string StudentUniqueId } } [DomainSignature] + [Key(7)] public virtual long TransportationEducationOrganizationId { get; set; } // ------------------------------------------------------------- @@ -155738,7 +181573,9 @@ public virtual string StudentUniqueId // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual string SpecialAccomodationRequirements { get; set; } + [Key(9)] public virtual int? TransportationPublicExpenseEligibilityTypeDescriptorId { get @@ -155758,6 +181595,7 @@ public virtual int? TransportationPublicExpenseEligibilityTypeDescriptorId private int? _transportationPublicExpenseEligibilityTypeDescriptorId; private string _transportationPublicExpenseEligibilityTypeDescriptor; + [IgnoreMember] public virtual string TransportationPublicExpenseEligibilityTypeDescriptor { get @@ -155773,6 +181611,7 @@ public virtual string TransportationPublicExpenseEligibilityTypeDescriptor _transportationPublicExpenseEligibilityTypeDescriptorId = default(int?); } } + [Key(10)] public virtual int? TransportationTypeDescriptorId { get @@ -155792,6 +181631,7 @@ public virtual int? TransportationTypeDescriptorId private int? _transportationTypeDescriptorId; private string _transportationTypeDescriptor; + [IgnoreMember] public virtual string TransportationTypeDescriptor { get @@ -155812,6 +181652,7 @@ public virtual string TransportationTypeDescriptor // ============================================================= // One-to-one relationships // ------------------------------------------------------------- + [IgnoreMember] public virtual Entities.NHibernate.StudentTransportationAggregate.EdFi.StudentTransportationStudentBusDetails StudentTransportationStudentBusDetails { get @@ -155848,6 +181689,8 @@ Entities.Common.EdFi.IStudentTransportationStudentBusDetails Entities.Common.EdF private ICollection _studentTransportationStudentBusDetailsPersistentList; + [Key(11)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentTransportationStudentBusDetailsPersistentList { get @@ -155857,6 +181700,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentTransportationStudentBusDetails"); + } + foreach (var item in _studentTransportationStudentBusDetailsPersistentList) if (item.StudentTransportation == null) item.StudentTransportation = this; @@ -155877,14 +181725,27 @@ public virtual ICollection _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -155903,12 +181764,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentTransportation", "StudentTransportation")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -155929,6 +181831,7 @@ string Entities.Common.EdFi.IStudentTransportation.StudentDiscriminator set { } } + [Key(15)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData TransportationEducationOrganizationReferenceData { get; set; } /// @@ -156057,6 +181960,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentTransportationStudentBusDetails : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentTransportationStudentBusDetails, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -156066,8 +181970,8 @@ public StudentTransportationStudentBusDetails() { StudentTransportationStudentBusDetailsTravelDayofWeeks = new HashSet(); StudentTransportationStudentBusDetailsTravelDirections = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -156075,7 +181979,7 @@ public StudentTransportationStudentBusDetails() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentTransportation StudentTransportation { get; set; } Entities.Common.EdFi.IStudentTransportation IStudentTransportationStudentBusDetails.StudentTransportation @@ -156094,7 +181998,9 @@ Entities.Common.EdFi.IStudentTransportation IStudentTransportationStudentBusDeta // ============================================================= // Properties // ------------------------------------------------------------- + [Key(1)] public virtual string BusNumber { get; set; } + [Key(2)] public virtual int BusRouteDescriptorId { get @@ -156114,6 +182020,7 @@ public virtual int BusRouteDescriptorId private int _busRouteDescriptorId; private string _busRouteDescriptor; + [IgnoreMember] public virtual string BusRouteDescriptor { get @@ -156129,6 +182036,7 @@ public virtual string BusRouteDescriptor _busRouteDescriptorId = default(int); } } + [Key(3)] public virtual decimal? Mileage { get; set; } // ------------------------------------------------------------- @@ -156142,14 +182050,27 @@ public virtual string BusRouteDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentTransportation", "StudentTransportationStudentBusDetails")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -156168,7 +182089,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentTransportation", "StudentTransportationStudentBusDetails")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -156182,6 +182143,8 @@ public IDictionary Extensions private ICollection _studentTransportationStudentBusDetailsTravelDayofWeeks; private ICollection _studentTransportationStudentBusDetailsTravelDayofWeeksCovariant; + [Key(6)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentTransportationStudentBusDetailsTravelDayofWeeks { get @@ -156191,6 +182154,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentTransportationStudentBusDetailsTravelDayofWeeks"); + } + foreach (var item in _studentTransportationStudentBusDetailsTravelDayofWeeks) if (item.StudentTransportationStudentBusDetails == null) item.StudentTransportationStudentBusDetails = this; @@ -156229,6 +182197,8 @@ public virtual ICollection _studentTransportationStudentBusDetailsTravelDirections; private ICollection _studentTransportationStudentBusDetailsTravelDirectionsCovariant; + [Key(7)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection StudentTransportationStudentBusDetailsTravelDirections { get @@ -156238,6 +182208,11 @@ public virtual ICollection set) + { + set.Reattach(this, "StudentTransportationStudentBusDetailsTravelDirections"); + } + foreach (var item in _studentTransportationStudentBusDetailsTravelDirections) if (item.StudentTransportationStudentBusDetails == null) item.StudentTransportationStudentBusDetails = this; @@ -156290,7 +182265,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentTransportation as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentTransportation as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values @@ -156377,6 +182352,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentTransportationStudentBusDetailsTravelDayofWeek : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentTransportationStudentBusDetailsTravelDayofWeek, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -156384,8 +182360,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentTransportationStudentBusDetailsTravelDayofWeek() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -156393,7 +182369,7 @@ public StudentTransportationStudentBusDetailsTravelDayofWeek() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentTransportationStudentBusDetails StudentTransportationStudentBusDetails { get; set; } Entities.Common.EdFi.IStudentTransportationStudentBusDetails IStudentTransportationStudentBusDetailsTravelDayofWeek.StudentTransportationStudentBusDetails @@ -156403,6 +182379,7 @@ Entities.Common.EdFi.IStudentTransportationStudentBusDetails IStudentTransportat } [DomainSignature] + [Key(1)] public virtual int TravelDayofWeekDescriptorId { get @@ -156422,6 +182399,7 @@ public virtual int TravelDayofWeekDescriptorId private int _travelDayofWeekDescriptorId; private string _travelDayofWeekDescriptor; + [IgnoreMember] public virtual string TravelDayofWeekDescriptor { get @@ -156459,14 +182437,27 @@ public virtual string TravelDayofWeekDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentTransportation", "StudentTransportationStudentBusDetailsTravelDayofWeek")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -156485,7 +182476,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentTransportation", "StudentTransportationStudentBusDetailsTravelDayofWeek")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -156513,7 +182544,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentTransportationStudentBusDetails as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentTransportationStudentBusDetails as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TravelDayofWeekDescriptorId", TravelDayofWeekDescriptorId); @@ -156601,6 +182632,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class StudentTransportationStudentBusDetailsTravelDirection : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.IStudentTransportationStudentBusDetailsTravelDirection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -156608,8 +182640,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public StudentTransportationStudentBusDetailsTravelDirection() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -156617,7 +182649,7 @@ public StudentTransportationStudentBusDetailsTravelDirection() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual StudentTransportationStudentBusDetails StudentTransportationStudentBusDetails { get; set; } Entities.Common.EdFi.IStudentTransportationStudentBusDetails IStudentTransportationStudentBusDetailsTravelDirection.StudentTransportationStudentBusDetails @@ -156627,6 +182659,7 @@ Entities.Common.EdFi.IStudentTransportationStudentBusDetails IStudentTransportat } [DomainSignature] + [Key(1)] public virtual int TravelDirectionDescriptorId { get @@ -156646,6 +182679,7 @@ public virtual int TravelDirectionDescriptorId private int _travelDirectionDescriptorId; private string _travelDirectionDescriptor; + [IgnoreMember] public virtual string TravelDirectionDescriptor { get @@ -156683,14 +182717,27 @@ public virtual string TravelDirectionDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "StudentTransportation", "StudentTransportationStudentBusDetailsTravelDirection")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -156709,7 +182756,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "StudentTransportation", "StudentTransportationStudentBusDetailsTravelDirection")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -156737,7 +182824,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (StudentTransportationStudentBusDetails as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (StudentTransportationStudentBusDetails as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("TravelDirectionDescriptorId", TravelDirectionDescriptorId); @@ -156830,6 +182917,7 @@ namespace EdFi.Ods.Entities.NHibernate.SubmissionStatusDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SubmissionStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISubmissionStatusDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -156838,6 +182926,7 @@ public class SubmissionStatusDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SubmissionStatusDescriptorId { get { return base.DescriptorId; } @@ -157009,6 +183098,7 @@ namespace EdFi.Ods.Entities.NHibernate.SupporterMilitaryConnectionDescriptorAggr /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SupporterMilitaryConnectionDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISupporterMilitaryConnectionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -157017,6 +183107,7 @@ public class SupporterMilitaryConnectionDescriptor : DescriptorAggregate.EdFi.De // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SupporterMilitaryConnectionDescriptorId { get { return base.DescriptorId; } @@ -157183,24 +183274,29 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(2)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(3)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -157266,6 +183362,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class Survey : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurvey, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -157273,8 +183370,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public Survey() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -157283,8 +183380,10 @@ public Survey() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(7)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- @@ -157296,11 +183395,17 @@ public Survey() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(8)] public virtual long? EducationOrganizationId { get; set; } + [Key(9)] public virtual int? NumberAdministered { get; set; } + [Key(10)] public virtual long? SchoolId { get; set; } + [Key(11)] public virtual short SchoolYear { get; set; } + [Key(12)] public virtual string SessionName { get; set; } + [Key(13)] public virtual int? SurveyCategoryDescriptorId { get @@ -157320,6 +183425,7 @@ public virtual int? SurveyCategoryDescriptorId private int? _surveyCategoryDescriptorId; private string _surveyCategoryDescriptor; + [IgnoreMember] public virtual string SurveyCategoryDescriptor { get @@ -157335,6 +183441,7 @@ public virtual string SurveyCategoryDescriptor _surveyCategoryDescriptorId = default(int?); } } + [Key(14)] public virtual string SurveyTitle { get; set; } // ------------------------------------------------------------- @@ -157348,14 +183455,27 @@ public virtual string SurveyCategoryDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "Survey", "Survey")] + [Key(15)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -157374,12 +183494,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "Survey", "Survey")] + [Key(16)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(17)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -157400,6 +183561,7 @@ string Entities.Common.EdFi.ISurvey.EducationOrganizationDiscriminator set { } } + [Key(18)] public virtual NHibernate.SchoolYearTypeAggregate.EdFi.SchoolYearTypeReferenceData SchoolYearTypeReferenceData { get; set; } /// @@ -157411,6 +183573,7 @@ string Entities.Common.EdFi.ISurvey.EducationOrganizationDiscriminator set { } } + [Key(19)] public virtual NHibernate.SessionAggregate.EdFi.SessionReferenceData SessionReferenceData { get; set; } /// @@ -157543,6 +183706,7 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyCategoryDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISurveyCategoryDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -157551,6 +183715,7 @@ public class SurveyCategoryDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SurveyCategoryDescriptorId { get { return base.DescriptorId; } @@ -157717,26 +183882,33 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyCourseAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyCourseAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string CourseCode { get; set; } + [Key(1)] public virtual long EducationOrganizationId { get; set; } + [Key(2)] public virtual string Namespace { get; set; } + [Key(3)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -157804,6 +183976,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyCourseAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveyCourseAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -157811,8 +183984,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyCourseAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -157821,12 +183994,16 @@ public SurveyCourseAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string CourseCode { get; set; } [DomainSignature] + [Key(7)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(8)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(9)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- @@ -157850,14 +184027,27 @@ public SurveyCourseAssociation() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyCourseAssociation", "SurveyCourseAssociation")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -157876,12 +184066,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyCourseAssociation", "SurveyCourseAssociation")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.CourseAggregate.EdFi.CourseReferenceData CourseReferenceData { get; set; } /// @@ -157902,6 +184133,7 @@ string Entities.Common.EdFi.ISurveyCourseAssociation.CourseDiscriminator set { } } + [Key(13)] public virtual NHibernate.SurveyAggregate.EdFi.SurveyReferenceData SurveyReferenceData { get; set; } /// @@ -158035,6 +184267,7 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyLevelDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ISurveyLevelDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -158043,6 +184276,7 @@ public class SurveyLevelDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int SurveyLevelDescriptorId { get { return base.DescriptorId; } @@ -158209,27 +184443,35 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyProgramAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyProgramAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string Namespace { get; set; } + [Key(2)] public virtual string ProgramName { get; set; } + [Key(3)] public virtual int ProgramTypeDescriptorId { get; set; } + [Key(4)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -158298,6 +184540,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyProgramAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveyProgramAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -158305,8 +184548,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyProgramAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -158315,12 +184558,16 @@ public SurveyProgramAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(8)] public virtual string ProgramName { get; set; } [DomainSignature] + [Key(9)] public virtual int ProgramTypeDescriptorId { get @@ -158340,6 +184587,7 @@ public virtual int ProgramTypeDescriptorId private int _programTypeDescriptorId; private string _programTypeDescriptor; + [IgnoreMember] public virtual string ProgramTypeDescriptor { get @@ -158356,6 +184604,7 @@ public virtual string ProgramTypeDescriptor } } [DomainSignature] + [Key(10)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- @@ -158379,14 +184628,27 @@ public virtual string ProgramTypeDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyProgramAssociation", "SurveyProgramAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -158405,12 +184667,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyProgramAssociation", "SurveyProgramAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.ProgramAggregate.EdFi.ProgramReferenceData ProgramReferenceData { get; set; } /// @@ -158431,6 +184734,7 @@ string Entities.Common.EdFi.ISurveyProgramAssociation.ProgramDiscriminator set { } } + [Key(14)] public virtual NHibernate.SurveyAggregate.EdFi.SurveyReferenceData SurveyReferenceData { get; set; } /// @@ -158561,25 +184865,31 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyQuestionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyQuestionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual string QuestionCode { get; set; } + [Key(2)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -158646,6 +184956,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyQuestion : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveyQuestion, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -158655,8 +184966,8 @@ public SurveyQuestion() { SurveyQuestionMatrices = new HashSet(); SurveyQuestionResponseChoices = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -158665,10 +184976,13 @@ public SurveyQuestion() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(7)] public virtual string QuestionCode { get; set; } [DomainSignature] + [Key(8)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- @@ -158680,6 +184994,7 @@ public SurveyQuestion() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual int QuestionFormDescriptorId { get @@ -158699,6 +185014,7 @@ public virtual int QuestionFormDescriptorId private int _questionFormDescriptorId; private string _questionFormDescriptor; + [IgnoreMember] public virtual string QuestionFormDescriptor { get @@ -158714,7 +185030,9 @@ public virtual string QuestionFormDescriptor _questionFormDescriptorId = default(int); } } + [Key(10)] public virtual string QuestionText { get; set; } + [Key(11)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- @@ -158728,14 +185046,27 @@ public virtual string QuestionFormDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyQuestion", "SurveyQuestion")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -158754,12 +185085,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyQuestion", "SurveyQuestion")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.SurveyAggregate.EdFi.SurveyReferenceData SurveyReferenceData { get; set; } /// @@ -158780,6 +185152,7 @@ string Entities.Common.EdFi.ISurveyQuestion.SurveyDiscriminator set { } } + [Key(15)] public virtual NHibernate.SurveySectionAggregate.EdFi.SurveySectionReferenceData SurveySectionReferenceData { get; set; } /// @@ -158808,6 +185181,8 @@ string Entities.Common.EdFi.ISurveyQuestion.SurveySectionDiscriminator private ICollection _surveyQuestionMatrices; private ICollection _surveyQuestionMatricesCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SurveyQuestionMatrices { get @@ -158817,6 +185192,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SurveyQuestionMatrices"); + } + foreach (var item in _surveyQuestionMatrices) if (item.SurveyQuestion == null) item.SurveyQuestion = this; @@ -158855,6 +185235,8 @@ public virtual ICollection _surveyQuestionResponseChoices; private ICollection _surveyQuestionResponseChoicesCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SurveyQuestionResponseChoices { get @@ -158864,6 +185246,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SurveyQuestionResponseChoices"); + } + foreach (var item in _surveyQuestionResponseChoices) if (item.SurveyQuestion == null) item.SurveyQuestion = this; @@ -159002,6 +185389,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyQuestionMatrix : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISurveyQuestionMatrix, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -159009,8 +185397,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyQuestionMatrix() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -159018,7 +185406,7 @@ public SurveyQuestionMatrix() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual SurveyQuestion SurveyQuestion { get; set; } Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionMatrix.SurveyQuestion @@ -159028,6 +185416,7 @@ Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionMatrix.SurveyQuestion } [DomainSignature] + [Key(1)] public virtual string MatrixElement { get; set; } // ------------------------------------------------------------- @@ -159039,7 +185428,9 @@ Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionMatrix.SurveyQuestion // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? MaxRawScore { get; set; } + [Key(3)] public virtual int? MinRawScore { get; set; } // ------------------------------------------------------------- @@ -159053,14 +185444,27 @@ Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionMatrix.SurveyQuestion // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyQuestion", "SurveyQuestionMatrix")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -159079,7 +185483,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyQuestion", "SurveyQuestionMatrix")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -159106,7 +185550,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (SurveyQuestion as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (SurveyQuestion as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("MatrixElement", MatrixElement); @@ -159194,6 +185638,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyQuestionResponseChoice : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISurveyQuestionResponseChoice, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -159201,8 +185646,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyQuestionResponseChoice() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -159210,7 +185655,7 @@ public SurveyQuestionResponseChoice() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual SurveyQuestion SurveyQuestion { get; set; } Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionResponseChoice.SurveyQuestion @@ -159220,6 +185665,7 @@ Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionResponseChoice.SurveyQuestio } [DomainSignature] + [Key(1)] public virtual int SortOrder { get; set; } // ------------------------------------------------------------- @@ -159231,7 +185677,9 @@ Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionResponseChoice.SurveyQuestio // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? NumericValue { get; set; } + [Key(3)] public virtual string TextValue { get; set; } // ------------------------------------------------------------- @@ -159245,14 +185693,27 @@ Entities.Common.EdFi.ISurveyQuestion ISurveyQuestionResponseChoice.SurveyQuestio // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyQuestion", "SurveyQuestionResponseChoice")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -159271,7 +185732,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyQuestion", "SurveyQuestionResponseChoice")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -159298,7 +185799,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (SurveyQuestion as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (SurveyQuestion as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SortOrder", SortOrder); @@ -159386,26 +185887,33 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyQuestionResponseAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyQuestionResponseReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual string QuestionCode { get; set; } + [Key(2)] public virtual string SurveyIdentifier { get; set; } + [Key(3)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -159473,6 +185981,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyQuestionResponse : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveyQuestionResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -159482,8 +185991,8 @@ public SurveyQuestionResponse() { SurveyQuestionResponseSurveyQuestionMatrixElementResponses = new HashSet(); SurveyQuestionResponseValues = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -159492,12 +186001,16 @@ public SurveyQuestionResponse() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(7)] public virtual string QuestionCode { get; set; } [DomainSignature] + [Key(8)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(9)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- @@ -159509,7 +186022,9 @@ public SurveyQuestionResponse() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual string Comment { get; set; } + [Key(11)] public virtual bool? NoResponse { get; set; } // ------------------------------------------------------------- @@ -159523,14 +186038,27 @@ public SurveyQuestionResponse() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyQuestionResponse", "SurveyQuestionResponse")] + [Key(12)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -159549,12 +186077,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyQuestionResponse", "SurveyQuestionResponse")] + [Key(13)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(14)] public virtual NHibernate.SurveyQuestionAggregate.EdFi.SurveyQuestionReferenceData SurveyQuestionReferenceData { get; set; } /// @@ -159575,6 +186144,7 @@ string Entities.Common.EdFi.ISurveyQuestionResponse.SurveyQuestionDiscriminator set { } } + [Key(15)] public virtual NHibernate.SurveyResponseAggregate.EdFi.SurveyResponseReferenceData SurveyResponseReferenceData { get; set; } /// @@ -159603,6 +186173,8 @@ string Entities.Common.EdFi.ISurveyQuestionResponse.SurveyResponseDiscriminator private ICollection _surveyQuestionResponseSurveyQuestionMatrixElementResponses; private ICollection _surveyQuestionResponseSurveyQuestionMatrixElementResponsesCovariant; + [Key(16)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SurveyQuestionResponseSurveyQuestionMatrixElementResponses { get @@ -159612,6 +186184,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SurveyQuestionResponseSurveyQuestionMatrixElementResponses"); + } + foreach (var item in _surveyQuestionResponseSurveyQuestionMatrixElementResponses) if (item.SurveyQuestionResponse == null) item.SurveyQuestionResponse = this; @@ -159650,6 +186227,8 @@ public virtual ICollection _surveyQuestionResponseValues; private ICollection _surveyQuestionResponseValuesCovariant; + [Key(17)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SurveyQuestionResponseValues { get @@ -159659,6 +186238,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SurveyQuestionResponseValues"); + } + foreach (var item in _surveyQuestionResponseValues) if (item.SurveyQuestionResponse == null) item.SurveyQuestionResponse = this; @@ -159797,6 +186381,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyQuestionResponseSurveyQuestionMatrixElementResponse : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISurveyQuestionResponseSurveyQuestionMatrixElementResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -159804,8 +186389,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyQuestionResponseSurveyQuestionMatrixElementResponse() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -159813,7 +186398,7 @@ public SurveyQuestionResponseSurveyQuestionMatrixElementResponse() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual SurveyQuestionResponse SurveyQuestionResponse { get; set; } Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseSurveyQuestionMatrixElementResponse.SurveyQuestionResponse @@ -159823,6 +186408,7 @@ Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseSurveyQuesti } [DomainSignature] + [Key(1)] public virtual string MatrixElement { get; set; } // ------------------------------------------------------------- @@ -159834,10 +186420,15 @@ Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseSurveyQuesti // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? MaxNumericResponse { get; set; } + [Key(3)] public virtual int? MinNumericResponse { get; set; } + [Key(4)] public virtual bool? NoResponse { get; set; } + [Key(5)] public virtual int? NumericResponse { get; set; } + [Key(6)] public virtual string TextResponse { get; set; } // ------------------------------------------------------------- @@ -159851,14 +186442,27 @@ Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseSurveyQuesti // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyQuestionResponse", "SurveyQuestionResponseSurveyQuestionMatrixElementResponse")] + [Key(7)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -159877,7 +186481,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyQuestionResponse", "SurveyQuestionResponseSurveyQuestionMatrixElementResponse")] + [Key(8)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -159904,7 +186548,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (SurveyQuestionResponse as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (SurveyQuestionResponse as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("MatrixElement", MatrixElement); @@ -159992,6 +186636,7 @@ void IChildEntity.SetParent(object value) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyQuestionResponseValue : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISurveyQuestionResponseValue, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -159999,8 +186644,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyQuestionResponseValue() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -160008,7 +186653,7 @@ public SurveyQuestionResponseValue() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual SurveyQuestionResponse SurveyQuestionResponse { get; set; } Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseValue.SurveyQuestionResponse @@ -160018,6 +186663,7 @@ Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseValue.Survey } [DomainSignature] + [Key(1)] public virtual int SurveyQuestionResponseValueIdentifier { get; set; } // ------------------------------------------------------------- @@ -160029,7 +186675,9 @@ Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseValue.Survey // ============================================================= // Properties // ------------------------------------------------------------- + [Key(2)] public virtual int? NumericResponse { get; set; } + [Key(3)] public virtual string TextResponse { get; set; } // ------------------------------------------------------------- @@ -160043,14 +186691,27 @@ Entities.Common.EdFi.ISurveyQuestionResponse ISurveyQuestionResponseValue.Survey // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyQuestionResponse", "SurveyQuestionResponseValue")] + [Key(4)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -160069,7 +186730,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyQuestionResponse", "SurveyQuestionResponseValue")] + [Key(5)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -160096,7 +186797,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (SurveyQuestionResponse as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (SurveyQuestionResponse as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SurveyQuestionResponseValueIdentifier", SurveyQuestionResponseValueIdentifier); @@ -160184,25 +186885,31 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyResponseAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyResponseReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual string SurveyIdentifier { get; set; } + [Key(2)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -160269,6 +186976,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyResponse : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveyResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -160277,8 +186985,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyResponse() { SurveyResponseSurveyLevels = new HashSet(); - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -160287,10 +186995,13 @@ public SurveyResponse() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(7)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(8)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- @@ -160302,6 +187013,7 @@ public SurveyResponse() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(9)] public virtual int? ContactUSI { get @@ -160331,6 +187043,7 @@ public virtual int? ContactUSI private int? _contactUSI; private string _contactUniqueId; + [IgnoreMember] public virtual string ContactUniqueId { get @@ -160354,9 +187067,13 @@ public virtual string ContactUniqueId _contactUniqueId = value; } } + [Key(10)] public virtual string ElectronicMailAddress { get; set; } + [Key(11)] public virtual string FullName { get; set; } + [Key(12)] public virtual string Location { get; set; } + [Key(13)] public virtual DateTime ResponseDate { get { return _responseDate; } @@ -160366,7 +187083,9 @@ public virtual DateTime ResponseDate private DateTime _responseDate; + [Key(14)] public virtual int? ResponseTime { get; set; } + [Key(15)] public virtual int? StaffUSI { get @@ -160396,6 +187115,7 @@ public virtual int? StaffUSI private int? _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -160419,6 +187139,7 @@ public virtual string StaffUniqueId _staffUniqueId = value; } } + [Key(16)] public virtual int? StudentUSI { get @@ -160448,6 +187169,7 @@ public virtual int? StudentUSI private int? _studentUSI; private string _studentUniqueId; + [IgnoreMember] public virtual string StudentUniqueId { get @@ -160483,14 +187205,27 @@ public virtual string StudentUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyResponse", "SurveyResponse")] + [Key(17)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -160509,12 +187244,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyResponse", "SurveyResponse")] + [Key(18)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(19)] public virtual NHibernate.ContactAggregate.EdFi.ContactReferenceData ContactReferenceData { get; set; } /// @@ -160535,6 +187311,7 @@ string Entities.Common.EdFi.ISurveyResponse.ContactDiscriminator set { } } + [Key(20)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -160555,6 +187332,7 @@ string Entities.Common.EdFi.ISurveyResponse.StaffDiscriminator set { } } + [Key(21)] public virtual NHibernate.StudentAggregate.EdFi.StudentReferenceData StudentReferenceData { get; set; } /// @@ -160575,6 +187353,7 @@ string Entities.Common.EdFi.ISurveyResponse.StudentDiscriminator set { } } + [Key(22)] public virtual NHibernate.SurveyAggregate.EdFi.SurveyReferenceData SurveyReferenceData { get; set; } /// @@ -160603,6 +187382,8 @@ string Entities.Common.EdFi.ISurveyResponse.SurveyDiscriminator private ICollection _surveyResponseSurveyLevels; private ICollection _surveyResponseSurveyLevelsCovariant; + [Key(23)] + [MessagePackFormatter(typeof(PersistentCollectionFormatter))] public virtual ICollection SurveyResponseSurveyLevels { get @@ -160612,6 +187393,11 @@ public virtual ICollection set) + { + set.Reattach(this, "SurveyResponseSurveyLevels"); + } + foreach (var item in _surveyResponseSurveyLevels) if (item.SurveyResponse == null) item.SurveyResponse = this; @@ -160749,6 +187535,7 @@ void IMappable.Map(object target) /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyResponseSurveyLevel : EntityWithCompositeKey, IChildEntity, Entities.Common.EdFi.ISurveyResponseSurveyLevel, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -160756,8 +187543,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyResponseSurveyLevel() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -160765,7 +187552,7 @@ public SurveyResponseSurveyLevel() // ============================================================= // Primary Key // ------------------------------------------------------------- - [DomainSignature, JsonIgnore] + [DomainSignature, IgnoreMember] public virtual SurveyResponse SurveyResponse { get; set; } Entities.Common.EdFi.ISurveyResponse ISurveyResponseSurveyLevel.SurveyResponse @@ -160775,6 +187562,7 @@ Entities.Common.EdFi.ISurveyResponse ISurveyResponseSurveyLevel.SurveyResponse } [DomainSignature] + [Key(1)] public virtual int SurveyLevelDescriptorId { get @@ -160794,6 +187582,7 @@ public virtual int SurveyLevelDescriptorId private int _surveyLevelDescriptorId; private string _surveyLevelDescriptor; + [IgnoreMember] public virtual string SurveyLevelDescriptor { get @@ -160831,14 +187620,27 @@ public virtual string SurveyLevelDescriptor // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyResponse", "SurveyResponseSurveyLevel")] + [Key(2)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -160857,7 +187659,47 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyResponse", "SurveyResponseSurveyLevel")] + [Key(3)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= @@ -160885,7 +187727,7 @@ Dictionary IHasLookupColumnPropertyMap.IdPropertyBy OrderedDictionary IHasPrimaryKeyValues.GetPrimaryKeyValues() { // Get parent key values - var keyValues = (SurveyResponse as IHasPrimaryKeyValues).GetPrimaryKeyValues(); + var keyValues = (SurveyResponse as IHasPrimaryKeyValues)?.GetPrimaryKeyValues() ?? new OrderedDictionary(); // Add current key values keyValues.Add("SurveyLevelDescriptorId", SurveyLevelDescriptorId); @@ -160973,26 +187815,33 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyResponseEducationOrganizationTarget /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyResponseEducationOrganizationTargetAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string Namespace { get; set; } + [Key(2)] public virtual string SurveyIdentifier { get; set; } + [Key(3)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -161060,6 +187909,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyResponseEducationOrganizationTargetAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveyResponseEducationOrganizationTargetAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -161067,8 +187917,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyResponseEducationOrganizationTargetAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -161077,12 +187927,16 @@ public SurveyResponseEducationOrganizationTargetAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(8)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(9)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- @@ -161106,14 +187960,27 @@ public SurveyResponseEducationOrganizationTargetAssociation() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyResponseEducationOrganizationTargetAssociation", "SurveyResponseEducationOrganizationTargetAssociation")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -161132,12 +187999,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyResponseEducationOrganizationTargetAssociation", "SurveyResponseEducationOrganizationTargetAssociation")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -161158,6 +188066,7 @@ string Entities.Common.EdFi.ISurveyResponseEducationOrganizationTargetAssociatio set { } } + [Key(13)] public virtual NHibernate.SurveyResponseAggregate.EdFi.SurveyResponseReferenceData SurveyResponseReferenceData { get; set; } /// @@ -161286,26 +188195,33 @@ namespace EdFi.Ods.Entities.NHibernate.SurveyResponseStaffTargetAssociationAggre /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveyResponseStaffTargetAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual int StaffUSI { get; set; } + [Key(2)] public virtual string SurveyIdentifier { get; set; } + [Key(3)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -161373,6 +188289,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveyResponseStaffTargetAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveyResponseStaffTargetAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -161380,8 +188297,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveyResponseStaffTargetAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -161390,8 +188307,10 @@ public SurveyResponseStaffTargetAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(7)] public virtual int StaffUSI { get @@ -161417,6 +188336,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -161441,8 +188361,10 @@ public virtual string StaffUniqueId } } [DomainSignature] + [Key(8)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(9)] public virtual string SurveyResponseIdentifier { get; set; } // ------------------------------------------------------------- @@ -161466,14 +188388,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveyResponseStaffTargetAssociation", "SurveyResponseStaffTargetAssociation")] + [Key(10)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -161492,12 +188427,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveyResponseStaffTargetAssociation", "SurveyResponseStaffTargetAssociation")] + [Key(11)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(12)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -161518,6 +188494,7 @@ string Entities.Common.EdFi.ISurveyResponseStaffTargetAssociation.StaffDiscrimin set { } } + [Key(13)] public virtual NHibernate.SurveyResponseAggregate.EdFi.SurveyResponseReferenceData SurveyResponseReferenceData { get; set; } /// @@ -161646,25 +188623,31 @@ namespace EdFi.Ods.Entities.NHibernate.SurveySectionAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveySectionReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual string SurveyIdentifier { get; set; } + [Key(2)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(3)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(4)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -161731,6 +188714,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveySection : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveySection, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -161738,8 +188722,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveySection() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -161748,10 +188732,13 @@ public SurveySection() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(7)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(8)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- @@ -161775,14 +188762,27 @@ public SurveySection() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveySection", "SurveySection")] + [Key(9)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -161801,12 +188801,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveySection", "SurveySection")] + [Key(10)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(11)] public virtual NHibernate.SurveyAggregate.EdFi.SurveyReferenceData SurveyReferenceData { get; set; } /// @@ -161934,29 +188975,39 @@ namespace EdFi.Ods.Entities.NHibernate.SurveySectionAssociationAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveySectionAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string LocalCourseCode { get; set; } + [Key(1)] public virtual string Namespace { get; set; } + [Key(2)] public virtual long SchoolId { get; set; } + [Key(3)] public virtual short SchoolYear { get; set; } + [Key(4)] public virtual string SectionIdentifier { get; set; } + [Key(5)] public virtual string SessionName { get; set; } + [Key(6)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(7)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(8)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -162027,6 +189078,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveySectionAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveySectionAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -162034,8 +189086,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveySectionAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -162044,18 +189096,25 @@ public SurveySectionAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string LocalCourseCode { get; set; } [DomainSignature] + [Key(7)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(8)] public virtual long SchoolId { get; set; } [DomainSignature] + [Key(9)] public virtual short SchoolYear { get; set; } [DomainSignature] + [Key(10)] public virtual string SectionIdentifier { get; set; } [DomainSignature] + [Key(11)] public virtual string SessionName { get; set; } [DomainSignature] + [Key(12)] public virtual string SurveyIdentifier { get; set; } // ------------------------------------------------------------- @@ -162079,14 +189138,27 @@ public SurveySectionAssociation() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveySectionAssociation", "SurveySectionAssociation")] + [Key(13)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -162105,12 +189177,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveySectionAssociation", "SurveySectionAssociation")] + [Key(14)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(15)] public virtual NHibernate.SectionAggregate.EdFi.SectionReferenceData SectionReferenceData { get; set; } /// @@ -162131,6 +189244,7 @@ string Entities.Common.EdFi.ISurveySectionAssociation.SectionDiscriminator set { } } + [Key(16)] public virtual NHibernate.SurveyAggregate.EdFi.SurveyReferenceData SurveyReferenceData { get; set; } /// @@ -162262,26 +189376,33 @@ namespace EdFi.Ods.Entities.NHibernate.SurveySectionResponseAggregate.EdFi /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveySectionResponseReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual string SurveyIdentifier { get; set; } + [Key(2)] public virtual string SurveyResponseIdentifier { get; set; } + [Key(3)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(4)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(5)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -162349,6 +189470,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveySectionResponse : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveySectionResponse, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -162356,8 +189478,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveySectionResponse() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -162366,12 +189488,16 @@ public SurveySectionResponse() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(7)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(8)] public virtual string SurveyResponseIdentifier { get; set; } [DomainSignature] + [Key(9)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- @@ -162383,6 +189509,7 @@ public SurveySectionResponse() // ============================================================= // Properties // ------------------------------------------------------------- + [Key(10)] public virtual decimal? SectionRating { get; set; } // ------------------------------------------------------------- @@ -162396,14 +189523,27 @@ public SurveySectionResponse() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveySectionResponse", "SurveySectionResponse")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -162422,12 +189562,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveySectionResponse", "SurveySectionResponse")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.SurveyResponseAggregate.EdFi.SurveyResponseReferenceData SurveyResponseReferenceData { get; set; } /// @@ -162448,6 +189629,7 @@ string Entities.Common.EdFi.ISurveySectionResponse.SurveyResponseDiscriminator set { } } + [Key(14)] public virtual NHibernate.SurveySectionAggregate.EdFi.SurveySectionReferenceData SurveySectionReferenceData { get; set; } /// @@ -162576,27 +189758,35 @@ namespace EdFi.Ods.Entities.NHibernate.SurveySectionResponseEducationOrganizatio /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveySectionResponseEducationOrganizationTargetAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual long EducationOrganizationId { get; set; } + [Key(1)] public virtual string Namespace { get; set; } + [Key(2)] public virtual string SurveyIdentifier { get; set; } + [Key(3)] public virtual string SurveyResponseIdentifier { get; set; } + [Key(4)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -162665,6 +189855,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveySectionResponseEducationOrganizationTargetAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveySectionResponseEducationOrganizationTargetAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -162672,8 +189863,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveySectionResponseEducationOrganizationTargetAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -162682,14 +189873,19 @@ public SurveySectionResponseEducationOrganizationTargetAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual long EducationOrganizationId { get; set; } [DomainSignature] + [Key(7)] public virtual string Namespace { get; set; } [DomainSignature] + [Key(8)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(9)] public virtual string SurveyResponseIdentifier { get; set; } [DomainSignature] + [Key(10)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- @@ -162713,14 +189909,27 @@ public SurveySectionResponseEducationOrganizationTargetAssociation() // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveySectionResponseEducationOrganizationTargetAssociation", "SurveySectionResponseEducationOrganizationTargetAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -162739,12 +189948,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveySectionResponseEducationOrganizationTargetAssociation", "SurveySectionResponseEducationOrganizationTargetAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.EducationOrganizationAggregate.EdFi.EducationOrganizationReferenceData EducationOrganizationReferenceData { get; set; } /// @@ -162765,6 +190015,7 @@ string Entities.Common.EdFi.ISurveySectionResponseEducationOrganizationTargetAss set { } } + [Key(14)] public virtual NHibernate.SurveySectionResponseAggregate.EdFi.SurveySectionResponseReferenceData SurveySectionResponseReferenceData { get; set; } /// @@ -162894,27 +190145,35 @@ namespace EdFi.Ods.Entities.NHibernate.SurveySectionResponseStaffTargetAssociati /// /// Represents a read-only reference to the entity. /// + [MessagePackObject] public class SurveySectionResponseStaffTargetAssociationReferenceData : IHasPrimaryKeyValues { // ============================================================= // Primary Key // ------------------------------------------------------------- + [Key(0)] public virtual string Namespace { get; set; } + [Key(1)] public virtual int StaffUSI { get; set; } + [Key(2)] public virtual string SurveyIdentifier { get; set; } + [Key(3)] public virtual string SurveyResponseIdentifier { get; set; } + [Key(4)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- /// /// The id of the referenced entity (used as the resource identifier in the API). /// + [Key(5)] public virtual Guid? Id { get; set; } /// /// Gets and sets the discriminator value which identifies the concrete sub-type of the referenced entity /// when that entity has been derived; otherwise null. /// + [Key(6)] public virtual string Discriminator { get; set; } // Provide primary key information @@ -162983,6 +190242,7 @@ public override int GetHashCode() /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class SurveySectionResponseStaffTargetAssociation : AggregateRootWithCompositeKey, Entities.Common.EdFi.ISurveySectionResponseStaffTargetAssociation, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IHasExtensions { @@ -162990,8 +190250,8 @@ public virtual void SuspendReferenceAssignmentCheck() { } public SurveySectionResponseStaffTargetAssociation() { - Extensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateRequiredEntityExtensions(this)); - AggregateExtensions = EntityExtensionsFactory.Instance == null ? new Dictionary() : new Dictionary(EntityExtensionsFactory.Instance.CreateAggregateExtensions()); + Extensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateRequiredEntityExtensions(this)); + AggregateExtensions = GeneratedArtifactStaticDependencies.EntityExtensionsFactory == null ? new Dictionary() : new Dictionary(GeneratedArtifactStaticDependencies.EntityExtensionsFactory.CreateAggregateExtensions()); } // restore warnings for inheritance from classes marked Obsolete #pragma warning restore 612, 618 @@ -163000,8 +190260,10 @@ public SurveySectionResponseStaffTargetAssociation() // Primary Key // ------------------------------------------------------------- [DomainSignature] + [Key(6)] public virtual string Namespace { get; set; } [Display(Name="StaffUniqueId")][DomainSignature] + [Key(7)] public virtual int StaffUSI { get @@ -163027,6 +190289,7 @@ public virtual int StaffUSI private int _staffUSI; private string _staffUniqueId; + [IgnoreMember] public virtual string StaffUniqueId { get @@ -163051,10 +190314,13 @@ public virtual string StaffUniqueId } } [DomainSignature] + [Key(8)] public virtual string SurveyIdentifier { get; set; } [DomainSignature] + [Key(9)] public virtual string SurveyResponseIdentifier { get; set; } [DomainSignature] + [Key(10)] public virtual string SurveySectionTitle { get; set; } // ------------------------------------------------------------- @@ -163078,14 +190344,27 @@ public virtual string StaffUniqueId // ------------------------------------------------------------- private IDictionary _extensions; + [MessagePackFormatter(typeof(EntityExtensionsMessagePackFormatter), "SurveySectionResponseStaffTargetAssociation", "SurveySectionResponseStaffTargetAssociation")] + [Key(11)] public IDictionary Extensions { - get => _extensions; + get + { + foreach (var key in _extensions.Keys) + { + if (_extensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachExtension(this, (string) key); + } + } + + return _extensions; + } set { // If the _extensions is null, this is being assigned from the constructor // for the first time and no special handling is required - if (_extensions != null) + if (_extensions != null && value != null) { // For extensions that have already been initialized by the extensions factory, // we need to copy any "implicit" extension object entries over to the incoming @@ -163104,12 +190383,53 @@ public IDictionary Extensions } } - public IDictionary AggregateExtensions { get; set; } + private IDictionary _aggregateExtensions; + + [MessagePackFormatter(typeof(AggregateExtensionsMessagePackFormatter), "SurveySectionResponseStaffTargetAssociation", "SurveySectionResponseStaffTargetAssociation")] + [Key(12)] + public IDictionary AggregateExtensions + { + get + { + foreach (var key in _aggregateExtensions.Keys) + { + if (_aggregateExtensions[key] is IDeserializedPersistentGenericCollection collection) + { + collection.ReattachAggregateExtension(this, (string) key); + } + } + + return _aggregateExtensions; + } + set + { + // If the _aggregateExtensions is null, this is being assigned from the constructor + // for the first time and no special handling is required + if (_aggregateExtensions != null && value != null) + { + // For aggregate extensions that have already been initialized by the extensions factory, + // we need to copy any "implicit" aggregate extension object entries over to the incoming + // value dictionary being assigned by NHibernate (or deserialization) because it won't have them, + // but they must be there for correct handling of extensions for the API. + foreach (var key in _aggregateExtensions.Keys) + { + if (!value.Contains(key)) + { + value[key] = _aggregateExtensions[key]; + } + } + } + + _aggregateExtensions = value; + } + } + // ------------------------------------------------------------- // ============================================================= // Reference Data // ------------------------------------------------------------- + [Key(13)] public virtual NHibernate.StaffAggregate.EdFi.StaffReferenceData StaffReferenceData { get; set; } /// @@ -163130,6 +190450,7 @@ string Entities.Common.EdFi.ISurveySectionResponseStaffTargetAssociation.StaffDi set { } } + [Key(14)] public virtual NHibernate.SurveySectionResponseAggregate.EdFi.SurveySectionResponseReferenceData SurveySectionResponseReferenceData { get; set; } /// @@ -163264,6 +190585,7 @@ namespace EdFi.Ods.Entities.NHibernate.TeachingCredentialBasisDescriptorAggregat /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TeachingCredentialBasisDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITeachingCredentialBasisDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -163272,6 +190594,7 @@ public class TeachingCredentialBasisDescriptor : DescriptorAggregate.EdFi.Descri // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TeachingCredentialBasisDescriptorId { get { return base.DescriptorId; } @@ -163443,6 +190766,7 @@ namespace EdFi.Ods.Entities.NHibernate.TeachingCredentialDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TeachingCredentialDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITeachingCredentialDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -163451,6 +190775,7 @@ public class TeachingCredentialDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TeachingCredentialDescriptorId { get { return base.DescriptorId; } @@ -163622,6 +190947,7 @@ namespace EdFi.Ods.Entities.NHibernate.TechnicalSkillsAssessmentDescriptorAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TechnicalSkillsAssessmentDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITechnicalSkillsAssessmentDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -163630,6 +190956,7 @@ public class TechnicalSkillsAssessmentDescriptor : DescriptorAggregate.EdFi.Desc // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TechnicalSkillsAssessmentDescriptorId { get { return base.DescriptorId; } @@ -163801,6 +191128,7 @@ namespace EdFi.Ods.Entities.NHibernate.TelephoneNumberTypeDescriptorAggregate.Ed /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TelephoneNumberTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITelephoneNumberTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -163809,6 +191137,7 @@ public class TelephoneNumberTypeDescriptor : DescriptorAggregate.EdFi.Descriptor // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TelephoneNumberTypeDescriptorId { get { return base.DescriptorId; } @@ -163980,6 +191309,7 @@ namespace EdFi.Ods.Entities.NHibernate.TermDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TermDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITermDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -163988,6 +191318,7 @@ public class TermDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TermDescriptorId { get { return base.DescriptorId; } @@ -164159,6 +191490,7 @@ namespace EdFi.Ods.Entities.NHibernate.TitleIPartAParticipantDescriptorAggregate /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TitleIPartAParticipantDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITitleIPartAParticipantDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -164167,6 +191499,7 @@ public class TitleIPartAParticipantDescriptor : DescriptorAggregate.EdFi.Descrip // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TitleIPartAParticipantDescriptorId { get { return base.DescriptorId; } @@ -164338,6 +191671,7 @@ namespace EdFi.Ods.Entities.NHibernate.TitleIPartAProgramServiceDescriptorAggreg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TitleIPartAProgramServiceDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITitleIPartAProgramServiceDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -164346,6 +191680,7 @@ public class TitleIPartAProgramServiceDescriptor : DescriptorAggregate.EdFi.Desc // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TitleIPartAProgramServiceDescriptorId { get { return base.DescriptorId; } @@ -164517,6 +191852,7 @@ namespace EdFi.Ods.Entities.NHibernate.TitleIPartASchoolDesignationDescriptorAgg /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TitleIPartASchoolDesignationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITitleIPartASchoolDesignationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -164525,6 +191861,7 @@ public class TitleIPartASchoolDesignationDescriptor : DescriptorAggregate.EdFi.D // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TitleIPartASchoolDesignationDescriptorId { get { return base.DescriptorId; } @@ -164696,6 +192033,7 @@ namespace EdFi.Ods.Entities.NHibernate.TransportationPublicExpenseEligibilityTyp /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TransportationPublicExpenseEligibilityTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITransportationPublicExpenseEligibilityTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -164704,6 +192042,7 @@ public class TransportationPublicExpenseEligibilityTypeDescriptor : DescriptorAg // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TransportationPublicExpenseEligibilityTypeDescriptorId { get { return base.DescriptorId; } @@ -164875,6 +192214,7 @@ namespace EdFi.Ods.Entities.NHibernate.TransportationTypeDescriptorAggregate.EdF /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TransportationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITransportationTypeDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -164883,6 +192223,7 @@ public class TransportationTypeDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TransportationTypeDescriptorId { get { return base.DescriptorId; } @@ -165054,6 +192395,7 @@ namespace EdFi.Ods.Entities.NHibernate.TravelDayofWeekDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TravelDayofWeekDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITravelDayofWeekDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -165062,6 +192404,7 @@ public class TravelDayofWeekDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TravelDayofWeekDescriptorId { get { return base.DescriptorId; } @@ -165233,6 +192576,7 @@ namespace EdFi.Ods.Entities.NHibernate.TravelDirectionDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TravelDirectionDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITravelDirectionDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -165241,6 +192585,7 @@ public class TravelDirectionDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TravelDirectionDescriptorId { get { return base.DescriptorId; } @@ -165412,6 +192757,7 @@ namespace EdFi.Ods.Entities.NHibernate.TribalAffiliationDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class TribalAffiliationDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.ITribalAffiliationDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -165420,6 +192766,7 @@ public class TribalAffiliationDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int TribalAffiliationDescriptorId { get { return base.DescriptorId; } @@ -165591,6 +192938,7 @@ namespace EdFi.Ods.Entities.NHibernate.VisaDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class VisaDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IVisaDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -165599,6 +192947,7 @@ public class VisaDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int VisaDescriptorId { get { return base.DescriptorId; } @@ -165770,6 +193119,7 @@ namespace EdFi.Ods.Entities.NHibernate.WeaponDescriptorAggregate.EdFi /// [Schema("edfi")] [ExcludeFromCodeCoverage] + [MessagePackObject] public class WeaponDescriptor : DescriptorAggregate.EdFi.Descriptor, Entities.Common.EdFi.IWeaponDescriptor, IHasPrimaryKeyValues, IHasLookupColumnPropertyMap, IEdFiDescriptor { @@ -165778,6 +193128,7 @@ public class WeaponDescriptor : DescriptorAggregate.EdFi.Descriptor, // Primary Key // ------------------------------------------------------------- [DomainSignature] + [IgnoreMember] public virtual int WeaponDescriptorId { get { return base.DescriptorId; }