Skip to content

Commit b0fa4e3

Browse files
committed
Remove property nullable
1 parent 344c65b commit b0fa4e3

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/Umbraco.Cms.Integrations.Search.Algolia/Builders/ContentRecordBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public ContentRecordBuilder BuildFromContent(IContent content, Func<IProperty, b
7070
_record.Path = content.Path.Split(',').ToList();
7171
_record.ContentTypeAlias = content.ContentType.Alias;
7272
_record.Url = _urlProvider.GetUrl(content.Id);
73-
_record.GeolocationData = _algoliaGeolocationProvider.GetGeolocationAsync()?.ConfigureAwait(false).GetAwaiter().GetResult();
73+
_record.GeolocationData = _algoliaGeolocationProvider.GetGeolocationAsync().ConfigureAwait(false).GetAwaiter().GetResult();
7474
_record.Data = new();
7575

7676
if (content.PublishedCultures.Count() > 0)

src/Umbraco.Cms.Integrations.Search.Algolia/Models/Record.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class Record
77
public Record()
88
{
99
Data = new Dictionary<string, object>();
10+
GeolocationData = new List<GeolocationEntity>();
1011
}
1112

1213
public Record(Record record)
@@ -61,10 +62,8 @@ public Record(Record record)
6162

6263
public string Url { get; set; }
6364

64-
#nullable enable
6565
[JsonProperty("_geoloc")]
66-
public List<GeolocationEntity>? GeolocationData { get; set; }
67-
#nullable disable
66+
public List<GeolocationEntity> GeolocationData { get; set; }
6867

6968
public Dictionary<string, object> Data { get; set; }
7069
}

src/Umbraco.Cms.Integrations.Search.Algolia/Services/AlgoliaNullGeolocationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ namespace Umbraco.Cms.Integrations.Search.Algolia.Services
44
{
55
public class AlgoliaNullGeolocationProvider : IAlgoliaGeolocationProvider
66
{
7-
public Task<List<GeolocationEntity>> GetGeolocationAsync() => null;
7+
public async Task<List<GeolocationEntity>> GetGeolocationAsync() => null;
88
}
99
}

0 commit comments

Comments
 (0)