-
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
8 changed files
with
136 additions
and
16 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
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); | ||
} | ||
} | ||
} |
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
src/Basisregisters.IntegrationDb.Schema/Models/Views/StreetnameWithoutLinkedRoadSegments.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 StreetnameWithoutLinkedRoadSegments | ||
{ | ||
public int StreetNamePersistentLocalId { get; set; } | ||
public int NisCode { get; set; } | ||
public DateTime Timestamp { get; set; } | ||
|
||
|
||
public StreetnameWithoutLinkedRoadSegments() { } | ||
} | ||
|
||
public sealed class StreetnameWithoutLinkedRoadSegmentsConfiguration : IEntityTypeConfiguration<StreetnameWithoutLinkedRoadSegments> | ||
{ | ||
public void Configure(EntityTypeBuilder<StreetnameWithoutLinkedRoadSegments> builder) | ||
{ | ||
builder | ||
.ToView(nameof(StreetnameWithoutLinkedRoadSegments), IntegrationContext.Schema) | ||
.HasNoKey() | ||
.ToSqlQuery(@$" | ||
select | ||
""StreetNamePersistentLocalId"", | ||
""NisCode"", | ||
""Timestamp"" | ||
FROM ""{IntegrationContext.Schema}"".""{nameof(ViewQueries.VIEW_StreetnameWithoutLinkedRoadSegments)}"" "); | ||
|
||
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