-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
190 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...sregisters.IntegrationDb.Schema/Models/Views/ActiveStreetnameWithoutLinkedRoadSegments.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace Basisregisters.IntegrationDb.Schema.Models.Views | ||
{ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
public class ActiveStreetnameWithoutLinkedRoadSegments | ||
{ | ||
public int StreetNamePersistentLocalId { get; set; } | ||
public int NisCode { get; set; } | ||
public DateTime Timestamp { get; set; } | ||
|
||
|
||
public ActiveStreetnameWithoutLinkedRoadSegments() { } | ||
} | ||
|
||
public sealed class ActiveStreetnameWithoutLinkedRoadSegmentsConfiguration : IEntityTypeConfiguration<ActiveStreetnameWithoutLinkedRoadSegments> | ||
{ | ||
public void Configure(EntityTypeBuilder<ActiveStreetnameWithoutLinkedRoadSegments> builder) | ||
{ | ||
builder | ||
.ToView(nameof(ActiveStreetnameWithoutLinkedRoadSegments), IntegrationContext.Schema) | ||
.HasNoKey() | ||
.ToSqlQuery(@$" | ||
SELECT | ||
""StreetNamePersistentLocalId"", | ||
""NisCode"", | ||
""Timestamp"" | ||
FROM ""{IntegrationContext.Schema}"".""{nameof(ViewQueries.VIEW_ActiveStreetnameWithoutLinkedRoadSegments)}"" "); | ||
|
||
builder.HasIndex(x => x.StreetNamePersistentLocalId); | ||
builder.HasIndex(x => x.NisCode); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/Basisregisters.IntegrationDb.Schema/Models/Views/AddressesWithMultipleLinks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace Basisregisters.IntegrationDb.Schema.Models.Views | ||
{ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
public class AddressesWithMultipleLinks | ||
{ | ||
public int AddressPersistentLocalId { get; set; } | ||
public string Status { get; set; } | ||
public bool IsRemoved { get; set; } | ||
public int LinkedBuildingUnitCount { get; set; } | ||
public int LinkedParcelCount { get; set; } | ||
public int NisCode { get; set; } | ||
public DateTime Timestamp { get; set; } | ||
|
||
public AddressesWithMultipleLinks() { } | ||
} | ||
|
||
public sealed class AddressesWithMultipleLinksConfiguration : IEntityTypeConfiguration<AddressesWithMultipleLinks> | ||
{ | ||
public void Configure(EntityTypeBuilder<AddressesWithMultipleLinks> builder) | ||
{ | ||
builder | ||
.ToView(nameof(AddressesWithMultipleLinks), IntegrationContext.Schema) | ||
.HasNoKey() | ||
.ToSqlQuery(@$" | ||
SELECT | ||
""AddressPersistentLocalId"", | ||
""Status"", | ||
""IsRemoved"", | ||
""LinkedBuildingUnitCount"", | ||
""LinkedParcelCount"", | ||
""NisCode"", | ||
""CURRENT_TIMESTAMP AS ""Timestamp"" | ||
FROM ""{IntegrationContext.Schema}"".""{nameof(ViewQueries.VIEW_AddressesWithMultipleLinks)}"" "); | ||
|
||
builder.HasIndex(x => x.AddressPersistentLocalId); | ||
builder.HasIndex(x => x.NisCode); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Basisregisters.IntegrationDb.Schema/Models/Views/AddressesWithoutPostalCode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Basisregisters.IntegrationDb.Schema.Models.Views | ||
{ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
public class AddressesWithoutPostalCode | ||
{ | ||
public int AddressPersistentLocalId { get; set; } | ||
public int NisCode { get; set; } | ||
public DateTime Timestamp { get; set; } | ||
|
||
public AddressesWithoutPostalCode() { } | ||
} | ||
|
||
public sealed class AddressesWithoutPostalCodeConfiguration : IEntityTypeConfiguration<AddressesWithoutPostalCode> | ||
{ | ||
public void Configure(EntityTypeBuilder<AddressesWithoutPostalCode> builder) | ||
{ | ||
builder | ||
.ToView(nameof(AddressesWithoutPostalCode), IntegrationContext.Schema) | ||
.HasNoKey() | ||
.ToSqlQuery(@$" | ||
SELECT | ||
""AddressPersistentLocalId"", | ||
""NisCode"", | ||
""Timestamp"" | ||
FROM ""{IntegrationContext.Schema}"".""{nameof(ViewQueries.VIEW_AddressesWithoutPostalCode)}"" "); | ||
|
||
builder.HasIndex(x => x.AddressPersistentLocalId); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters