From eccdfe70ae40307760939257d14bdca21c141187 Mon Sep 17 00:00:00 2001 From: "Alten, Arthur van" Date: Fri, 26 Apr 2024 16:43:30 +0200 Subject: [PATCH 1/6] Changed Consumers and Attributes for Offering according to EducationSpecifications and Programs --- .../Models/OfferingTests.cs | 16 +- ...rAndAttributeColumnForOffering.Designer.cs | 2812 +++++++++++++++++ ...edConsumerAndAttributeColumnForOffering.cs | 351 ++ .../Migrations/CoreDBContextModelSnapshot.cs | 276 +- v5/ooapi.v5.core/Models/Offering.cs | 18 +- .../Repositories/CoreDBContext.cs | 15 +- v5/ooapi.v5.core/ooapi.v5.core.csproj | 3 + 7 files changed, 3399 insertions(+), 92 deletions(-) create mode 100644 v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.Designer.cs create mode 100644 v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.cs diff --git a/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs b/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs index 7549568..fdc3081 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs @@ -126,7 +126,7 @@ public void GetName_WhenAttributesExist_ReturnsListLanguageTypedString() { // Arrange var offering = _fixture.Build() - .With(x => x.Attributes, new List() { new() { PropertyName = "name", Language = "en", Value = "TestName" } }) + .With(x => x.Attributes, new List() { new() { PropertyName = "name", Language = "en", Value = "TestName" } }) .OmitAutoProperties() .Create(); @@ -141,12 +141,13 @@ public void GetName_WhenAttributesExist_ReturnsListLanguageTypedString() result[0].Value.Should().Be("TestName"); } + [Test] public void GetName_WhenAttributesAreEmpty_ReturnsEmptyListLanguageTypedString() { // Arrange var offering = _fixture.Build() - .With(x => x.Attributes, new List() { }) + .With(x => x.Attributes, new List() { }) .OmitAutoProperties() .Create(); @@ -158,13 +159,14 @@ public void GetName_WhenAttributesAreEmpty_ReturnsEmptyListLanguageTypedString() result.Should().BeOfType>(); result.Should().HaveCount(0); } - + + [Test] public void GetDescription_WhenAttributesExist_ReturnsListLanguageTypedString() { // Arrange var offering = _fixture.Build() - .With(x => x.Attributes, new List() { new() { PropertyName = "description", Language = "en", Value = "TestName" } }) + .With(x => x.Attributes, new List() { new() { PropertyName = "description", Language = "en", Value = "TestName" } }) .OmitAutoProperties() .Create(); @@ -179,12 +181,13 @@ public void GetDescription_WhenAttributesExist_ReturnsListLanguageTypedString() result[0].Value.Should().Be("TestName"); } + [Test] public void GetDescription_WhenAttributesAreEmpty_ReturnsEmptyListLanguageTypedString() { // Arrange var offering = _fixture.Build() - .With(x => x.Attributes, new List() { }) + .With(x => x.Attributes, new List() { }) .OmitAutoProperties() .Create(); @@ -196,7 +199,8 @@ public void GetDescription_WhenAttributesAreEmpty_ReturnsEmptyListLanguageTypedS result.Should().BeOfType>(); result.Should().HaveCount(0); } - + + [TestCase("distance-learning", Enums.ModeOfDelivery.distance_learning)] [TestCase("on campus", Enums.ModeOfDelivery.on_campus)] [TestCase("online", Enums.ModeOfDelivery.online)] diff --git a/v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.Designer.cs b/v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.Designer.cs new file mode 100644 index 0000000..f51f289 --- /dev/null +++ b/v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.Designer.cs @@ -0,0 +1,2812 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using ooapi.v5.core.Repositories; + +#nullable disable + +namespace ooapi.v5.core.Migrations +{ + [DbContext(typeof(CoreDBContext))] + [Migration("20240426143718_AddedConsumerAndAttributeColumnForOffering")] + partial class AddedConsumerAndAttributeColumnForOffering + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("ooapiv5") + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("AddressComponent", b => + { + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("ComponentsComponentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AddressId", "ComponentsComponentId"); + + b.HasIndex("ComponentsComponentId"); + + b.ToTable("AddressComponent", "ooapiv5"); + }); + + modelBuilder.Entity("AddressComponentOffering", b => + { + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("ComponentOfferingsOfferingId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AddressId", "ComponentOfferingsOfferingId"); + + b.HasIndex("ComponentOfferingsOfferingId"); + + b.ToTable("AddressComponentOffering", "ooapiv5"); + }); + + modelBuilder.Entity("AddressCourse", b => + { + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("CoursesCourseId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AddressId", "CoursesCourseId"); + + b.HasIndex("CoursesCourseId"); + + b.ToTable("AddressCourse", "ooapiv5"); + }); + + modelBuilder.Entity("AddressCourseOffering", b => + { + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseOfferingsOfferingId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AddressId", "CourseOfferingsOfferingId"); + + b.HasIndex("CourseOfferingsOfferingId"); + + b.ToTable("AddressCourseOffering", "ooapiv5"); + }); + + modelBuilder.Entity("AddressOrganization", b => + { + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrganizationsOrganizationId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AddressId", "OrganizationsOrganizationId"); + + b.HasIndex("OrganizationsOrganizationId"); + + b.ToTable("AddressOrganization", "ooapiv5"); + }); + + modelBuilder.Entity("AddressProgram", b => + { + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProgramsProgramId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AddressId", "ProgramsProgramId"); + + b.HasIndex("ProgramsProgramId"); + + b.ToTable("AddressProgram", "ooapiv5"); + }); + + modelBuilder.Entity("AddressProgramOffering", b => + { + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProgramOfferingsOfferingId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AddressId", "ProgramOfferingsOfferingId"); + + b.HasIndex("ProgramOfferingsOfferingId"); + + b.ToTable("AddressProgramOffering", "ooapiv5"); + }); + + modelBuilder.Entity("ComponentOfferingCost", b => + { + b.Property("ComponentOfferingsOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("CostsCostId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("ComponentOfferingsOfferingId", "CostsCostId"); + + b.HasIndex("CostsCostId"); + + b.ToTable("ComponentOfferingCost", "ooapiv5"); + }); + + modelBuilder.Entity("CostCourseOffering", b => + { + b.Property("CostsCostId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseOfferingsOfferingId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("CostsCostId", "CourseOfferingsOfferingId"); + + b.HasIndex("CourseOfferingsOfferingId"); + + b.ToTable("CostCourseOffering", "ooapiv5"); + }); + + modelBuilder.Entity("CostProgramOffering", b => + { + b.Property("CostsCostId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProgramOfferingsOfferingId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("CostsCostId", "ProgramOfferingsOfferingId"); + + b.HasIndex("ProgramOfferingsOfferingId"); + + b.ToTable("CostProgramOffering", "ooapiv5"); + }); + + modelBuilder.Entity("GroupPerson", b => + { + b.Property("GroupsGroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonsPersonId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("GroupsGroupId", "PersonsPersonId"); + + b.HasIndex("PersonsPersonId"); + + b.ToTable("GroupPerson", "ooapiv5"); + }); + + modelBuilder.Entity("NewsFeedNewsItem", b => + { + b.Property("NewsFeedsNewsFeedId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewsItemsNewsItemId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("NewsFeedsNewsFeedId", "NewsItemsNewsItemId"); + + b.HasIndex("NewsItemsNewsItemId"); + + b.ToTable("NewsFeedNewsItem", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.AcademicSession", b => + { + b.Property("AcademicSessionId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicSessionType") + .HasColumnType("int"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("YearId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("AcademicSessionId"); + + b.ToTable("AcademicSessions", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Address", b => + { + b.Property("AddressId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AddressType") + .HasColumnType("int"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("CountryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Latitude") + .HasPrecision(8, 6) + .HasColumnType("decimal(8, 6)"); + + b.Property("Longitude") + .HasPrecision(8, 6) + .HasColumnType("decimal(8, 6)"); + + b.Property("PostalCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Street") + .HasColumnType("nvarchar(max)"); + + b.Property("StreetNumber") + .HasColumnType("nvarchar(max)"); + + b.HasKey("AddressId"); + + b.ToTable("Addresses", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Association", b => + { + b.Property("AssociationId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssociationType") + .HasColumnType("int"); + + b.Property("ComponentOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("ComponentResultResultId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseResultResultId") + .HasColumnType("uniqueidentifier"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("OfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProgramOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProgramResultResultId") + .HasColumnType("uniqueidentifier"); + + b.Property("RemoteState") + .HasColumnType("int"); + + b.Property("ResultId") + .HasColumnType("uniqueidentifier"); + + b.Property("Role") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("int"); + + b.HasKey("AssociationId"); + + b.HasIndex("ComponentOfferingOfferingId"); + + b.HasIndex("ComponentResultResultId"); + + b.HasIndex("CourseOfferingOfferingId"); + + b.HasIndex("CourseResultResultId"); + + b.HasIndex("PersonId"); + + b.HasIndex("ProgramOfferingOfferingId"); + + b.HasIndex("ProgramResultResultId"); + + b.ToTable("Associations", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Attribute", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ModelTypeName") + .HasColumnType("nvarchar(450)"); + + b.Property("PropertyName") + .HasColumnType("nvarchar(450)"); + + b.Property("Language") + .HasColumnType("nvarchar(450)"); + + b.Property("AcademicSessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("BuildingId") + .HasColumnType("uniqueidentifier"); + + b.Property("ComponentId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewsFeedId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewsItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id", "ModelTypeName", "PropertyName", "Language"); + + b.HasIndex("AcademicSessionId"); + + b.HasIndex("BuildingId"); + + b.HasIndex("ComponentId"); + + b.HasIndex("CourseId"); + + b.HasIndex("GroupId"); + + b.HasIndex("NewsFeedId"); + + b.HasIndex("NewsItemId"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Attributes", "ooapiv5"); + + b.HasDiscriminator().HasValue("Attribute"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Building", b => + { + b.Property("BuildingId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.HasKey("BuildingId"); + + b.HasIndex("AddressId"); + + b.ToTable("Buildings", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Component", b => + { + b.Property("ComponentId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ComponentType") + .HasColumnType("int"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("Duration") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("ModeOfDelivery") + .HasColumnType("nvarchar(max)"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TeachingLanguage") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.HasKey("ComponentId"); + + b.HasIndex("CourseId"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Components", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ComponentOffering", b => + { + b.Property("OfferingId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("AcademicSessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("ComponentId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("EnrollEndDate") + .HasColumnType("datetime2"); + + b.Property("EnrollStartDate") + .HasColumnType("datetime2"); + + b.Property("EnrolledNumberStudents") + .HasColumnType("int"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("MaxNumberStudents") + .HasColumnType("int"); + + b.Property("MinNumberStudents") + .HasColumnType("int"); + + b.Property("ModeOfDelivery") + .HasColumnType("nvarchar(max)"); + + b.Property("OfferingType") + .HasColumnType("int"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingNumberStudents") + .HasColumnType("int"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ResultExpected") + .HasColumnType("bit"); + + b.Property("ResultValueType") + .HasColumnType("int"); + + b.Property("ResultWeight") + .HasColumnType("int"); + + b.Property("RoomId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("TeachingLanguage") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.HasKey("OfferingId"); + + b.HasIndex("AcademicSessionId"); + + b.HasIndex("ComponentId"); + + b.HasIndex("CourseId"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("RoomId"); + + b.ToTable("ComponentOfferings", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ComponentResult", b => + { + b.Property("ResultId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Comment") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Pass") + .HasColumnType("int"); + + b.Property("ResultDate") + .HasColumnType("datetime2"); + + b.Property("Score") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Weight") + .HasColumnType("int"); + + b.HasKey("ResultId"); + + b.ToTable("ComponentResults", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Consumer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConsumerKey") + .HasColumnType("nvarchar(450)"); + + b.Property("PropertyName") + .HasColumnType("nvarchar(450)"); + + b.Property("AcademicSessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("AssociationId") + .HasColumnType("uniqueidentifier"); + + b.Property("BuildingId") + .HasColumnType("uniqueidentifier"); + + b.Property("ComponentId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewsFeedId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewsItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("PropertyType") + .HasColumnType("int"); + + b.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RoomId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id", "ConsumerKey", "PropertyName"); + + b.HasIndex("AcademicSessionId"); + + b.HasIndex("AssociationId"); + + b.HasIndex("BuildingId"); + + b.HasIndex("ComponentId"); + + b.HasIndex("CourseId"); + + b.HasIndex("GroupId"); + + b.HasIndex("NewsFeedId"); + + b.HasIndex("NewsItemId"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PersonId"); + + b.HasIndex("RoomId"); + + b.ToTable("Consumers", "ooapiv5"); + + b.HasDiscriminator().HasValue("Consumer"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ConsumerRegistration", b => + { + b.Property("ConsumerKey") + .HasColumnType("nvarchar(450)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("ConsumerKey"); + + b.HasIndex("ServiceId"); + + b.ToTable("ConsumerRegistrations", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Cost", b => + { + b.Property("CostId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AmountWithoutVat") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CostType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Currency") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayAmount") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("VatAmount") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("CostId"); + + b.ToTable("Costs", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Course", b => + { + b.Property("CourseId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Duration") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("EducationSpecificationId") + .HasColumnType("uniqueidentifier"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("FieldsOfStudy") + .IsRequired() + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.Property("FirstStartDate") + .HasColumnType("datetime2"); + + b.Property("LearningOutcomes") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("ModeOfDelivery") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("Resources") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("StudyLoadUnit") + .HasColumnType("nvarchar(max)"); + + b.Property("StudyLoadValue") + .HasColumnType("int"); + + b.Property("TeachingLanguage") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("ValidFrom") + .HasColumnType("datetime2"); + + b.Property("ValidTo") + .HasColumnType("datetime2"); + + b.HasKey("CourseId"); + + b.HasIndex("EducationSpecificationId"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Courses", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.CourseOffering", b => + { + b.Property("OfferingId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("AcademicSessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("EnrollEndDate") + .HasColumnType("datetime2"); + + b.Property("EnrollStartDate") + .HasColumnType("datetime2"); + + b.Property("EnrolledNumberStudents") + .HasColumnType("int"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("FlexibleEntryPeriodEnd") + .HasColumnType("datetime2"); + + b.Property("FlexibleEntryPeriodStart") + .HasColumnType("datetime2"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("MaxNumberStudents") + .HasColumnType("int"); + + b.Property("MinNumberStudents") + .HasColumnType("int"); + + b.Property("ModeOfDelivery") + .HasColumnType("nvarchar(max)"); + + b.Property("OfferingType") + .HasColumnType("int"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingNumberStudents") + .HasColumnType("int"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ProgramOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultExpected") + .HasColumnType("bit"); + + b.Property("ResultValueType") + .HasColumnType("int"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("TeachingLanguage") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.HasKey("OfferingId"); + + b.HasIndex("AcademicSessionId"); + + b.HasIndex("CourseId"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ProgramOfferingId"); + + b.ToTable("CourseOfferings", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.CourseResult", b => + { + b.Property("ResultId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Comment") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Pass") + .HasColumnType("int"); + + b.Property("ResultDate") + .HasColumnType("datetime2"); + + b.Property("Score") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("StudyLoadUnit") + .HasColumnType("nvarchar(max)"); + + b.Property("StudyLoadValue") + .HasColumnType("int"); + + b.HasKey("ResultId"); + + b.ToTable("CourseResults", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.EducationSpecification", b => + { + b.Property("EducationSpecificationId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EducationSpecificationType") + .HasColumnType("int"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("FieldsOfStudy") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.Property("FormalDocument") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("LevelOfQualification") + .HasColumnType("int"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("Sector") + .HasColumnType("int"); + + b.Property("StudyLoadUnit") + .HasColumnType("nvarchar(max)"); + + b.Property("StudyLoadValue") + .HasColumnType("int"); + + b.Property("ValidFrom") + .HasColumnType("datetime2"); + + b.Property("ValidTo") + .HasColumnType("datetime2"); + + b.HasKey("EducationSpecificationId"); + + b.HasIndex("OrganizationId"); + + b.ToTable("EducationSpecifications", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Group", b => + { + b.Property("GroupId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("GroupType") + .HasColumnType("int"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.HasKey("GroupId"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Groups", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.LanguageOfChoice", b => + { + b.Property("LanguageOfChoiceId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("LanguageOfChoiceId"); + + b.HasIndex("PersonId"); + + b.ToTable("LanguageOfChoices", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.NewsFeed", b => + { + b.Property("NewsFeedId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("NewsFeedType") + .HasColumnType("int"); + + b.HasKey("NewsFeedId"); + + b.ToTable("NewsFeeds", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.NewsItem", b => + { + b.Property("NewsItemId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Authors") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Image") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("NewsItemType") + .HasColumnType("int"); + + b.Property("ValidFrom") + .HasColumnType("datetime2"); + + b.Property("ValidUntil") + .HasColumnType("datetime2"); + + b.HasKey("NewsItemId"); + + b.ToTable("NewsItems", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Organization", b => + { + b.Property("OrganizationId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Logo") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("OrganizationType") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("OrganizationId"); + + b.ToTable("Organizations", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.OtherCodes", b => + { + b.Property("OtherCodesId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicSessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("BuildingId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CodeType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ComponentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ComponentOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("CourseOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("EducationSpecificationId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProgramId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProgramOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoomId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OtherCodesId"); + + b.HasIndex("AcademicSessionId"); + + b.HasIndex("BuildingId"); + + b.HasIndex("ComponentId"); + + b.HasIndex("ComponentOfferingOfferingId"); + + b.HasIndex("CourseId"); + + b.HasIndex("CourseOfferingOfferingId"); + + b.HasIndex("EducationSpecificationId"); + + b.HasIndex("GroupId"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PersonId"); + + b.HasIndex("ProgramId"); + + b.HasIndex("ProgramOfferingOfferingId"); + + b.HasIndex("RoomId"); + + b.ToTable("OtherCodes", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Person", b => + { + b.Property("PersonId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveEnrollment") + .HasColumnType("bit"); + + b.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b.Property("Affiliations") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CityOfBirth") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CountryOfBirth") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("DateOfNationality") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Gender") + .HasColumnType("int"); + + b.Property("GivenName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ICEName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ICEPhoneNumber") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ICERelation") + .HasColumnType("int"); + + b.Property("Initials") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Mail") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("MobileNumber") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Nationality") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Office") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PhotoOfficial") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("PhotoSocial") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ProgramId") + .HasColumnType("uniqueidentifier"); + + b.Property("SecondaryMail") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("SurnamePrefix") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TelephoneNumber") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TitlePrefix") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TitleSuffix") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("PersonId"); + + b.HasIndex("AddressId"); + + b.HasIndex("CourseId"); + + b.HasIndex("ProgramId"); + + b.ToTable("Persons", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Program", b => + { + b.Property("ProgramId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("CourseId") + .HasColumnType("uniqueidentifier"); + + b.Property("Duration") + .HasColumnType("nvarchar(max)"); + + b.Property("EducationSpecificationId") + .HasColumnType("uniqueidentifier"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("FieldsOfStudy") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.Property("FirstStartDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("LevelOfQualification") + .HasColumnType("int"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("ModeOfDelivery") + .HasColumnType("nvarchar(max)"); + + b.Property("ModeOfStudy") + .HasColumnType("int"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PrimaryCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ProgramType") + .HasColumnType("int"); + + b.Property("QualificationAwarded") + .HasColumnType("int"); + + b.Property("Sector") + .HasColumnType("int"); + + b.Property("StudyLoadUnit") + .HasColumnType("nvarchar(max)"); + + b.Property("StudyLoadValue") + .HasColumnType("int"); + + b.Property("TeachingLanguage") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("ValidFrom") + .HasColumnType("datetime2"); + + b.Property("ValidTo") + .HasColumnType("datetime2"); + + b.HasKey("ProgramId"); + + b.HasIndex("CourseId"); + + b.HasIndex("EducationSpecificationId"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Programs", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ProgramOffering", b => + { + b.Property("OfferingId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("AcademicSessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("EnrollEndDate") + .HasColumnType("datetime2"); + + b.Property("EnrollStartDate") + .HasColumnType("datetime2"); + + b.Property("EnrolledNumberStudents") + .HasColumnType("int"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("FlexibleEntryPeriodEnd") + .HasColumnType("datetime2"); + + b.Property("FlexibleEntryPeriodStart") + .HasColumnType("datetime2"); + + b.Property("Link") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("MaxNumberStudents") + .HasColumnType("int"); + + b.Property("MinNumberStudents") + .HasColumnType("int"); + + b.Property("ModeOfDelivery") + .HasColumnType("nvarchar(max)"); + + b.Property("OfferingType") + .HasColumnType("int"); + + b.Property("OrganizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingNumberStudents") + .HasColumnType("int"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ProgramId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultExpected") + .HasColumnType("bit"); + + b.Property("ResultValueType") + .HasColumnType("int"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("TeachingLanguage") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.HasKey("OfferingId"); + + b.HasIndex("AcademicSessionId"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ProgramId"); + + b.ToTable("ProgramOfferings", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ProgramResult", b => + { + b.Property("ResultId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Comment") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Pass") + .HasColumnType("int"); + + b.Property("ResultDate") + .HasColumnType("datetime2"); + + b.Property("Score") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("StudyLoadUnit") + .HasColumnType("nvarchar(max)"); + + b.Property("StudyLoadValue") + .HasColumnType("int"); + + b.HasKey("ResultId"); + + b.ToTable("ProgramResults", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Room", b => + { + b.Property("RoomId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("AvailableSeats") + .HasColumnType("int"); + + b.Property("BuildingId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Floor") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Latitude") + .HasPrecision(8, 6) + .HasColumnType("decimal(8, 6)"); + + b.Property("Longitude") + .HasPrecision(8, 6) + .HasColumnType("decimal(8, 6)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PrimaryCodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("RoomType") + .HasColumnType("int"); + + b.Property("TotalSeats") + .HasColumnType("int"); + + b.Property("Wing") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("RoomId"); + + b.HasIndex("BuildingId"); + + b.ToTable("Rooms", "ooapiv5"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Service", b => + { + b.Property("ServiceId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ContactEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Documentation") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Extension") + .HasColumnType("nvarchar(max)"); + + b.Property("Specification") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("ServiceId"); + + b.ToTable("Services", "ooapiv5"); + }); + + modelBuilder.Entity("AddressComponent", b => + { + b.HasOne("ooapi.v5.Models.Address", null) + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.Component", null) + .WithMany() + .HasForeignKey("ComponentsComponentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AddressComponentOffering", b => + { + b.HasOne("ooapi.v5.Models.Address", null) + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.ComponentOffering", null) + .WithMany() + .HasForeignKey("ComponentOfferingsOfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AddressCourse", b => + { + b.HasOne("ooapi.v5.Models.Address", null) + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.Course", null) + .WithMany() + .HasForeignKey("CoursesCourseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AddressCourseOffering", b => + { + b.HasOne("ooapi.v5.Models.Address", null) + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.CourseOffering", null) + .WithMany() + .HasForeignKey("CourseOfferingsOfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AddressOrganization", b => + { + b.HasOne("ooapi.v5.Models.Address", null) + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.Organization", null) + .WithMany() + .HasForeignKey("OrganizationsOrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AddressProgram", b => + { + b.HasOne("ooapi.v5.Models.Address", null) + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.Program", null) + .WithMany() + .HasForeignKey("ProgramsProgramId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AddressProgramOffering", b => + { + b.HasOne("ooapi.v5.Models.Address", null) + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.ProgramOffering", null) + .WithMany() + .HasForeignKey("ProgramOfferingsOfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ComponentOfferingCost", b => + { + b.HasOne("ooapi.v5.Models.ComponentOffering", null) + .WithMany() + .HasForeignKey("ComponentOfferingsOfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.Cost", null) + .WithMany() + .HasForeignKey("CostsCostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("CostCourseOffering", b => + { + b.HasOne("ooapi.v5.Models.Cost", null) + .WithMany() + .HasForeignKey("CostsCostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.CourseOffering", null) + .WithMany() + .HasForeignKey("CourseOfferingsOfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("CostProgramOffering", b => + { + b.HasOne("ooapi.v5.Models.Cost", null) + .WithMany() + .HasForeignKey("CostsCostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.ProgramOffering", null) + .WithMany() + .HasForeignKey("ProgramOfferingsOfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GroupPerson", b => + { + b.HasOne("ooapi.v5.Models.Group", null) + .WithMany() + .HasForeignKey("GroupsGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.Person", null) + .WithMany() + .HasForeignKey("PersonsPersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("NewsFeedNewsItem", b => + { + b.HasOne("ooapi.v5.Models.NewsFeed", null) + .WithMany() + .HasForeignKey("NewsFeedsNewsFeedId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.NewsItem", null) + .WithMany() + .HasForeignKey("NewsItemsNewsItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ooapi.v5.Models.Address", b => + { + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("AddressId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("AddressId", "Id"); + + b1.ToTable("Addresses", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("AddressId"); + }); + + b.Navigation("Attributes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Association", b => + { + b.HasOne("ooapi.v5.Models.ComponentOffering", "ComponentOffering") + .WithMany() + .HasForeignKey("ComponentOfferingOfferingId"); + + b.HasOne("ooapi.v5.Models.ComponentResult", "ComponentResult") + .WithMany() + .HasForeignKey("ComponentResultResultId"); + + b.HasOne("ooapi.v5.Models.CourseOffering", "CourseOffering") + .WithMany() + .HasForeignKey("CourseOfferingOfferingId"); + + b.HasOne("ooapi.v5.Models.CourseResult", "CourseResult") + .WithMany() + .HasForeignKey("CourseResultResultId"); + + b.HasOne("ooapi.v5.Models.Person", "Person") + .WithMany() + .HasForeignKey("PersonId"); + + b.HasOne("ooapi.v5.Models.ProgramOffering", "ProgramOffering") + .WithMany() + .HasForeignKey("ProgramOfferingOfferingId"); + + b.HasOne("ooapi.v5.Models.ProgramResult", "ProgramResult") + .WithMany() + .HasForeignKey("ProgramResultResultId"); + + b.Navigation("ComponentOffering"); + + b.Navigation("ComponentResult"); + + b.Navigation("CourseOffering"); + + b.Navigation("CourseResult"); + + b.Navigation("Person"); + + b.Navigation("ProgramOffering"); + + b.Navigation("ProgramResult"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Attribute", b => + { + b.HasOne("ooapi.v5.Models.AcademicSession", null) + .WithMany("Attributes") + .HasForeignKey("AcademicSessionId"); + + b.HasOne("ooapi.v5.Models.Building", null) + .WithMany("Attributes") + .HasForeignKey("BuildingId"); + + b.HasOne("ooapi.v5.Models.Component", null) + .WithMany("Attributes") + .HasForeignKey("ComponentId"); + + b.HasOne("ooapi.v5.Models.Course", null) + .WithMany("Attributes") + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.Group", null) + .WithMany("Attributes") + .HasForeignKey("GroupId"); + + b.HasOne("ooapi.v5.Models.NewsFeed", null) + .WithMany("Attributes") + .HasForeignKey("NewsFeedId"); + + b.HasOne("ooapi.v5.Models.NewsItem", null) + .WithMany("Attributes") + .HasForeignKey("NewsItemId"); + + b.HasOne("ooapi.v5.Models.Organization", null) + .WithMany("Attributes") + .HasForeignKey("OrganizationId"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Building", b => + { + b.HasOne("ooapi.v5.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.Navigation("Address"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Component", b => + { + b.HasOne("ooapi.v5.Models.Course", "Course") + .WithMany() + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.Navigation("Course"); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ComponentOffering", b => + { + b.HasOne("ooapi.v5.Models.AcademicSession", "AcademicSession") + .WithMany("ComponentOfferings") + .HasForeignKey("AcademicSessionId"); + + b.HasOne("ooapi.v5.Models.Component", "Component") + .WithMany() + .HasForeignKey("ComponentId"); + + b.HasOne("ooapi.v5.Models.Course", "Course") + .WithMany() + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("ooapi.v5.Models.Room", "Room") + .WithMany() + .HasForeignKey("RoomId"); + + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("ComponentOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ComponentOfferingOfferingId", "Id"); + + b1.ToTable("ComponentOfferings", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("ComponentOfferingOfferingId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("ComponentOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ComponentOfferingOfferingId", "Id"); + + b1.ToTable("ComponentOfferings", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("ComponentOfferingOfferingId"); + }); + + b.Navigation("AcademicSession"); + + b.Navigation("Attributes"); + + b.Navigation("Component"); + + b.Navigation("Consumers"); + + b.Navigation("Course"); + + b.Navigation("Organization"); + + b.Navigation("Room"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Consumer", b => + { + b.HasOne("ooapi.v5.Models.AcademicSession", null) + .WithMany("Consumers") + .HasForeignKey("AcademicSessionId"); + + b.HasOne("ooapi.v5.Models.Association", null) + .WithMany("Consumers") + .HasForeignKey("AssociationId"); + + b.HasOne("ooapi.v5.Models.Building", null) + .WithMany("Consumers") + .HasForeignKey("BuildingId"); + + b.HasOne("ooapi.v5.Models.Component", null) + .WithMany("Consumers") + .HasForeignKey("ComponentId"); + + b.HasOne("ooapi.v5.Models.Course", null) + .WithMany("Consumers") + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.Group", null) + .WithMany("Consumers") + .HasForeignKey("GroupId"); + + b.HasOne("ooapi.v5.Models.NewsFeed", null) + .WithMany("Consumers") + .HasForeignKey("NewsFeedId"); + + b.HasOne("ooapi.v5.Models.NewsItem", null) + .WithMany("Consumers") + .HasForeignKey("NewsItemId"); + + b.HasOne("ooapi.v5.Models.Organization", null) + .WithMany("Consumers") + .HasForeignKey("OrganizationId"); + + b.HasOne("ooapi.v5.Models.Person", null) + .WithMany("Consumers") + .HasForeignKey("PersonId"); + + b.HasOne("ooapi.v5.Models.Room", null) + .WithMany("Consumers") + .HasForeignKey("RoomId"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ConsumerRegistration", b => + { + b.HasOne("ooapi.v5.Models.Service", null) + .WithMany("Consumers") + .HasForeignKey("ServiceId"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Course", b => + { + b.HasOne("ooapi.v5.Models.EducationSpecification", "EducationSpecification") + .WithMany() + .HasForeignKey("EducationSpecificationId"); + + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.Navigation("EducationSpecification"); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("ooapi.v5.Models.CourseOffering", b => + { + b.HasOne("ooapi.v5.Models.AcademicSession", "AcademicSession") + .WithMany("CourseOfferings") + .HasForeignKey("AcademicSessionId"); + + b.HasOne("ooapi.v5.Models.Course", "Course") + .WithMany() + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("ooapi.v5.Models.ProgramOffering", "ProgramOffering") + .WithMany() + .HasForeignKey("ProgramOfferingId"); + + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("CourseOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("CourseOfferingOfferingId", "Id"); + + b1.ToTable("CourseOfferings", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("CourseOfferingOfferingId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("CourseOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("CourseOfferingOfferingId", "Id"); + + b1.ToTable("CourseOfferings", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("CourseOfferingOfferingId"); + }); + + b.Navigation("AcademicSession"); + + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("Course"); + + b.Navigation("Organization"); + + b.Navigation("ProgramOffering"); + }); + + modelBuilder.Entity("ooapi.v5.Models.EducationSpecification", b => + { + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("EducationSpecificationId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("EducationSpecificationId", "Id"); + + b1.ToTable("EducationSpecifications", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("EducationSpecificationId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("EducationSpecificationId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("EducationSpecificationId", "Id"); + + b1.ToTable("EducationSpecifications", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("EducationSpecificationId"); + }); + + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Group", b => + { + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("ooapi.v5.Models.LanguageOfChoice", b => + { + b.HasOne("ooapi.v5.Models.Person", null) + .WithMany("LanguageOfChoice") + .HasForeignKey("PersonId"); + }); + + modelBuilder.Entity("ooapi.v5.Models.OtherCodes", b => + { + b.HasOne("ooapi.v5.Models.AcademicSession", null) + .WithMany("OtherCodes") + .HasForeignKey("AcademicSessionId"); + + b.HasOne("ooapi.v5.Models.Building", null) + .WithMany("OtherCodes") + .HasForeignKey("BuildingId"); + + b.HasOne("ooapi.v5.Models.Component", null) + .WithMany("OtherCodes") + .HasForeignKey("ComponentId"); + + b.HasOne("ooapi.v5.Models.ComponentOffering", null) + .WithMany("OtherCodes") + .HasForeignKey("ComponentOfferingOfferingId"); + + b.HasOne("ooapi.v5.Models.Course", null) + .WithMany("OtherCodes") + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.CourseOffering", null) + .WithMany("OtherCodes") + .HasForeignKey("CourseOfferingOfferingId"); + + b.HasOne("ooapi.v5.Models.EducationSpecification", null) + .WithMany("OtherCodes") + .HasForeignKey("EducationSpecificationId"); + + b.HasOne("ooapi.v5.Models.Group", null) + .WithMany("OtherCodes") + .HasForeignKey("GroupId"); + + b.HasOne("ooapi.v5.Models.Organization", null) + .WithMany("OtherCodes") + .HasForeignKey("OrganizationId"); + + b.HasOne("ooapi.v5.Models.Person", null) + .WithMany("OtherCodes") + .HasForeignKey("PersonId"); + + b.HasOne("ooapi.v5.Models.Program", null) + .WithMany("OtherCodes") + .HasForeignKey("ProgramId"); + + b.HasOne("ooapi.v5.Models.ProgramOffering", null) + .WithMany("OtherCodes") + .HasForeignKey("ProgramOfferingOfferingId"); + + b.HasOne("ooapi.v5.Models.Room", null) + .WithMany("OtherCodes") + .HasForeignKey("RoomId"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Person", b => + { + b.HasOne("ooapi.v5.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ooapi.v5.Models.Course", null) + .WithMany("CoordinatorsRef") + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.Program", null) + .WithMany("CoordinatorsRef") + .HasForeignKey("ProgramId"); + + b.Navigation("Address"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Program", b => + { + b.HasOne("ooapi.v5.Models.Course", null) + .WithMany("ProgramsRef") + .HasForeignKey("CourseId"); + + b.HasOne("ooapi.v5.Models.EducationSpecification", "EducationSpecification") + .WithMany() + .HasForeignKey("EducationSpecificationId"); + + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("ProgramId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ProgramId", "Id"); + + b1.ToTable("Programs", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("ProgramId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("ProgramId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ProgramId", "Id"); + + b1.ToTable("Programs", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("ProgramId"); + }); + + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("EducationSpecification"); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ProgramOffering", b => + { + b.HasOne("ooapi.v5.Models.AcademicSession", "AcademicSession") + .WithMany("ProgramOfferings") + .HasForeignKey("AcademicSessionId"); + + b.HasOne("ooapi.v5.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("ooapi.v5.Models.Program", "Program") + .WithMany() + .HasForeignKey("ProgramId"); + + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("ProgramOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ProgramOfferingOfferingId", "Id"); + + b1.ToTable("ProgramOfferings", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("ProgramOfferingOfferingId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("ProgramOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ProgramOfferingOfferingId", "Id"); + + b1.ToTable("ProgramOfferings", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("ProgramOfferingOfferingId"); + }); + + b.Navigation("AcademicSession"); + + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("Organization"); + + b.Navigation("Program"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Room", b => + { + b.HasOne("ooapi.v5.Models.Building", "Building") + .WithMany() + .HasForeignKey("BuildingId"); + + b.Navigation("Building"); + }); + + modelBuilder.Entity("ooapi.v5.Models.AcademicSession", b => + { + b.Navigation("Attributes"); + + b.Navigation("ComponentOfferings"); + + b.Navigation("Consumers"); + + b.Navigation("CourseOfferings"); + + b.Navigation("OtherCodes"); + + b.Navigation("ProgramOfferings"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Association", b => + { + b.Navigation("Consumers"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Building", b => + { + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Component", b => + { + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ComponentOffering", b => + { + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Course", b => + { + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("CoordinatorsRef"); + + b.Navigation("OtherCodes"); + + b.Navigation("ProgramsRef"); + }); + + modelBuilder.Entity("ooapi.v5.Models.CourseOffering", b => + { + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.EducationSpecification", b => + { + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Group", b => + { + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.NewsFeed", b => + { + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + }); + + modelBuilder.Entity("ooapi.v5.Models.NewsItem", b => + { + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Organization", b => + { + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Person", b => + { + b.Navigation("Consumers"); + + b.Navigation("LanguageOfChoice"); + + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Program", b => + { + b.Navigation("CoordinatorsRef"); + + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.ProgramOffering", b => + { + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Room", b => + { + b.Navigation("Consumers"); + + b.Navigation("OtherCodes"); + }); + + modelBuilder.Entity("ooapi.v5.Models.Service", b => + { + b.Navigation("Consumers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.cs b/v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.cs new file mode 100644 index 0000000..348d0fa --- /dev/null +++ b/v5/ooapi.v5.core/Migrations/20240426143718_AddedConsumerAndAttributeColumnForOffering.cs @@ -0,0 +1,351 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace ooapi.v5.core.Migrations +{ + /// + public partial class AddedConsumerAndAttributeColumnForOffering : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Attributes_ComponentOfferings_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropForeignKey( + name: "FK_Attributes_CourseOfferings_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropForeignKey( + name: "FK_Attributes_ProgramOfferings_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropForeignKey( + name: "FK_Consumers_ComponentOfferings_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropForeignKey( + name: "FK_Consumers_CourseOfferings_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropForeignKey( + name: "FK_Consumers_ProgramOfferings_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropIndex( + name: "IX_Consumers_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropIndex( + name: "IX_Consumers_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropIndex( + name: "IX_Consumers_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropIndex( + name: "IX_Attributes_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropIndex( + name: "IX_Attributes_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropIndex( + name: "IX_Attributes_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropColumn( + name: "ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropColumn( + name: "CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropColumn( + name: "Discriminator", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropColumn( + name: "ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropColumn( + name: "ServiceId", + schema: "ooapiv5", + table: "Consumers"); + + migrationBuilder.DropColumn( + name: "ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropColumn( + name: "CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropColumn( + name: "Discriminator", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.DropColumn( + name: "ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes"); + + migrationBuilder.AddColumn( + name: "Attributes", + schema: "ooapiv5", + table: "ProgramOfferings", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Consumers", + schema: "ooapiv5", + table: "ProgramOfferings", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Attributes", + schema: "ooapiv5", + table: "CourseOfferings", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Consumers", + schema: "ooapiv5", + table: "CourseOfferings", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Attributes", + schema: "ooapiv5", + table: "ComponentOfferings", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Consumers", + schema: "ooapiv5", + table: "ComponentOfferings", + type: "nvarchar(max)", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Attributes", + schema: "ooapiv5", + table: "ProgramOfferings"); + + migrationBuilder.DropColumn( + name: "Consumers", + schema: "ooapiv5", + table: "ProgramOfferings"); + + migrationBuilder.DropColumn( + name: "Attributes", + schema: "ooapiv5", + table: "CourseOfferings"); + + migrationBuilder.DropColumn( + name: "Consumers", + schema: "ooapiv5", + table: "CourseOfferings"); + + migrationBuilder.DropColumn( + name: "Attributes", + schema: "ooapiv5", + table: "ComponentOfferings"); + + migrationBuilder.DropColumn( + name: "Consumers", + schema: "ooapiv5", + table: "ComponentOfferings"); + + migrationBuilder.AddColumn( + name: "ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "Discriminator", + schema: "ooapiv5", + table: "Consumers", + type: "nvarchar(max)", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "ServiceId", + schema: "ooapiv5", + table: "Consumers", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "Discriminator", + schema: "ooapiv5", + table: "Attributes", + type: "nvarchar(max)", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_Consumers_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + column: "ComponentOfferingOfferingId"); + + migrationBuilder.CreateIndex( + name: "IX_Consumers_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + column: "CourseOfferingOfferingId"); + + migrationBuilder.CreateIndex( + name: "IX_Consumers_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + column: "ProgramOfferingOfferingId"); + + migrationBuilder.CreateIndex( + name: "IX_Attributes_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + column: "ComponentOfferingOfferingId"); + + migrationBuilder.CreateIndex( + name: "IX_Attributes_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + column: "CourseOfferingOfferingId"); + + migrationBuilder.CreateIndex( + name: "IX_Attributes_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + column: "ProgramOfferingOfferingId"); + + migrationBuilder.AddForeignKey( + name: "FK_Attributes_ComponentOfferings_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + column: "ComponentOfferingOfferingId", + principalSchema: "ooapiv5", + principalTable: "ComponentOfferings", + principalColumn: "OfferingId"); + + migrationBuilder.AddForeignKey( + name: "FK_Attributes_CourseOfferings_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + column: "CourseOfferingOfferingId", + principalSchema: "ooapiv5", + principalTable: "CourseOfferings", + principalColumn: "OfferingId"); + + migrationBuilder.AddForeignKey( + name: "FK_Attributes_ProgramOfferings_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Attributes", + column: "ProgramOfferingOfferingId", + principalSchema: "ooapiv5", + principalTable: "ProgramOfferings", + principalColumn: "OfferingId"); + + migrationBuilder.AddForeignKey( + name: "FK_Consumers_ComponentOfferings_ComponentOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + column: "ComponentOfferingOfferingId", + principalSchema: "ooapiv5", + principalTable: "ComponentOfferings", + principalColumn: "OfferingId"); + + migrationBuilder.AddForeignKey( + name: "FK_Consumers_CourseOfferings_CourseOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + column: "CourseOfferingOfferingId", + principalSchema: "ooapiv5", + principalTable: "CourseOfferings", + principalColumn: "OfferingId"); + + migrationBuilder.AddForeignKey( + name: "FK_Consumers_ProgramOfferings_ProgramOfferingOfferingId", + schema: "ooapiv5", + table: "Consumers", + column: "ProgramOfferingOfferingId", + principalSchema: "ooapiv5", + principalTable: "ProgramOfferings", + principalColumn: "OfferingId"); + } + } +} diff --git a/v5/ooapi.v5.core/Migrations/CoreDBContextModelSnapshot.cs b/v5/ooapi.v5.core/Migrations/CoreDBContextModelSnapshot.cs index 27d9f74..fbfd54b 100644 --- a/v5/ooapi.v5.core/Migrations/CoreDBContextModelSnapshot.cs +++ b/v5/ooapi.v5.core/Migrations/CoreDBContextModelSnapshot.cs @@ -368,15 +368,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ComponentId") .HasColumnType("uniqueidentifier"); - b.Property("ComponentOfferingOfferingId") - .HasColumnType("uniqueidentifier"); - b.Property("CourseId") .HasColumnType("uniqueidentifier"); - b.Property("CourseOfferingOfferingId") - .HasColumnType("uniqueidentifier"); - b.Property("GroupId") .HasColumnType("uniqueidentifier"); @@ -389,9 +383,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("OrganizationId") .HasColumnType("uniqueidentifier"); - b.Property("ProgramOfferingOfferingId") - .HasColumnType("uniqueidentifier"); - b.Property("Value") .IsRequired() .HasColumnType("nvarchar(max)"); @@ -404,12 +395,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ComponentId"); - b.HasIndex("ComponentOfferingOfferingId"); - b.HasIndex("CourseId"); - b.HasIndex("CourseOfferingOfferingId"); - b.HasIndex("GroupId"); b.HasIndex("NewsFeedId"); @@ -418,8 +405,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("OrganizationId"); - b.HasIndex("ProgramOfferingOfferingId"); - b.ToTable("Attributes", "ooapiv5"); b.HasDiscriminator().HasValue("Attribute"); @@ -660,15 +645,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ComponentId") .HasColumnType("uniqueidentifier"); - b.Property("ComponentOfferingOfferingId") - .HasColumnType("uniqueidentifier"); - b.Property("CourseId") .HasColumnType("uniqueidentifier"); - b.Property("CourseOfferingOfferingId") - .HasColumnType("uniqueidentifier"); - b.Property("GroupId") .HasColumnType("uniqueidentifier"); @@ -684,9 +663,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PersonId") .HasColumnType("uniqueidentifier"); - b.Property("ProgramOfferingOfferingId") - .HasColumnType("uniqueidentifier"); - b.Property("PropertyType") .HasColumnType("int"); @@ -697,9 +673,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("RoomId") .HasColumnType("uniqueidentifier"); - b.Property("ServiceId") - .HasColumnType("uniqueidentifier"); - b.HasKey("Id", "ConsumerKey", "PropertyName"); b.HasIndex("AcademicSessionId"); @@ -710,12 +683,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ComponentId"); - b.HasIndex("ComponentOfferingOfferingId"); - b.HasIndex("CourseId"); - b.HasIndex("CourseOfferingOfferingId"); - b.HasIndex("GroupId"); b.HasIndex("NewsFeedId"); @@ -726,8 +695,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PersonId"); - b.HasIndex("ProgramOfferingOfferingId"); - b.HasIndex("RoomId"); b.ToTable("Consumers", "ooapiv5"); @@ -2039,18 +2006,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .WithMany("Attributes") .HasForeignKey("ComponentId"); - b.HasOne("ooapi.v5.Models.ComponentOffering", null) - .WithMany("Attributes") - .HasForeignKey("ComponentOfferingOfferingId"); - b.HasOne("ooapi.v5.Models.Course", null) .WithMany("Attributes") .HasForeignKey("CourseId"); - b.HasOne("ooapi.v5.Models.CourseOffering", null) - .WithMany("Attributes") - .HasForeignKey("CourseOfferingOfferingId"); - b.HasOne("ooapi.v5.Models.Group", null) .WithMany("Attributes") .HasForeignKey("GroupId"); @@ -2066,10 +2025,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("ooapi.v5.Models.Organization", null) .WithMany("Attributes") .HasForeignKey("OrganizationId"); - - b.HasOne("ooapi.v5.Models.ProgramOffering", null) - .WithMany("Attributes") - .HasForeignKey("ProgramOfferingOfferingId"); }); modelBuilder.Entity("ooapi.v5.Models.Building", b => @@ -2118,10 +2073,79 @@ protected override void BuildModel(ModelBuilder modelBuilder) .WithMany() .HasForeignKey("RoomId"); + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("ComponentOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ComponentOfferingOfferingId", "Id"); + + b1.ToTable("ComponentOfferings", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("ComponentOfferingOfferingId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("ComponentOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ComponentOfferingOfferingId", "Id"); + + b1.ToTable("ComponentOfferings", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("ComponentOfferingOfferingId"); + }); + b.Navigation("AcademicSession"); + b.Navigation("Attributes"); + b.Navigation("Component"); + b.Navigation("Consumers"); + b.Navigation("Course"); b.Navigation("Organization"); @@ -2147,18 +2171,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .WithMany("Consumers") .HasForeignKey("ComponentId"); - b.HasOne("ooapi.v5.Models.ComponentOffering", null) - .WithMany("Consumers") - .HasForeignKey("ComponentOfferingOfferingId"); - b.HasOne("ooapi.v5.Models.Course", null) .WithMany("Consumers") .HasForeignKey("CourseId"); - b.HasOne("ooapi.v5.Models.CourseOffering", null) - .WithMany("Consumers") - .HasForeignKey("CourseOfferingOfferingId"); - b.HasOne("ooapi.v5.Models.Group", null) .WithMany("Consumers") .HasForeignKey("GroupId"); @@ -2179,10 +2195,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .WithMany("Consumers") .HasForeignKey("PersonId"); - b.HasOne("ooapi.v5.Models.ProgramOffering", null) - .WithMany("Consumers") - .HasForeignKey("ProgramOfferingOfferingId"); - b.HasOne("ooapi.v5.Models.Room", null) .WithMany("Consumers") .HasForeignKey("RoomId"); @@ -2228,8 +2240,77 @@ protected override void BuildModel(ModelBuilder modelBuilder) .WithMany() .HasForeignKey("ProgramOfferingId"); + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("CourseOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("CourseOfferingOfferingId", "Id"); + + b1.ToTable("CourseOfferings", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("CourseOfferingOfferingId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("CourseOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("CourseOfferingOfferingId", "Id"); + + b1.ToTable("CourseOfferings", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("CourseOfferingOfferingId"); + }); + b.Navigation("AcademicSession"); + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + b.Navigation("Course"); b.Navigation("Organization"); @@ -2507,8 +2588,77 @@ protected override void BuildModel(ModelBuilder modelBuilder) .WithMany() .HasForeignKey("ProgramId"); + b.OwnsMany("ooapi.v5.Models.LanguageTypedProperty", "Attributes", b1 => + { + b1.Property("ProgramOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ProgramOfferingOfferingId", "Id"); + + b1.ToTable("ProgramOfferings", "ooapiv5"); + + b1.ToJson("Attributes"); + + b1.WithOwner() + .HasForeignKey("ProgramOfferingOfferingId"); + }); + + b.OwnsMany("ooapi.v5.Models.ConsumerBase", "Consumers", b1 => + { + b1.Property("ProgramOfferingOfferingId") + .HasColumnType("uniqueidentifier"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b1.Property("ConsumerKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("PropertyType") + .HasColumnType("int"); + + b1.Property("PropertyValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ProgramOfferingOfferingId", "Id"); + + b1.ToTable("ProgramOfferings", "ooapiv5"); + + b1.ToJson("Consumers"); + + b1.WithOwner() + .HasForeignKey("ProgramOfferingOfferingId"); + }); + b.Navigation("AcademicSession"); + b.Navigation("Attributes"); + + b.Navigation("Consumers"); + b.Navigation("Organization"); b.Navigation("Program"); @@ -2563,10 +2713,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("ooapi.v5.Models.ComponentOffering", b => { - b.Navigation("Attributes"); - - b.Navigation("Consumers"); - b.Navigation("OtherCodes"); }); @@ -2585,10 +2731,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("ooapi.v5.Models.CourseOffering", b => { - b.Navigation("Attributes"); - - b.Navigation("Consumers"); - b.Navigation("OtherCodes"); }); @@ -2647,10 +2789,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("ooapi.v5.Models.ProgramOffering", b => { - b.Navigation("Attributes"); - - b.Navigation("Consumers"); - b.Navigation("OtherCodes"); }); diff --git a/v5/ooapi.v5.core/Models/Offering.cs b/v5/ooapi.v5.core/Models/Offering.cs index 58c1536..966908c 100644 --- a/v5/ooapi.v5.core/Models/Offering.cs +++ b/v5/ooapi.v5.core/Models/Offering.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using ooapi.v5.Attributes; +using ooapi.v5.core.Extensions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Enums; using ooapi.v5.Helpers; @@ -93,18 +94,7 @@ public OneOfAcademicSession? OneOfAcademicSession [JsonRequired] [JsonProperty(PropertyName = "name")] [NotMapped] - public List name - { - get - { - var result = new List(); - if (Attributes != null && Attributes.Any()) - { - result = Attributes.Where(x => x.PropertyName.Equals("name")).Select(x => new LanguageTypedString() { Language = x.Language, Value = x.Value }).ToList(); - } - return result; - } - } + public List name => Attributes.ExtractStringsByPropertyName(nameof(name)); /// /// List of attribtes @@ -112,7 +102,7 @@ public List name [JsonIgnore] [SortAllowed] [SortDefault] - public List Attributes { get; set; } = default!; + public List Attributes { get; set; } = default!; /// /// The abbreviation or internal code used to identify this offering @@ -292,7 +282,7 @@ public List ConsumersList /// List of consumers /// [JsonIgnore] - public List Consumers { get; set; } = default!; + public List Consumers { get; set; } = default!; /// /// The first day on which a student can enroll for this course. diff --git a/v5/ooapi.v5.core/Repositories/CoreDBContext.cs b/v5/ooapi.v5.core/Repositories/CoreDBContext.cs index bb06535..26b9807 100644 --- a/v5/ooapi.v5.core/Repositories/CoreDBContext.cs +++ b/v5/ooapi.v5.core/Repositories/CoreDBContext.cs @@ -115,17 +115,26 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity().HasKey(c => c.AssociationId); modelBuilder.Entity().HasKey(c => c.BuildingId); modelBuilder.Entity().HasKey(c => c.ComponentId); - modelBuilder.Entity().HasKey(c => c.OfferingId); + modelBuilder.Entity().OwnsMany(q => q.Consumers, nb => { nb.ToJson(); }) + .OwnsMany(q => q.Attributes, nb => { nb.ToJson(); }) + .HasKey(c => c.OfferingId); + modelBuilder.Entity().HasKey(c => c.ResultId); modelBuilder.Entity().HasKey(c => c.CourseId); - modelBuilder.Entity().HasKey(c => c.OfferingId); + modelBuilder.Entity().OwnsMany(q => q.Consumers, nb => { nb.ToJson(); }) + .OwnsMany(q => q.Attributes, nb => { nb.ToJson(); }) + .HasKey(c => c.OfferingId); + modelBuilder.Entity().HasKey(c => c.ResultId); modelBuilder.Entity().HasKey(c => c.GroupId); modelBuilder.Entity().HasKey(c => c.NewsFeedId); modelBuilder.Entity().HasKey(c => c.NewsItemId); modelBuilder.Entity().HasKey(c => c.OrganizationId); modelBuilder.Entity().HasKey(c => c.PersonId); - modelBuilder.Entity().HasKey(c => c.OfferingId); + modelBuilder.Entity().OwnsMany(q => q.Consumers, nb => { nb.ToJson(); }) + .OwnsMany(q => q.Attributes, nb => { nb.ToJson(); }) + .HasKey(c => c.OfferingId); + modelBuilder.Entity().HasKey(c => c.ResultId); modelBuilder.Entity().HasKey(c => c.RoomId); modelBuilder.Entity
() diff --git a/v5/ooapi.v5.core/ooapi.v5.core.csproj b/v5/ooapi.v5.core/ooapi.v5.core.csproj index c2a1448..97089ec 100644 --- a/v5/ooapi.v5.core/ooapi.v5.core.csproj +++ b/v5/ooapi.v5.core/ooapi.v5.core.csproj @@ -24,4 +24,7 @@ + + + \ No newline at end of file From 2c7773c66e66bf74acee27b6fbfa0bb08d20f8c6 Mon Sep 17 00:00:00 2001 From: Maykel Melis Date: Thu, 11 Jun 2026 12:40:14 +0200 Subject: [PATCH 2/6] Update to .net 10 --- v5/Directory.Build.props | 7 +++++++ v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj | 2 -- v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj | 2 -- v5/ooapi.v5.core/ooapi.v5.core.csproj | 2 -- v5/ooapi.v5.sln | 1 + v5/ooapi.v5/ooapi.v5.csproj | 2 -- 6 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 v5/Directory.Build.props diff --git a/v5/Directory.Build.props b/v5/Directory.Build.props new file mode 100644 index 0000000..907bacd --- /dev/null +++ b/v5/Directory.Build.props @@ -0,0 +1,7 @@ + + + latest + net10.0 + enable + + \ No newline at end of file diff --git a/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj b/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj index d2c3eb2..2d7bb68 100644 --- a/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj +++ b/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj @@ -1,8 +1,6 @@  - net8.0 enable - enable false true diff --git a/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj b/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj index 606f5f3..686b835 100644 --- a/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj +++ b/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj @@ -1,8 +1,6 @@  - net8.0 enable - enable false true diff --git a/v5/ooapi.v5.core/ooapi.v5.core.csproj b/v5/ooapi.v5.core/ooapi.v5.core.csproj index 97089ec..3a89053 100644 --- a/v5/ooapi.v5.core/ooapi.v5.core.csproj +++ b/v5/ooapi.v5.core/ooapi.v5.core.csproj @@ -1,8 +1,6 @@  - net8.0 enable - enable True diff --git a/v5/ooapi.v5.sln b/v5/ooapi.v5.sln index 84cb76c..250429e 100644 --- a/v5/ooapi.v5.sln +++ b/v5/ooapi.v5.sln @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt dotnetcoverage.runsettings.xml = dotnetcoverage.runsettings.xml ..\LICENSE = ..\LICENSE ..\README.md = ..\README.md + Directory.Build.props = Directory.Build.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ooapi.v5.UnitTests", "ooapi.v5.UnitTests\ooapi.v5.UnitTests.csproj", "{77C9B463-E06B-472D-934C-DDF2606E9D48}" diff --git a/v5/ooapi.v5/ooapi.v5.csproj b/v5/ooapi.v5/ooapi.v5.csproj index 29352df..cc50a48 100644 --- a/v5/ooapi.v5/ooapi.v5.csproj +++ b/v5/ooapi.v5/ooapi.v5.csproj @@ -1,7 +1,5 @@ - net8.0 - enable disable True 5ef00e10-2625-4afc-9482-9b9b23942908 From 033b847eb80915a6bc67514944e4c8e01329bc40 Mon Sep 17 00:00:00 2001 From: Maykel Melis Date: Thu, 11 Jun 2026 12:41:24 +0200 Subject: [PATCH 3/6] Add Central Package Management --- v5/Directory.Packages.props | 32 +++++++++++++++++++ .../ooapi.v5.UnitTests.csproj | 18 +++++------ .../ooapi.v5.core.UnitTests.csproj | 20 ++++++------ v5/ooapi.v5.core/ooapi.v5.core.csproj | 20 ++++++------ v5/ooapi.v5.sln | 1 + v5/ooapi.v5/ooapi.v5.csproj | 28 ++++++++-------- 6 files changed, 76 insertions(+), 43 deletions(-) create mode 100644 v5/Directory.Packages.props diff --git a/v5/Directory.Packages.props b/v5/Directory.Packages.props new file mode 100644 index 0000000..a06b701 --- /dev/null +++ b/v5/Directory.Packages.props @@ -0,0 +1,32 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj b/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj index 2d7bb68..705e03d 100644 --- a/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj +++ b/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj @@ -5,18 +5,18 @@ true - - - - - - - - + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj b/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj index 686b835..d485ab7 100644 --- a/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj +++ b/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj @@ -5,22 +5,22 @@ true - - - - - - - - + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/v5/ooapi.v5.core/ooapi.v5.core.csproj b/v5/ooapi.v5.core/ooapi.v5.core.csproj index 3a89053..bf44311 100644 --- a/v5/ooapi.v5.core/ooapi.v5.core.csproj +++ b/v5/ooapi.v5.core/ooapi.v5.core.csproj @@ -10,17 +10,17 @@ 1701;1702;1591 - - - + + + - - - - - - - + + + + + + + diff --git a/v5/ooapi.v5.sln b/v5/ooapi.v5.sln index 250429e..e7f81fa 100644 --- a/v5/ooapi.v5.sln +++ b/v5/ooapi.v5.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt ..\LICENSE = ..\LICENSE ..\README.md = ..\README.md Directory.Build.props = Directory.Build.props + Directory.Packages.props = Directory.Packages.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ooapi.v5.UnitTests", "ooapi.v5.UnitTests\ooapi.v5.UnitTests.csproj", "{77C9B463-E06B-472D-934C-DDF2606E9D48}" diff --git a/v5/ooapi.v5/ooapi.v5.csproj b/v5/ooapi.v5/ooapi.v5.csproj index cc50a48..6b49ea0 100644 --- a/v5/ooapi.v5/ooapi.v5.csproj +++ b/v5/ooapi.v5/ooapi.v5.csproj @@ -1,4 +1,4 @@ - + disable True @@ -7,19 +7,19 @@ ooapi.v5 - - - - - - - - - - - - - + + + + + + + + + + + + + From 7ccb0dd92cd92f9d8f3f559761c997422b3ba66a Mon Sep 17 00:00:00 2001 From: Maykel Melis Date: Thu, 11 Jun 2026 12:46:23 +0200 Subject: [PATCH 4/6] Convert sln file to slnx --- v5/ooapi.v5.sln | 52 ------------------------------------------------ v5/ooapi.v5.slnx | 14 +++++++++++++ 2 files changed, 14 insertions(+), 52 deletions(-) delete mode 100644 v5/ooapi.v5.sln create mode 100644 v5/ooapi.v5.slnx diff --git a/v5/ooapi.v5.sln b/v5/ooapi.v5.sln deleted file mode 100644 index e7f81fa..0000000 --- a/v5/ooapi.v5.sln +++ /dev/null @@ -1,52 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32014.148 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ooapi.v5", "ooapi.v5\ooapi.v5.csproj", "{EA5049C6-DF4F-4A79-AEAF-C9FD3B1244B9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ooapi.v5.core", "ooapi.v5.core\ooapi.v5.core.csproj", "{17F78369-11CB-4318-8047-E1F8580B8687}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{D4C8F2A3-CE03-499D-A059-EDCDAF6BCF61}" - ProjectSection(SolutionItems) = preProject - ..\.gitignore = ..\.gitignore - dotnetcoverage.runsettings.xml = dotnetcoverage.runsettings.xml - ..\LICENSE = ..\LICENSE - ..\README.md = ..\README.md - Directory.Build.props = Directory.Build.props - Directory.Packages.props = Directory.Packages.props - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ooapi.v5.UnitTests", "ooapi.v5.UnitTests\ooapi.v5.UnitTests.csproj", "{77C9B463-E06B-472D-934C-DDF2606E9D48}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ooapi.v5.core.UnitTests", "ooapi.v5.core.UnitTests\ooapi.v5.core.UnitTests.csproj", "{7448434C-CE41-47BE-B402-F79401F85A63}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EA5049C6-DF4F-4A79-AEAF-C9FD3B1244B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA5049C6-DF4F-4A79-AEAF-C9FD3B1244B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA5049C6-DF4F-4A79-AEAF-C9FD3B1244B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA5049C6-DF4F-4A79-AEAF-C9FD3B1244B9}.Release|Any CPU.Build.0 = Release|Any CPU - {17F78369-11CB-4318-8047-E1F8580B8687}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17F78369-11CB-4318-8047-E1F8580B8687}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17F78369-11CB-4318-8047-E1F8580B8687}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17F78369-11CB-4318-8047-E1F8580B8687}.Release|Any CPU.Build.0 = Release|Any CPU - {77C9B463-E06B-472D-934C-DDF2606E9D48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77C9B463-E06B-472D-934C-DDF2606E9D48}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77C9B463-E06B-472D-934C-DDF2606E9D48}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77C9B463-E06B-472D-934C-DDF2606E9D48}.Release|Any CPU.Build.0 = Release|Any CPU - {7448434C-CE41-47BE-B402-F79401F85A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7448434C-CE41-47BE-B402-F79401F85A63}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7448434C-CE41-47BE-B402-F79401F85A63}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7448434C-CE41-47BE-B402-F79401F85A63}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B1D95082-437C-4AF2-BBC7-94B3441E82A6} - EndGlobalSection -EndGlobal diff --git a/v5/ooapi.v5.slnx b/v5/ooapi.v5.slnx new file mode 100644 index 0000000..ad53e96 --- /dev/null +++ b/v5/ooapi.v5.slnx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + From a651c56a1685dd116bc041e4d8a4835f966a83c8 Mon Sep 17 00:00:00 2001 From: Maykel Melis Date: Thu, 11 Jun 2026 13:38:40 +0200 Subject: [PATCH 5/6] Updated most packages to latest version. Replace FluentAssertions with AwesomeAssertions --- v5/Directory.Packages.props | 35 +++++++++---------- v5/NuGet.config | 12 +++++++ v5/ooapi.v5.UnitTests/GlobalUsings.cs | 2 +- .../ooapi.v5.UnitTests.csproj | 2 +- .../Helpers/ConsumerConverterTests.cs | 2 +- .../Helpers/DateFormatConverterTests.cs | 2 +- .../LanguageTypedStringJsonConverterTests.cs | 2 +- .../Helpers/ListOneOfConverterTests.cs | 2 +- .../Helpers/OneOfConverterTests.cs | 2 +- .../Models/AcademicSessionTests.cs | 2 +- .../Models/AddressTests.cs | 2 +- .../Models/AssociationTests.cs | 2 +- .../Models/BuildingTests.cs | 2 +- .../Models/ComponentOfferingTests.cs | 2 +- .../Models/ComponentTests.cs | 2 +- .../Models/CostTests.cs | 2 +- .../Models/CourseOfferingTests.cs | 2 +- .../Models/CourseResultTests.cs | 2 +- .../Models/CourseTests.cs | 2 +- .../Models/EducationSpecificationTests.cs | 3 +- .../Models/ErrorResponseTests.cs | 2 +- .../Models/GroupTests.cs | 2 +- .../Models/NewsFeedTests.cs | 2 +- .../Models/NewsItemTests.cs | 2 +- .../Models/OfferingTests.cs | 2 +- .../Models/OrganizationTests.cs | 2 +- .../Models/PaginationTests.cs | 6 ++-- .../Models/PersonTests.cs | 2 +- .../Models/PostResponseTests.cs | 2 +- .../Models/ProgramOfferingTests.cs | 2 +- .../Models/ProgramResultTests.cs | 2 +- .../Models/ProgramTests.cs | 2 +- .../Models/RoomTests.cs | 2 +- .../Models/ServiceTests.cs | 2 +- .../AcademicSessionsRepositoryTests.cs | 8 ++--- .../AssociationsRepositoryTests.cs | 8 ++--- .../Repositories/BaseRepositoryTests.cs | 8 ++--- .../Repositories/BuildingsRepositoryTests.cs | 6 ++-- .../ComponentOfferingsRepositoryTests.cs | 8 ++--- .../Repositories/ComponentsRepositoryTests.cs | 12 +++---- .../CourseOfferingsRepositoryTests.cs | 8 ++--- .../Repositories/CoursesRepositoryTests.cs | 12 +++---- .../EducationSpecificationsRepositoryTests.cs | 20 +++++------ .../Repositories/GroupsRepositoryTests.cs | 8 ++--- .../Repositories/NewsFeedsRepositoryTests.cs | 4 +-- .../Repositories/NewsItemsRepositoryTests.cs | 4 +-- .../OrganizationsRepositoryTests.cs | 8 ++--- .../Repositories/PersonRepositoryTests.cs | 4 +-- .../ProgramOfferingsRepositoryTests.cs | 10 +++--- .../Repositories/ProgramsRepositoryTests.cs | 22 ++++++------ .../Repositories/RoomsRepositoryTests.cs | 9 ++--- .../ServiceMetadataRepositoryTests.cs | 3 +- .../Security/UserRequestContextTests.cs | 2 +- .../Services/OrganizationsServiceTests.cs | 5 +-- .../Utility/FilterHelperTests.cs | 2 +- .../Utility/FilterTests.cs | 2 +- .../Utility/FilterToLinqTests.cs | 2 +- .../Utility/OrderedQueryableTests.cs | 2 +- .../ooapi.v5.core.UnitTests.csproj | 2 +- .../Extensions/EnumerableExtensions.cs | 9 +++++ .../LanguageTypedPropertyExtensions.cs | 8 +---- .../Helpers/ListOneOfConverter.cs | 1 + v5/ooapi.v5.core/Helpers/OneOfConverter.cs | 2 +- v5/ooapi.v5.core/ooapi.v5.core.csproj | 6 ++-- v5/ooapi.v5/ooapi.v5.csproj | 6 ++-- 65 files changed, 174 insertions(+), 153 deletions(-) create mode 100644 v5/NuGet.config create mode 100644 v5/ooapi.v5.core/Extensions/EnumerableExtensions.cs diff --git a/v5/Directory.Packages.props b/v5/Directory.Packages.props index a06b701..29e72ad 100644 --- a/v5/Directory.Packages.props +++ b/v5/Directory.Packages.props @@ -3,30 +3,29 @@ true + - + - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/v5/NuGet.config b/v5/NuGet.config new file mode 100644 index 0000000..185bbb8 --- /dev/null +++ b/v5/NuGet.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/v5/ooapi.v5.UnitTests/GlobalUsings.cs b/v5/ooapi.v5.UnitTests/GlobalUsings.cs index fd5f268..b97a473 100644 --- a/v5/ooapi.v5.UnitTests/GlobalUsings.cs +++ b/v5/ooapi.v5.UnitTests/GlobalUsings.cs @@ -1,4 +1,4 @@ global using NUnit.Framework; global using AutoFixture; -global using FluentAssertions; +global using AwesomeAssertions; global using NSubstitute; \ No newline at end of file diff --git a/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj b/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj index 705e03d..aadec9a 100644 --- a/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj +++ b/v5/ooapi.v5.UnitTests/ooapi.v5.UnitTests.csproj @@ -6,7 +6,7 @@ - + diff --git a/v5/ooapi.v5.core.UnitTests/Helpers/ConsumerConverterTests.cs b/v5/ooapi.v5.core.UnitTests/Helpers/ConsumerConverterTests.cs index e94c916..3ce454d 100644 --- a/v5/ooapi.v5.core.UnitTests/Helpers/ConsumerConverterTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Helpers/ConsumerConverterTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json; using ooapi.v5.Enums; using ooapi.v5.Helpers; diff --git a/v5/ooapi.v5.core.UnitTests/Helpers/DateFormatConverterTests.cs b/v5/ooapi.v5.core.UnitTests/Helpers/DateFormatConverterTests.cs index 93f2a8d..a9015f1 100644 --- a/v5/ooapi.v5.core.UnitTests/Helpers/DateFormatConverterTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Helpers/DateFormatConverterTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Helpers; namespace ooapi.v5.core.UnitTests.Helpers; diff --git a/v5/ooapi.v5.core.UnitTests/Helpers/LanguageTypedStringJsonConverterTests.cs b/v5/ooapi.v5.core.UnitTests/Helpers/LanguageTypedStringJsonConverterTests.cs index 184235c..0c34356 100644 --- a/v5/ooapi.v5.core.UnitTests/Helpers/LanguageTypedStringJsonConverterTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Helpers/LanguageTypedStringJsonConverterTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json; using ooapi.v5.Helpers; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Helpers/ListOneOfConverterTests.cs b/v5/ooapi.v5.core.UnitTests/Helpers/ListOneOfConverterTests.cs index 0e32768..a88b2fe 100644 --- a/v5/ooapi.v5.core.UnitTests/Helpers/ListOneOfConverterTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Helpers/ListOneOfConverterTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json; using ooapi.v5.Helpers; diff --git a/v5/ooapi.v5.core.UnitTests/Helpers/OneOfConverterTests.cs b/v5/ooapi.v5.core.UnitTests/Helpers/OneOfConverterTests.cs index f504c25..67ae916 100644 --- a/v5/ooapi.v5.core.UnitTests/Helpers/OneOfConverterTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Helpers/OneOfConverterTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json; using ooapi.v5.Helpers; diff --git a/v5/ooapi.v5.core.UnitTests/Models/AcademicSessionTests.cs b/v5/ooapi.v5.core.UnitTests/Models/AcademicSessionTests.cs index 599362c..c820aba 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/AcademicSessionTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/AcademicSessionTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/AddressTests.cs b/v5/ooapi.v5.core.UnitTests/Models/AddressTests.cs index 358fb43..1659007 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/AddressTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/AddressTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/AssociationTests.cs b/v5/ooapi.v5.core.UnitTests/Models/AssociationTests.cs index ca354ed..130e977 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/AssociationTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/AssociationTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/BuildingTests.cs b/v5/ooapi.v5.core.UnitTests/Models/BuildingTests.cs index e6672d8..356b62c 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/BuildingTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/BuildingTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/ComponentOfferingTests.cs b/v5/ooapi.v5.core.UnitTests/Models/ComponentOfferingTests.cs index cd3f151..638b972 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/ComponentOfferingTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/ComponentOfferingTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/ComponentTests.cs b/v5/ooapi.v5.core.UnitTests/Models/ComponentTests.cs index c386cec..3e48ce9 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/ComponentTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/ComponentTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/CostTests.cs b/v5/ooapi.v5.core.UnitTests/Models/CostTests.cs index cb29ba6..39ba7bb 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/CostTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/CostTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; namespace ooapi.v5.core.UnitTests.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/CourseOfferingTests.cs b/v5/ooapi.v5.core.UnitTests/Models/CourseOfferingTests.cs index 990a220..c5b5f7c 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/CourseOfferingTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/CourseOfferingTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/CourseResultTests.cs b/v5/ooapi.v5.core.UnitTests/Models/CourseResultTests.cs index 167fc6e..5c6ec66 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/CourseResultTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/CourseResultTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; namespace ooapi.v5.core.UnitTests.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/CourseTests.cs b/v5/ooapi.v5.core.UnitTests/Models/CourseTests.cs index 05e5370..bcb26c0 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/CourseTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/CourseTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/EducationSpecificationTests.cs b/v5/ooapi.v5.core.UnitTests/Models/EducationSpecificationTests.cs index 59eabe7..230d9fd 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/EducationSpecificationTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/EducationSpecificationTests.cs @@ -1,8 +1,7 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; -using Attribute = ooapi.v5.Models.Attribute; namespace ooapi.v5.core.UnitTests.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/ErrorResponseTests.cs b/v5/ooapi.v5.core.UnitTests/Models/ErrorResponseTests.cs index 7c23159..d1cbda9 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/ErrorResponseTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/ErrorResponseTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; namespace ooapi.v5.core.UnitTests.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/GroupTests.cs b/v5/ooapi.v5.core.UnitTests/Models/GroupTests.cs index bf64914..876b516 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/GroupTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/GroupTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/NewsFeedTests.cs b/v5/ooapi.v5.core.UnitTests/Models/NewsFeedTests.cs index 969643e..46b2ede 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/NewsFeedTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/NewsFeedTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/NewsItemTests.cs b/v5/ooapi.v5.core.UnitTests/Models/NewsItemTests.cs index e597633..6ef23d8 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/NewsItemTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/NewsItemTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs b/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs index fdc3081..3fcfbe4 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/OfferingTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/OrganizationTests.cs b/v5/ooapi.v5.core.UnitTests/Models/OrganizationTests.cs index cbffdf3..1190cfe 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/OrganizationTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/OrganizationTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; using Attribute = ooapi.v5.Models.Attribute; diff --git a/v5/ooapi.v5.core.UnitTests/Models/PaginationTests.cs b/v5/ooapi.v5.core.UnitTests/Models/PaginationTests.cs index ed6aff3..a32e25c 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/PaginationTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/PaginationTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using MockQueryable.NSubstitute; using ooapi.v5.core.Utility; using ooapi.v5.Models; @@ -20,7 +20,7 @@ public async Task Constructor_WithoutFilter_SetItems() .With(x => x.PageSize, 100) .Without(x => x.Filter) .Create(); - var db = items.AsQueryable().BuildMockDbSet(); + var db = items.BuildMockDbSet(); // act var pagination = await Pagination.CreateAsync(db, parameters); @@ -44,7 +44,7 @@ public async Task Constructor_WithFilter_SetItems() .With(x => x.PageSize, 2) .With(x => x.Filter, "value eq test") .Create(); - var db = items.AsQueryable().BuildMockDbSet(); + var db = items.BuildMockDbSet(); // act var pagination = await Pagination.CreateAsync(db, parameters); diff --git a/v5/ooapi.v5.core.UnitTests/Models/PersonTests.cs b/v5/ooapi.v5.core.UnitTests/Models/PersonTests.cs index 5379a59..59de1ab 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/PersonTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/PersonTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json.Linq; using ooapi.v5.Enums; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/PostResponseTests.cs b/v5/ooapi.v5.core.UnitTests/Models/PostResponseTests.cs index 1c390e5..6da84fd 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/PostResponseTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/PostResponseTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/ProgramOfferingTests.cs b/v5/ooapi.v5.core.UnitTests/Models/ProgramOfferingTests.cs index 8db9a7a..a621193 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/ProgramOfferingTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/ProgramOfferingTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/ProgramResultTests.cs b/v5/ooapi.v5.core.UnitTests/Models/ProgramResultTests.cs index 981ee1f..dd4fb30 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/ProgramResultTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/ProgramResultTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.Models; namespace ooapi.v5.core.UnitTests.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Models/ProgramTests.cs b/v5/ooapi.v5.core.UnitTests/Models/ProgramTests.cs index e0c31f3..60a29fe 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/ProgramTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/ProgramTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json.Linq; using ooapi.v5.core.Models.OneOfModels; using ooapi.v5.Enums; diff --git a/v5/ooapi.v5.core.UnitTests/Models/RoomTests.cs b/v5/ooapi.v5.core.UnitTests/Models/RoomTests.cs index 4ebd8ff..491b5ed 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/RoomTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/RoomTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using ooapi.v5.core.Models.OneOfModels; diff --git a/v5/ooapi.v5.core.UnitTests/Models/ServiceTests.cs b/v5/ooapi.v5.core.UnitTests/Models/ServiceTests.cs index 9d69fe0..eab029c 100644 --- a/v5/ooapi.v5.core.UnitTests/Models/ServiceTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Models/ServiceTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Newtonsoft.Json.Linq; using ooapi.v5.Enums; using ooapi.v5.Models; diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/AcademicSessionsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/AcademicSessionsRepositoryTests.cs index a5aa877..42b84d4 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/AcademicSessionsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/AcademicSessionsRepositoryTests.cs @@ -19,7 +19,7 @@ public async Task GetAcademicSession_WithValidId_ReturnsAcademicSession() { // Arrange var academicSessions = CreateDefaultAcademicSessions(); - + var db = academicSessions.BuildMockDbSet(); var dbContext = Substitute.For(); dbContext.AcademicSessionsNoTracking.Returns(db); @@ -122,7 +122,7 @@ public async Task GetAllOrderedBy_WithAcademicSessionType_ReturnsFilteredSet() .Without(a => a.CourseOfferings) .Without(a => a.ComponentOfferings) .Create() - }.AsQueryable(); + }; var db = academicSessions.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -141,7 +141,7 @@ public async Task GetAllOrderedBy_WithAcademicSessionType_ReturnsFilteredSet() }); } - private IQueryable CreateDefaultAcademicSessions() + private IList CreateDefaultAcademicSessions() { return _fixture.Build() .Without(a => a.Children) @@ -151,6 +151,6 @@ private IQueryable CreateDefaultAcademicSessions() .Without(a => a.CourseOfferings) .Without(a => a.ComponentOfferings) .CreateMany(2) - .AsQueryable(); + .ToList(); } } \ No newline at end of file diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/AssociationsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/AssociationsRepositoryTests.cs index 75b7dc1..627a070 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/AssociationsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/AssociationsRepositoryTests.cs @@ -26,7 +26,7 @@ public async Task GetAssociation_WhenAssociationExists_ReturnsAssociation() .Without(x => x.CourseOffering) .Without(x => x.ComponentOffering) .CreateMany(1) - .AsQueryable(); + .ToList(); var db = association.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -46,7 +46,7 @@ public async Task GetAssociation_WhenAssociationDoesNotExist_ReturnsNull() // Arrange var associationId = _fixture.Create(); - var association = new List().AsQueryable(); + var association = new List(); var db = association.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -72,7 +72,7 @@ public async Task GetAssociationsByPersonId_WhenAssociationsExist_ReturnsAssocia .Without(x => x.CourseOffering) .Without(x => x.ComponentOffering) .CreateMany(5) - .AsQueryable(); + .ToList(); var db = associations.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -92,7 +92,7 @@ public async Task GetAssociationsByPersonId_WhenAssociationsDoNotExist_ReturnsEm // Arrange var personId = _fixture.Create(); - var association = new List().AsQueryable(); + var association = new List(); var db = association.BuildMockDbSet(); var dbContext = Substitute.For(); dbContext.Associations.Returns(db); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/BaseRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/BaseRepositoryTests.cs index b48a0c4..aa90962 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/BaseRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/BaseRepositoryTests.cs @@ -21,7 +21,7 @@ public async Task GetAllOrderedBy_WithPrimaryCodeSearch_ReturnsFilteredSet() { new Foo() { PrimaryCode = "123" }, new Foo() { PrimaryCode = "456" } - }.AsQueryable().BuildMockDbSet(); + }.BuildMockDbSet(); // Act var result = await repository.GetAllOrderedByAsync(dataRequestParameters, set); @@ -39,7 +39,7 @@ public async Task GetAllOrderedBy_WithFilters_ReturnsFilteredSet() { new Foo() { PrimaryCode = "123", PrimaryCodeType = "x-test"}, new Foo() { PrimaryCode = "456", PrimaryCodeType = "not-x-test"} - }.AsQueryable().BuildMockDbSet(); + }.BuildMockDbSet(); var dataRequestParameters = new DataRequestParameters { Filters = new Dictionary { { "PrimaryCodeType", "x-test" } } }; var repository = GetRepository(); @@ -61,7 +61,7 @@ public async Task GetAllOrderedBy_WithNoParameters_ReturnsAll() { new Foo() { PrimaryCode = "123", PrimaryCodeType = "x-test"}, new Foo() { PrimaryCode = "456", PrimaryCodeType = "not-x-test"} - }.AsQueryable().BuildMockDbSet(); + }.BuildMockDbSet(); var repository = GetRepository(); // Act @@ -81,7 +81,7 @@ public async Task GetAllOrderedBy_WithNoSetSupplied_ReturnsSetFromDbContext() { new Foo() { PrimaryCode = "123", PrimaryCodeType = "x-test"}, new Foo() { PrimaryCode = "456", PrimaryCodeType = "not-x-test"} - }.AsQueryable().BuildMockDbSet(); + }.BuildMockDbSet(); var repository = GetRepository(dbContextSet); // Act diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/BuildingsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/BuildingsRepositoryTests.cs index 3dd3066..c2be96e 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/BuildingsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/BuildingsRepositoryTests.cs @@ -23,7 +23,7 @@ public async Task GetBuilding_WhenBuildingExists_ReturnsBuilding() .With(x => x.BuildingId, buildingId) .Without(x => x.Address) .CreateMany(1) - .AsQueryable(); + .ToList(); var db = building.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -42,7 +42,7 @@ public async Task GetBuilding_WhenBuildingDoesNotExist_ReturnsNull() { // Arrange var buildingId = _fixture.Create(); - var buildings = new List { }.AsQueryable(); + var buildings = new List(); var db = buildings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -74,7 +74,7 @@ public async Task GetAllOrderedBy_WithDataRequestParameters_ReturnsSet() .With(x => x.Address, new Address()) .With(x => x.Attributes, _fixture.Build().CreateMany(3).ToList()) .Create() - }.AsQueryable(); + }; var db = buildings.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/ComponentOfferingsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/ComponentOfferingsRepositoryTests.cs index 79f52ae..89784d2 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/ComponentOfferingsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/ComponentOfferingsRepositoryTests.cs @@ -28,7 +28,7 @@ public async Task GetComponentOffering_WhenComponentOfferingExists_ReturnsCompon .Without(x => x.Address) .Without(x => x.Costs) .Create(); - var componentOfferings = new List { componentOffering }.AsQueryable(); + var componentOfferings = new List { componentOffering }; var db = componentOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -47,7 +47,7 @@ public async Task GetComponentOffering_WhenComponentOfferingDoesNotExist_Returns { // Arrange var courseOfferingId = _fixture.Create(); - var componentOfferings = new List { }.AsQueryable(); + var componentOfferings = new List(); var db = componentOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -76,7 +76,7 @@ public async Task GetComponentOfferingByComponentId_WhenComponentOfferingsExist_ .Without(x => x.Address) .Without(x => x.Costs) .Create(); - var componentOfferings = new List { componentOffering }.AsQueryable(); + var componentOfferings = new List { componentOffering }; var db = componentOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -97,7 +97,7 @@ public async Task GetComponentOfferingByComponentId_WhenComponentOfferingsDoNotE { // Arrange var componentId = _fixture.Create(); - var componentOfferings = new List { }.AsQueryable(); + var componentOfferings = new List (); var db = componentOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/ComponentsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/ComponentsRepositoryTests.cs index 7d51c79..57ce6e2 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/ComponentsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/ComponentsRepositoryTests.cs @@ -27,7 +27,7 @@ public async Task GetComponent_WhenComponentExists_ReturnsComponent() .Without(x => x.Course) .Without(x => x.Organization) .Create(); - var components = new List { component }.AsQueryable(); + var components = new List { component }; var db = components.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -55,7 +55,7 @@ public async Task GetComponent_WhenComponentNotFound_ReturnsNull() .Without(x => x.Course) .Without(x => x.Organization) .Create(); - var components = new List { component }.AsQueryable(); + var components = new List { component }; var db = components.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -83,7 +83,7 @@ public async Task GetComponentsByCourseId_WhenComponentWithCourseIdExists_Return .Without(x => x.Course) .Without(x => x.Organization) .Create(); - var components = new List { component }.AsQueryable(); + var components = new List { component }; var db = components.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -113,7 +113,7 @@ public async Task GetComponentsByCourseId_WhenComponentWithCourseNotFound_Return .Without(x => x.Course) .Without(x => x.Organization) .Create(); - var components = new List { component }.AsQueryable(); + var components = new List { component }; var db = components.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -143,7 +143,7 @@ public async Task GetComponentsByOrganizationId_WhenComponentWithOrganizationIdE .Without(x => x.Course) .Without(x => x.Organization) .Create(); - var components = new List { component }.AsQueryable(); + var components = new List { component }; var db = components.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -173,7 +173,7 @@ public async Task GetComponentsByOrganizationId_WhenComponentWithOrganizationIdN .Without(x => x.Course) .Without(x => x.Organization) .Create(); - var components = new List { component }.AsQueryable(); + var components = new List { component }; var db = components.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/CourseOfferingsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/CourseOfferingsRepositoryTests.cs index d355ac3..890fb2f 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/CourseOfferingsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/CourseOfferingsRepositoryTests.cs @@ -28,7 +28,7 @@ public async Task GetCourseOffering_WhenCourseOfferingExists_ReturnsCourseOfferi .Without(x => x.ProgramOffering) .Without(x => x.PriceInformation) .Create(); - var courseOfferings = new List { courseOffering }.AsQueryable(); + var courseOfferings = new List { courseOffering }; var db = courseOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -57,7 +57,7 @@ public async Task GetCourseOffering_WhenCourseOfferingDoesNotFound_ReturnsNull() .Without(x => x.ProgramOffering) .Without(x => x.PriceInformation) .Create(); - var courseOfferings = new List { courseOffering }.AsQueryable(); + var courseOfferings = new List { courseOffering }; var db = courseOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -87,7 +87,7 @@ public async Task GetCourseOfferingByCourseId_WhenCourseOfferingsExist_ReturnsCo .Without(x => x.ProgramOffering) .Without(x => x.PriceInformation) .Create(); - var courseOfferings = new List { courseOffering }.AsQueryable(); + var courseOfferings = new List { courseOffering }; var db = courseOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -119,7 +119,7 @@ public async Task GetCourseOfferingByCourseId_WhenCourseOfferingsNotFound_Return .Without(x => x.ProgramOffering) .Without(x => x.PriceInformation) .Create(); - var courseOfferings = new List { courseOffering }.AsQueryable(); + var courseOfferings = new List { courseOffering }; var db = courseOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/CoursesRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/CoursesRepositoryTests.cs index 0c1c32c..0d87604 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/CoursesRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/CoursesRepositoryTests.cs @@ -30,7 +30,7 @@ public async Task GetCourse_WhenCourseExists_ReturnsCourse() .Without(x => x.CoordinatorsRef) .Without(x => x.ProgramsRef) .Create(); - var courses = new List { course }.AsQueryable(); + var courses = new List { course }; var db = courses.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -61,7 +61,7 @@ public async Task GetCourse_WhenCourseDoesNotFound_ReturnsNull() .Without(x => x.CoordinatorsRef) .Without(x => x.ProgramsRef) .Create(); - var courses = new List { course }.AsQueryable(); + var courses = new List { course }; var db = courses.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -92,7 +92,7 @@ public async Task GetCourseByEducationSpecificationId_WhenCoursesExist_ReturnsCo .Without(x => x.CoordinatorsRef) .Without(x => x.ProgramsRef) .Create(); - var courses = new List { course }.AsQueryable(); + var courses = new List { course }; var db = courses.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -125,7 +125,7 @@ public async Task GetCourseByEducationSpecificationId_WhenCoursesNotFound_Return .Without(x => x.CoordinatorsRef) .Without(x => x.ProgramsRef) .Create(); - var courses = new List { course }.AsQueryable(); + var courses = new List { course }; var db = courses.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -157,7 +157,7 @@ public async Task GetCoursesByOrganizationId_WhenCoursesExist_ReturnsCourses() .Without(x => x.CoordinatorsRef) .Without(x => x.ProgramsRef) .Create(); - var courses = new List { course }.AsQueryable(); + var courses = new List { course }; var db = courses.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -192,7 +192,7 @@ public async Task GetCoursesByOrganizationId_WhenCoursesNotFound_ReturnsEmptyLis .Without(x => x.CoordinatorsRef) .Without(x => x.ProgramsRef) .Create(); - var courses = new List { course }.AsQueryable(); + var courses = new List { course }; var db = courses.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/EducationSpecificationsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/EducationSpecificationsRepositoryTests.cs index ed362ff..9b44737 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/EducationSpecificationsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/EducationSpecificationsRepositoryTests.cs @@ -37,7 +37,7 @@ public async Task GetAllOrderedBy_WithDataRequestParameters_ReturnsSet() .Without(x => x.Children) .Without(x => x.Organization) .Create() - }.AsQueryable(); + }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -64,7 +64,7 @@ public async Task GetEducationSpecificationsByEducationSpecificationId_WhenEduca .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -94,7 +94,7 @@ public async Task GetEducationSpecificationsByEducationSpecificationId_WhenEduca .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -123,7 +123,7 @@ public async Task GetEducationSpecificationsByOrganizationId_WhenEducationSpecif .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -153,7 +153,7 @@ public async Task GetEducationSpecificationsByOrganizationId_WhenEducationSpecif .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -182,7 +182,7 @@ public async Task GetEducationSpecification_WhenEducationSpecificationExist_Retu .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -218,7 +218,7 @@ public async Task GetEducationSpecification_WhenExpandParentRequestedViaRequestP .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification, parentEducationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification, parentEducationSpecification }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -271,7 +271,7 @@ public async Task GetEducationSpecification_WhenExpandChildrenRequestedViaReques .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification, firstChildEducationSpecification, secondChildEducationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification, firstChildEducationSpecification, secondChildEducationSpecification }; var db = educationSpecifications.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -310,7 +310,7 @@ public async Task GetEducationSpecification_WhenExpandOrganizationRequestedViaRe .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List { educationSpecification }.AsQueryable(); + var educationSpecifications = new List { educationSpecification }; var organization = _fixture.Build() .With(x => x.OrganizationId, organizationId) @@ -319,7 +319,7 @@ public async Task GetEducationSpecification_WhenExpandOrganizationRequestedViaRe .Without(x => x.Parent) .Without(x => x.Children) .Create(); - var organizations = new List() { organization }.AsQueryable(); + var organizations = new List() { organization }; var db = educationSpecifications.BuildMockDbSet(); var orgDb = organizations.BuildMockDbSet(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/GroupsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/GroupsRepositoryTests.cs index 18b4c25..dc5b8de 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/GroupsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/GroupsRepositoryTests.cs @@ -23,7 +23,7 @@ public async Task GetGroup_ReturnsGroup_WhenGroupExists() .Without(x => x.Organization) .Without(x => x.Persons) .Create(); - var groups = new List { group }.AsQueryable(); + var groups = new List { group }; var db = groups.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -47,7 +47,7 @@ public async Task GetGroup_ReturnsNull_WhenGroupDoesNotFound() .Without(x => x.Organization) .Without(x => x.Persons) .Create(); - var groups = new List { group }.AsQueryable(); + var groups = new List { group }; var db = groups.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -71,7 +71,7 @@ public async Task GetGroupByOrganizationId_WhenGroupsExist_ReturnsGroups() .Without(x => x.Organization) .Without(x => x.Persons) .Create(); - var groups = new List { group }.AsQueryable(); + var groups = new List { group }; var db = groups.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -99,7 +99,7 @@ public async Task GetGroupByOrganizationId_WhenGroupsNotFound_ReturnsEmptyList() .Without(x => x.Organization) .Without(x => x.Persons) .Create(); - var groups = new List { group }.AsQueryable(); + var groups = new List { group }; var db = groups.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/NewsFeedsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/NewsFeedsRepositoryTests.cs index 7ea9603..39bbc92 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/NewsFeedsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/NewsFeedsRepositoryTests.cs @@ -22,7 +22,7 @@ public async Task GetNewsItem_WhenNewsItemExists_ReturnsNewsItem() .Without(x => x.NewsFeeds) .Without(x => x.OneOfNewsFeeds) .Create(); - var newsItems = new List { newsItem }.AsQueryable(); + var newsItems = new List { newsItem }; var db = newsItems.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -46,7 +46,7 @@ public async Task GetNewsItem_WhenNewsItemDoesNotFound_ReturnsNull() .Without(x => x.NewsFeeds) .Without(x => x.OneOfNewsFeeds) .Create(); - var newsItems = new List { newsItem }.AsQueryable(); + var newsItems = new List { newsItem }; var db = newsItems.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/NewsItemsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/NewsItemsRepositoryTests.cs index 92bcc7b..9198c9a 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/NewsItemsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/NewsItemsRepositoryTests.cs @@ -21,7 +21,7 @@ public async Task GetNewsFeed_WhenNewsFeedExists_ReturnsNewsFeed() .With(x => x.NewsFeedId, newsFeedId) .Without(x => x.NewsItems) .Create(); - var newsFeeds = new List { newsFeed }.AsQueryable(); + var newsFeeds = new List { newsFeed }; var db = newsFeeds.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -44,7 +44,7 @@ public async Task GetNewsFeed_WhenNewsFeedDoesNotFound_ReturnsNull() .With(x => x.NewsFeedId, newsFeedId) .Without(x => x.NewsItems) .Create(); - var newsFeeds = new List { newsFeed }.AsQueryable(); + var newsFeeds = new List { newsFeed }; var db = newsFeeds.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/OrganizationsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/OrganizationsRepositoryTests.cs index a10fc98..c10ef47 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/OrganizationsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/OrganizationsRepositoryTests.cs @@ -37,7 +37,7 @@ public async Task GetAllOrderedBy_WithDataRequestParameters_ReturnsSet() .Without(x => x.Parent) .Without(x => x.Children) .Create() - }.AsQueryable(); + }; var db = organizations.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -64,7 +64,7 @@ public async Task GetOrganization_WhenOrganizationExist_ReturnsOrganization() .Without(x => x.Parent) .Without(x => x.Children) .Create(); - var organizations = new List { organization }.AsQueryable(); + var organizations = new List { organization }; var db = organizations.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -100,7 +100,7 @@ public async Task GetOrganization_WhenParentRequestedViaRequestParams_ReturnsOrg .Without(x => x.Parent) .Without(x => x.Children) .Create(); - var organizations = new List { organization, parentOrganization }.AsQueryable(); + var organizations = new List { organization, parentOrganization }; var db = organizations.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -152,7 +152,7 @@ public async Task GetOrganization_WhenChildrenRequestedViaRequestParams_ReturnsO .Without(x => x.Parent) .Without(x => x.Children) .Create(); - var organizations = new List { organization, firstChildOrganization, secondChildOrganization }.AsQueryable(); + var organizations = new List { organization, firstChildOrganization, secondChildOrganization }; var db = organizations.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/PersonRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/PersonRepositoryTests.cs index fd1f7fb..6e3689f 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/PersonRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/PersonRepositoryTests.cs @@ -22,7 +22,7 @@ public async Task GetPerson_WhenPersonExists_ReturnsPerson() .Without(x => x.Address) .Without(x => x.Groups) .Create(); - var persons = new List { person }.AsQueryable(); + var persons = new List { person }; var db = persons.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -46,7 +46,7 @@ public async Task GetPerson_WhenPersonNotFound_ReturnsNull() .Without(x => x.Address) .Without(x => x.Groups) .Create(); - var persons = new List { person }.AsQueryable(); + var persons = new List { person }; var db = persons.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/ProgramOfferingsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/ProgramOfferingsRepositoryTests.cs index 38c4cce..5c5263c 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/ProgramOfferingsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/ProgramOfferingsRepositoryTests.cs @@ -14,7 +14,7 @@ public class ProgramOfferingsRepositoryTests private readonly Fixture _fixture = new Fixture(); [Test] - public async Task GetProgramOffering_WhenProgramOfferingExists_ReturnsProgramOffering() + public async Task GetProgramOffering_WhenProgramOfferingExists_ReturnsProgramOffering() { // Arrange var programOfferingId = _fixture.Create(); @@ -27,7 +27,7 @@ public async Task GetProgramOffering_WhenProgramOfferingExists_ReturnsProgramOff .Without(x => x.Program) .Without(x => x.PriceInformation) .Create(); - var programOfferings = new List { programOffering }.AsQueryable(); + var programOfferings = new List { programOffering }; var db = programOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -46,7 +46,7 @@ public async Task GetProgramOffering_WhenProgramOfferingDoesNotExist_ReturnsNull { // Arrange var programOfferingId = _fixture.Create(); - var programOfferings = new List { }.AsQueryable(); + var programOfferings = new List(); var db = programOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -74,7 +74,7 @@ public async Task GetProgramOfferingByProgramId_WhenProgramOfferingsExist_Return .Without(x => x.Program) .Without(x => x.PriceInformation) .Create(); - var programOfferings = new List { programOffering }.AsQueryable(); + var programOfferings = new List { programOffering }; var db = programOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -95,7 +95,7 @@ public async Task GetProgramOfferingByProgramId_WhenProgramOfferingsDoNotExist_R { // Arrange var programId = _fixture.Create(); - var programOfferings = new List { }.AsQueryable(); + var programOfferings = new List(); var db = programOfferings.BuildMockDbSet(); var dbContext = Substitute.For(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/ProgramsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/ProgramsRepositoryTests.cs index 18a66e6..be2bb54 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/ProgramsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/ProgramsRepositoryTests.cs @@ -52,7 +52,7 @@ public async Task GetAllOrderedBy_WithDataRequestParameters_ReturnsSet() .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create() - }.AsQueryable(); + }; var db = programs.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -111,7 +111,7 @@ public async Task GetProgramsByEducationSpecificationId_WithEducationSpecificati .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create() - }.AsQueryable(); + }; var db = programs.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -170,7 +170,7 @@ public async Task GetProgramsByOrganizationId_WithOrganizationId_ReturnsSetByOrg .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create() - }.AsQueryable(); + }; var db = programs.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -231,7 +231,7 @@ public async Task GetProgramsByProgramId_WithProgramId_ReturnsSetByProgramId() .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create() - }.AsQueryable(); + }; var db = programs.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -268,7 +268,7 @@ public async Task GetProgram_WithProgramId_ReturnsProgram() .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create(), - }.AsQueryable(); + }; var db = programs.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -314,7 +314,7 @@ public async Task GetProgram_WhenExpandParentRequestedViaRequestParameters_Retur .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create(); - var programs = new List { program, parentProgram }.AsQueryable(); + var programs = new List { program, parentProgram }; var db = programs.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -382,7 +382,7 @@ public async Task GetProgram_WhenExpandChildrenRequestedViaRequestParameters_Ret .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create(); - var programs = new List { program, firstChildProgram, secondChildProgram }.AsQueryable(); + var programs = new List { program, firstChildProgram, secondChildProgram }; var db = programs.BuildMockDbSet(); var dbContext = Substitute.For(); @@ -426,7 +426,7 @@ public async Task GetProgram_WhenExpandOrganizationRequestedViaRequestParameters .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create(); - var programs = new List { program }.AsQueryable(); + var programs = new List { program }; var organization = _fixture.Build() .With(x => x.OrganizationId, organizationId) @@ -435,7 +435,7 @@ public async Task GetProgram_WhenExpandOrganizationRequestedViaRequestParameters .Without(x => x.Parent) .Without(x => x.Children) .Create(); - var organizations = new List() { organization }.AsQueryable(); + var organizations = new List() { organization }; var db = programs.BuildMockDbSet(); var orgDb = organizations.BuildMockDbSet(); @@ -477,7 +477,7 @@ public async Task GetProgram_WhenExpandEducationSpecificationRequestedViaRequest .Without(x => x.CoordinatorsRef) .Without(x => x.Organization) .Create(); - var programs = new List { program }.AsQueryable(); + var programs = new List { program }; var educationSpecification = _fixture.Build() .With(x => x.EducationSpecificationId, educationSpecificationId) @@ -486,7 +486,7 @@ public async Task GetProgram_WhenExpandEducationSpecificationRequestedViaRequest .Without(x => x.Children) .Without(x => x.Organization) .Create(); - var educationSpecifications = new List() { educationSpecification }.AsQueryable(); + var educationSpecifications = new List() { educationSpecification }; var db = programs.BuildMockDbSet(); var eduDb = educationSpecifications.BuildMockDbSet(); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/RoomsRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/RoomsRepositoryTests.cs index 6b6fb09..9058c01 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/RoomsRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/RoomsRepositoryTests.cs @@ -1,4 +1,5 @@ using AutoFixture; +using MockQueryable; using MockQueryable.NSubstitute; using NSubstitute; using NUnit.Framework.Legacy; @@ -27,7 +28,7 @@ public async Task GetRoom_WhenRoomExists_ReturnsRoom() .Without(x => x.description) .Without(x => x.Building) .CreateMany(1) - .AsQueryable(); + .ToList(); var db = room.BuildMockDbSet(); dbContext.Rooms.Returns(db); @@ -52,7 +53,7 @@ public async Task GetRoom_WhenRoomDoesNotExist_ReturnsNull() .Without(x => x.description) .Without(x => x.Building) .CreateMany(5) - .AsQueryable(); + .ToList(); var db = rooms.BuildMockDbSet(); dbContext.Rooms.Returns(db); @@ -77,7 +78,7 @@ public async Task GetRoomsByPersonId_WhenRoomsExist_ReturnsRooms() .Without(x => x.description) .Without(x => x.Building) .CreateMany(5) - .AsQueryable(); + .ToList(); var db = rooms.BuildMockDbSet(); dbContext.Rooms.Returns(db); @@ -104,7 +105,7 @@ public async Task GetRoomsByPersonId_WhenRoomsDoNotExist_ReturnsEmptyList() .Without(x => x.description) .Without(x => x.Building) .CreateMany(5) - .AsQueryable(); + .ToList(); var db = rooms.BuildMockDbSet(); dbContext.Rooms.Returns(db); diff --git a/v5/ooapi.v5.core.UnitTests/Repositories/ServiceMetadataRepositoryTests.cs b/v5/ooapi.v5.core.UnitTests/Repositories/ServiceMetadataRepositoryTests.cs index c98dd02..94e53ff 100644 --- a/v5/ooapi.v5.core.UnitTests/Repositories/ServiceMetadataRepositoryTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Repositories/ServiceMetadataRepositoryTests.cs @@ -1,4 +1,5 @@ using AutoFixture; +using MockQueryable; using MockQueryable.NSubstitute; using NSubstitute; using ooapi.v5.core.Repositories; @@ -20,7 +21,7 @@ public async Task GetServiceMetadata_WhenServiceExists_ReturnsService() var serviceMetadataRepository = new ServiceMetadataRepository(dbContext); var services = _fixture.Build() .CreateMany(4) - .AsQueryable(); + .ToList(); var db = services.BuildMockDbSet(); dbContext.Services.Returns(db); diff --git a/v5/ooapi.v5.core.UnitTests/Security/UserRequestContextTests.cs b/v5/ooapi.v5.core.UnitTests/Security/UserRequestContextTests.cs index 194f0ad..ce14ba7 100644 --- a/v5/ooapi.v5.core.UnitTests/Security/UserRequestContextTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Security/UserRequestContextTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using Microsoft.AspNetCore.Http; using NSubstitute; using ooapi.v5.core.Security; diff --git a/v5/ooapi.v5.core.UnitTests/Services/OrganizationsServiceTests.cs b/v5/ooapi.v5.core.UnitTests/Services/OrganizationsServiceTests.cs index 2f9bfe0..362239d 100644 --- a/v5/ooapi.v5.core.UnitTests/Services/OrganizationsServiceTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Services/OrganizationsServiceTests.cs @@ -38,8 +38,9 @@ public async Task GetAll_CallsRepository() .Without(x => x.Addresses) .Without(x => x.Parent) .Without(x => x.Children) - .CreateMany(5); - var db = organizations.AsQueryable().BuildMockDbSet(); + .CreateMany(5) + .ToList(); + var db = organizations.BuildMockDbSet(); var expected = await Pagination.CreateAsync(db, dataRequestParameters); repository.GetAllOrderedByAsync(dataRequestParameters).Returns(expected); diff --git a/v5/ooapi.v5.core.UnitTests/Utility/FilterHelperTests.cs b/v5/ooapi.v5.core.UnitTests/Utility/FilterHelperTests.cs index 8f002b2..7e44472 100644 --- a/v5/ooapi.v5.core.UnitTests/Utility/FilterHelperTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Utility/FilterHelperTests.cs @@ -1,4 +1,4 @@ -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Utility; namespace ooapi.v5.core.UnitTests.Utility; diff --git a/v5/ooapi.v5.core.UnitTests/Utility/FilterTests.cs b/v5/ooapi.v5.core.UnitTests/Utility/FilterTests.cs index e451fe0..e8c67ea 100644 --- a/v5/ooapi.v5.core.UnitTests/Utility/FilterTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Utility/FilterTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Utility; namespace ooapi.v5.core.UnitTests.Utility; diff --git a/v5/ooapi.v5.core.UnitTests/Utility/FilterToLinqTests.cs b/v5/ooapi.v5.core.UnitTests/Utility/FilterToLinqTests.cs index d6ffd45..79090be 100644 --- a/v5/ooapi.v5.core.UnitTests/Utility/FilterToLinqTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Utility/FilterToLinqTests.cs @@ -1,5 +1,5 @@ using AutoFixture; -using FluentAssertions; +using AwesomeAssertions; using ooapi.v5.core.Utility; namespace ooapi.v5.core.UnitTests.Utility; diff --git a/v5/ooapi.v5.core.UnitTests/Utility/OrderedQueryableTests.cs b/v5/ooapi.v5.core.UnitTests/Utility/OrderedQueryableTests.cs index ef8127e..9e11d36 100644 --- a/v5/ooapi.v5.core.UnitTests/Utility/OrderedQueryableTests.cs +++ b/v5/ooapi.v5.core.UnitTests/Utility/OrderedQueryableTests.cs @@ -1,4 +1,4 @@ -using FluentAssertions; +using AwesomeAssertions; using Microsoft.AspNetCore.Mvc.Formatters; using ooapi.v5.Attributes; using ooapi.v5.core.Utility; diff --git a/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj b/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj index d485ab7..6fd2fa6 100644 --- a/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj +++ b/v5/ooapi.v5.core.UnitTests/ooapi.v5.core.UnitTests.csproj @@ -6,7 +6,7 @@ - + diff --git a/v5/ooapi.v5.core/Extensions/EnumerableExtensions.cs b/v5/ooapi.v5.core/Extensions/EnumerableExtensions.cs new file mode 100644 index 0000000..ce34d8b --- /dev/null +++ b/v5/ooapi.v5.core/Extensions/EnumerableExtensions.cs @@ -0,0 +1,9 @@ +namespace ooapi.v5.core.Extensions; + +public static class EnumerableExtensions +{ + public static bool IsNullOrEmpty(this IEnumerable? enumerable) + { + return enumerable == null || !enumerable.Any(); + } +} diff --git a/v5/ooapi.v5.core/Extensions/LanguageTypedPropertyExtensions.cs b/v5/ooapi.v5.core/Extensions/LanguageTypedPropertyExtensions.cs index 524f89b..dd8cc48 100644 --- a/v5/ooapi.v5.core/Extensions/LanguageTypedPropertyExtensions.cs +++ b/v5/ooapi.v5.core/Extensions/LanguageTypedPropertyExtensions.cs @@ -1,10 +1,4 @@ -using Microsoft.CodeAnalysis.CSharp.Syntax; -using ooapi.v5.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ooapi.v5.Models; namespace ooapi.v5.core.Extensions { diff --git a/v5/ooapi.v5.core/Helpers/ListOneOfConverter.cs b/v5/ooapi.v5.core/Helpers/ListOneOfConverter.cs index 5c15d56..41b1605 100644 --- a/v5/ooapi.v5.core/Helpers/ListOneOfConverter.cs +++ b/v5/ooapi.v5.core/Helpers/ListOneOfConverter.cs @@ -1,6 +1,7 @@ using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using ooapi.v5.core.Extensions; namespace ooapi.v5.Helpers; diff --git a/v5/ooapi.v5.core/Helpers/OneOfConverter.cs b/v5/ooapi.v5.core/Helpers/OneOfConverter.cs index 49c33b6..9a8e8d1 100644 --- a/v5/ooapi.v5.core/Helpers/OneOfConverter.cs +++ b/v5/ooapi.v5.core/Helpers/OneOfConverter.cs @@ -1,6 +1,7 @@ using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using ooapi.v5.core.Extensions; namespace ooapi.v5.Helpers; @@ -31,7 +32,6 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer var resultId = ""; foreach (var prop in properties) { - if (prop.Name != "Id" && !prop.Value.IsNullOrEmpty()) { jToken = prop.Value; diff --git a/v5/ooapi.v5.core/ooapi.v5.core.csproj b/v5/ooapi.v5.core/ooapi.v5.core.csproj index bf44311..0bb5689 100644 --- a/v5/ooapi.v5.core/ooapi.v5.core.csproj +++ b/v5/ooapi.v5.core/ooapi.v5.core.csproj @@ -18,8 +18,10 @@ - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/v5/ooapi.v5/ooapi.v5.csproj b/v5/ooapi.v5/ooapi.v5.csproj index 6b49ea0..c6c9c41 100644 --- a/v5/ooapi.v5/ooapi.v5.csproj +++ b/v5/ooapi.v5/ooapi.v5.csproj @@ -16,9 +16,11 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - From f023159a14c0f786c095c9fc3ab378cbf004d40d Mon Sep 17 00:00:00 2001 From: Maykel Melis Date: Mon, 15 Jun 2026 11:22:56 +0200 Subject: [PATCH 6/6] Fixed pipeline --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d25bed3..26c7872 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: run: dotnet tool install --global dotnet-coverage - name: dotnet restore - run: dotnet restore ./v5/ooapi.v5.sln + run: dotnet restore ./v5/ooapi.v5.slnx - name: dotnet build,test and sonar analyze run: | @@ -77,6 +77,6 @@ jobs: -d:sonar.exclusions="**/ooapi.v5.core/Migrations/*" \ -d:sonar.cpd.exclusions="**/ooapi.v5.core/Migrations/*, **/ooapi.v5.core/Models/*" \ -d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml - dotnet build ./v5/ooapi.v5.sln --no-restore + dotnet build ./v5/ooapi.v5.slnx --no-restore dotnet-coverage collect -s "dotnetcoverage.runsettings.xml" -f xml -o "coverage.xml" "dotnet test ./v5 --no-build" dotnet sonarscanner end -d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file