-
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
26 changed files
with
1,213 additions
and
26 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
21 changes: 21 additions & 0 deletions
21
CommentMap.Mvc/Data/Entities/Configurations/CountryConfiguration.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,21 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace CommentMap.Mvc.Data.Entities.Configurations; | ||
|
||
public class CountryConfiguration : IEntityTypeConfiguration<Country> | ||
{ | ||
public void Configure(EntityTypeBuilder<Country> builder) | ||
{ | ||
builder.Property(c => c.Boundaries).HasColumnType("geometry (multipolygon, 3857)"); | ||
builder.HasIndex(c => c.Boundaries).HasMethod("gist"); | ||
|
||
builder.HasKey(c => c.ISO3Code); | ||
builder.Property(c => c.ISO3Code).HasMaxLength(3).HasColumnType("char"); | ||
builder.Property(c => c.ISO2Code).HasMaxLength(2).HasColumnType("char"); | ||
|
||
builder.Property(c => c.Name).HasMaxLength(60); | ||
builder.Property(c => c.RegionName).HasMaxLength(10); | ||
builder.Property(c => c.SubregionName).HasMaxLength(40); | ||
} | ||
} |
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,17 @@ | ||
using NetTopologySuite.Geometries; | ||
|
||
namespace CommentMap.Mvc.Data.Entities; | ||
|
||
public class Country | ||
{ | ||
public required MultiPolygon Boundaries { get; set; } | ||
public required string ISO3Code { get; set; } | ||
public required string ISO2Code { get; set; } | ||
public required string Name { get; set; } | ||
public short RegionCode { get; set; } | ||
public required string RegionName { get; set; } | ||
public short SubregionCode { get; set; } | ||
public required string SubregionName { get; set; } | ||
|
||
public HashSet<Comment>? Comments { get; set; } | ||
} |
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
Oops, something went wrong.