diff --git a/IsraelHiking.Common/Category.cs b/IsraelHiking.Common/Category.cs index 81bc0a4c9..d38deef84 100644 --- a/IsraelHiking.Common/Category.cs +++ b/IsraelHiking.Common/Category.cs @@ -1,10 +1,13 @@ using System.Collections.Generic; +using System.Text.Json.Serialization; namespace IsraelHiking.Common { public class IconAndTags { + [JsonPropertyName("iconColorCategory")] public IconColorCategory IconColorCategory { get; } + [JsonPropertyName("tags")] public List> Tags { get; } public IconAndTags(IconColorCategory iconColorCategory) @@ -31,10 +34,14 @@ public IconAndTags(IconColorCategory iconColorCategory, List Items { get; set; } public Category() diff --git a/IsraelHiking.Common/DataContainer/RouteSegmentData.cs b/IsraelHiking.Common/DataContainer/RouteSegmentData.cs index dc5db42d4..046140a7a 100644 --- a/IsraelHiking.Common/DataContainer/RouteSegmentData.cs +++ b/IsraelHiking.Common/DataContainer/RouteSegmentData.cs @@ -7,7 +7,6 @@ public static class RoutingType { public const string HIKE = "Hike"; public const string BIKE = "Bike"; - public const string CAR = "Car"; public const string FOUR_WHEEL_DRIVE = "4WD"; public const string NONE = "None"; } diff --git a/IsraelHiking.Common/Extensions/GeoJsonExtensions.cs b/IsraelHiking.Common/Extensions/GeoJsonExtensions.cs index fb19209f3..c20d0a9fb 100644 --- a/IsraelHiking.Common/Extensions/GeoJsonExtensions.cs +++ b/IsraelHiking.Common/Extensions/GeoJsonExtensions.cs @@ -228,6 +228,9 @@ public static List GetStringListFromAttributeValue(object value) case object[] objectArray: titles.AddRange(objectArray.Select(o => o.ToString()).ToList()); break; + case IList objectsIList: + titles.AddRange(objectsIList.Select(o => o.ToString()).ToList()); + break; } return titles; } diff --git a/IsraelHiking.Common/FeatureProperties.cs b/IsraelHiking.Common/FeatureProperties.cs deleted file mode 100644 index 3ef2db610..000000000 --- a/IsraelHiking.Common/FeatureProperties.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace IsraelHiking.Common -{ - public class FeatureProperties - { - public string Name { get; set; } - public string Creator { get; set; } - } -} diff --git a/IsraelHiking.Common/FileExplorer/FileExplorerViewModel.cs b/IsraelHiking.Common/FileExplorer/FileExplorerViewModel.cs deleted file mode 100644 index 9c5522256..000000000 --- a/IsraelHiking.Common/FileExplorer/FileExplorerViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; - -namespace IsraelHiking.Common.FileExplorer -{ - public class FileExplorerViewModel - { - public List Entries { get; set; } - public List CurrentEntryPath { get; set; } - - public FileExplorerViewModel() - { - Entries = new List(); - CurrentEntryPath = new List(); - } - } -} \ No newline at end of file diff --git a/IsraelHiking.Common/FileExplorer/FileFormatViewModel.cs b/IsraelHiking.Common/FileExplorer/FileFormatViewModel.cs deleted file mode 100644 index e1b54ab55..000000000 --- a/IsraelHiking.Common/FileExplorer/FileFormatViewModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace IsraelHiking.Common.FileExplorer -{ - public class FileFormatViewModel - { - public string Label { get; set; } - public string OutputFormat { get; set; } - public string Extension { get; set; } - } -} diff --git a/IsraelHiking.Common/FileExplorer/FileSystemEntry.cs b/IsraelHiking.Common/FileExplorer/FileSystemEntry.cs deleted file mode 100644 index 10c7acbbc..000000000 --- a/IsraelHiking.Common/FileExplorer/FileSystemEntry.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace IsraelHiking.Common.FileExplorer -{ - public class FileSystemEntry - { - public string Link { get; set; } - public string Name { get; set; } - public long Size { get; set; } - public DateTime LastModified { get; set; } - } -} diff --git a/IsraelHiking.Common/IconColorCategory.cs b/IsraelHiking.Common/IconColorCategory.cs index 105d950e2..6f6374e62 100644 --- a/IsraelHiking.Common/IconColorCategory.cs +++ b/IsraelHiking.Common/IconColorCategory.cs @@ -1,10 +1,16 @@ -namespace IsraelHiking.Common +using System.Text.Json.Serialization; + +namespace IsraelHiking.Common { public class IconColorCategory { + [JsonPropertyName("icon")] public string Icon { get; set; } + [JsonPropertyName("category")] public string Category { get; set; } + [JsonPropertyName("color")] public string Color { get; set; } + [JsonPropertyName("label")] public string Label { get; set; } public IconColorCategory() : this(string.Empty) diff --git a/IsraelHiking.Common/Poi/Contribution.cs b/IsraelHiking.Common/Poi/Contribution.cs deleted file mode 100644 index 844672840..000000000 --- a/IsraelHiking.Common/Poi/Contribution.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace IsraelHiking.Common.Poi -{ - public class Contribution - { - public string UserName { get; set; } - public string UserAddress { get; set; } - public DateTime LastModifiedDate { get; set; } - } -} diff --git a/IsraelHiking.Common/Poi/NorthEast.cs b/IsraelHiking.Common/Poi/NorthEast.cs index fe0298c75..ecd57e2a7 100644 --- a/IsraelHiking.Common/Poi/NorthEast.cs +++ b/IsraelHiking.Common/Poi/NorthEast.cs @@ -1,4 +1,6 @@ -namespace IsraelHiking.Common.Poi +using System.Text.Json.Serialization; + +namespace IsraelHiking.Common.Poi { /// /// Return value for elevation request @@ -8,10 +10,12 @@ public class NorthEast /// /// North coordinates in meters /// + [JsonPropertyName("north")] public int North { get; set; } /// /// East coordinates in meters /// + [JsonPropertyName("east")] public int East { get; set; } } } diff --git a/IsraelHiking.Common/Poi/Reference.cs b/IsraelHiking.Common/Poi/Reference.cs index 690b4689c..e06f9d49f 100644 --- a/IsraelHiking.Common/Poi/Reference.cs +++ b/IsraelHiking.Common/Poi/Reference.cs @@ -1,8 +1,12 @@ -namespace IsraelHiking.Common.Poi +using System.Text.Json.Serialization; + +namespace IsraelHiking.Common.Poi { public class Reference { + [JsonPropertyName("url")] public string Url { get; set; } + [JsonPropertyName("sourceImageUrl")] public string SourceImageUrl { get; set; } } } diff --git a/IsraelHiking.Common/Poi/SearchResultsPointOfInterest.cs b/IsraelHiking.Common/Poi/SearchResultsPointOfInterest.cs index 5304a04bd..e56a0d6c0 100644 --- a/IsraelHiking.Common/Poi/SearchResultsPointOfInterest.cs +++ b/IsraelHiking.Common/Poi/SearchResultsPointOfInterest.cs @@ -5,7 +5,6 @@ public class SearchResultsPointOfInterest public string Id { get; set; } public string Source { get; set; } public string Title { get; set; } - public string Description { get; set; } public string DisplayName { get; set; } public string Icon { get; set; } public string IconColor { get; set; } diff --git a/IsraelHiking.Common/RebuildContext.cs b/IsraelHiking.Common/RebuildContext.cs index 0037f40c4..ac14b1e02 100644 --- a/IsraelHiking.Common/RebuildContext.cs +++ b/IsraelHiking.Common/RebuildContext.cs @@ -1,13 +1,18 @@ using IsraelHiking.Common.Api; using System; +using System.Text.Json.Serialization; namespace IsraelHiking.Common { public class RebuildContext { + [JsonPropertyName("request")] public UpdateRequest Request { get; set; } + [JsonPropertyName("startTime")] public DateTime StartTime { get; set; } + [JsonPropertyName("succeeded")] public bool Succeeded { get; set; } + [JsonPropertyName("errorMessage")] public string ErrorMessage { get; set; } } } diff --git a/IsraelHiking.DataAccess/ElasticSearchGateway.cs b/IsraelHiking.DataAccess/ElasticSearchGateway.cs index 3c1ce3e51..43b086c5a 100644 --- a/IsraelHiking.DataAccess/ElasticSearchGateway.cs +++ b/IsraelHiking.DataAccess/ElasticSearchGateway.cs @@ -169,7 +169,8 @@ public class SystemTextJsonSerializer : IElasticsearchSerializer private IList BakedInConverters { get; } = new List { {new ExceptionConverter()}, - {new DynamicDictionaryConverter()} + {new DynamicDictionaryConverter()}, + {new DateTimeConverter()} }; public SystemTextJsonSerializer(JsonConverterFactory factory)