Skip to content

Commit b4b198b

Browse files
committed
Implemented implicit types for new expressions
With C# 9.0, the `new` keyword only needs a type declaration if the type is otherwise unknown (e.g., `var`) or ambiguous (e.g., with an interface, or overloaded method). Otherwise, it can just use `new()`. This is especially useful for property initializers, which can be incredibly repetitive. Note: This apparently cannot be done for generics (e.g., `new T()` cannot become `new()`). I'll need to look into that, but for now it's useful to know that it doesn't work.
1 parent 1bafc66 commit b4b198b

File tree

50 files changed

+83
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+83
-86
lines changed

OnTopic.AspNetCore.Mvc.Tests/OnTopic.AspNetCore.Mvc.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
55
<IsPackable>false</IsPackable>
6+
<LangVersion>9.0</LangVersion>
67
</PropertyGroup>
78

89
<ItemGroup>

OnTopic.AspNetCore.Mvc.Tests/TopicControllerTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public TopicControllerTest() {
7373
RouteData = routes,
7474
ActionDescriptor = new ControllerActionDescriptor()
7575
};
76-
_context = new ControllerContext(actionContext);
76+
_context = new(actionContext);
7777

7878
}
7979

@@ -131,11 +131,11 @@ public void SitemapController_Index_ReturnsSitemapXml() {
131131

132132
var actionContext = new ActionContext {
133133
HttpContext = new DefaultHttpContext(),
134-
RouteData = new RouteData(),
134+
RouteData = new(),
135135
ActionDescriptor = new ControllerActionDescriptor()
136136
};
137137
var controller = new SitemapController(_topicRepository) {
138-
ControllerContext = new ControllerContext(actionContext)
138+
ControllerContext = new(actionContext)
139139
};
140140
var result = controller.Index() as ContentResult;
141141
var model = result.Content as string;

OnTopic.AspNetCore.Mvc.Tests/ValidateTopicAttributeTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static ActionExecutingContext GetActionExecutingContext(Controller contro
4040

4141
var actionContext = new ActionContext(
4242
new DefaultHttpContext(),
43-
new RouteData(),
43+
new(),
4444
new ControllerActionDescriptor(),
4545
modelState
4646
);
@@ -63,10 +63,10 @@ public static ActionExecutingContext GetActionExecutingContext(Controller contro
6363
/// Generates a barebones <see cref="ControllerContext"/> for testing a controller.
6464
/// </summary>
6565
public static ControllerContext GetControllerContext() =>
66-
new ControllerContext(
67-
new ActionContext() {
66+
new(
67+
new() {
6868
HttpContext = new DefaultHttpContext(),
69-
RouteData = new RouteData(),
69+
RouteData = new(),
7070
ActionDescriptor = new ControllerActionDescriptor()
7171
}
7272
);
@@ -78,7 +78,7 @@ public static ControllerContext GetControllerContext() =>
7878
/// Generates a barebones <see cref="ControllerContext"/> for testing a controller.
7979
/// </summary>
8080
public static TopicController GetTopicController(Topic topic) =>
81-
new TopicController(
81+
new(
8282
new DummyTopicRepository(),
8383
new DummyTopicMappingService()
8484
) {

OnTopic.AspNetCore.Mvc/Controllers/SitemapController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public virtual ActionResult Index(bool indent = false, bool includeMetadata = fa
146146
/// <returns>A Sitemap.org sitemap.</returns>
147147
[Obsolete("The GenerateSitemap() method should not be public. It will be marked private in OnTopic Library 5.0.")]
148148
public virtual XDocument GenerateSitemap(Topic rootTopic, bool includeMetadata = false) =>
149-
new XDocument(
149+
new(
150150
new XElement(_sitemapNamespace + "urlset",
151151
from topic in rootTopic?.Children
152152
select AddTopic(topic, includeMetadata)

OnTopic.AspNetCore.Mvc/Controllers/TopicController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public async virtual Task<IActionResult> IndexAsync(string path) {
122122
/// <returns>The created <see cref="TopicViewResult"/> object for the response.</returns>
123123
[NonAction]
124124
public virtual TopicViewResult TopicView(object model, string? viewName = null) =>
125-
new TopicViewResult(ViewData, TempData, model, CurrentTopic?.ContentType, viewName);
125+
new(ViewData, TempData, model, CurrentTopic?.ContentType, viewName);
126126

127127
} //Class
128128
} //Namespace

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public override int Save([NotNull]Topic topic, bool isRecursive = false, bool is
269269
| Attempt to resolve outstanding relationships
270270
\-----------------------------------------------------------------------------------------------------------------------*/
271271
foreach (var unresolvedTopic in unresolvedTopics) {
272-
Save(unresolvedTopic, false, isDraft, connection, new List<Topic>(), version);
272+
Save(unresolvedTopic, false, isDraft, connection, new(), version);
273273
}
274274

275275
/*------------------------------------------------------------------------------------------------------------------------

OnTopic.Tests/AttributeValueCollectionTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ public void Add_ValidAttributeValue_IsReturned() {
453453
var topic = TopicFactory.Create("Test", "Container");
454454

455455
topic.Attributes.Remove("Key");
456-
topic.Attributes.Add(new AttributeValue("Key", "NewKey", false));
456+
topic.Attributes.Add(new("Key", "NewKey", false));
457457

458458
Assert.AreEqual<string>("NewKey", topic.Key);
459459

@@ -473,7 +473,7 @@ public void Add_ValidAttributeValue_IsReturned() {
473473
public void Add_InvalidAttributeValue_ThrowsException() {
474474
var topic = TopicFactory.Create("Test", "Container");
475475
topic.Attributes.Remove("Key");
476-
topic.Attributes.Add(new AttributeValue("Key", "# ?"));
476+
topic.Attributes.Add(new("Key", "# ?"));
477477
}
478478

479479
/*==========================================================================================================================

OnTopic.Tests/BindingModels/ContentTypeDescriptorTopicBindingModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public class ContentTypeDescriptorTopicBindingModel : BasicTopicBindingModel {
2121

2222
public ContentTypeDescriptorTopicBindingModel(string? key = null) : base(key, "ContentTypeDescriptor") { }
2323

24-
public List<RelatedTopicBindingModel> ContentTypes { get; } = new List<RelatedTopicBindingModel>();
24+
public List<RelatedTopicBindingModel> ContentTypes { get; } = new();
2525

26-
public List<AttributeDescriptorTopicBindingModel> Attributes { get; } = new List<AttributeDescriptorTopicBindingModel>();
26+
public List<AttributeDescriptorTopicBindingModel> Attributes { get; } = new();
2727

2828
} //Class
2929
} //Namespace

OnTopic.Tests/BindingModels/InvalidChildrenTopicBindingModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class InvalidChildrenTopicBindingModel : BasicTopicBindingModel {
2222

2323
public InvalidChildrenTopicBindingModel(string? key = null) : base(key, "Page") { }
2424

25-
public List<BasicTopicBindingModel> Children { get; } = new List<BasicTopicBindingModel>();
25+
public List<BasicTopicBindingModel> Children { get; } = new();
2626

2727
} //Class
2828
} //Namespace

OnTopic.Tests/BindingModels/InvalidReferenceNameTopicBindingModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class InvalidReferenceNameTopicBindingModel : BasicTopicBindingModel {
2222

2323
public InvalidReferenceNameTopicBindingModel(string? key = null) : base(key, "Page") { }
2424

25-
public RelatedTopicBindingModel TopicReference { get; } = new RelatedTopicBindingModel();
25+
public RelatedTopicBindingModel TopicReference { get; } = new();
2626

2727
} //Class
2828
} //Namespace

OnTopic.Tests/BindingModels/InvalidReferenceTypeTopicBindingModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class InvalidReferenceTypeTopicBindingModel : BasicTopicBindingModel {
2525
public InvalidReferenceTypeTopicBindingModel(string? key = null) : base(key, "Page") { }
2626

2727
[AttributeKey("TopicId")]
28-
public TopicViewModel DerivedTopic { get; } = new TopicViewModel();
28+
public TopicViewModel DerivedTopic { get; } = new();
2929

3030
} //Class
3131
} //Namespace

OnTopic.Tests/BindingModels/InvalidRelationshipBaseTypeTopicBindingModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class InvalidRelationshipBaseTypeTopicBindingModel : BasicTopicBindingMod
2424

2525
public InvalidRelationshipBaseTypeTopicBindingModel(string? key = null) : base(key, "ContentTypeDescriptor") { }
2626

27-
public List<TopicViewModel> ContentTypes { get; } = new List<TopicViewModel>();
27+
public List<TopicViewModel> ContentTypes { get; } = new();
2828

2929
} //Class
3030
} //Namespace

OnTopic.Tests/BindingModels/InvalidRelationshipListTypeTopicBindingModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class InvalidRelationshipListTypeTopicBindingModel : BasicTopicBindingMod
2525

2626
public InvalidRelationshipListTypeTopicBindingModel(string? key = null) : base(key, "ContentTypeDescriptor") { }
2727

28-
public Dictionary<string, RelatedTopicBindingModel> ContentTypes { get; } = new Dictionary<string, RelatedTopicBindingModel>();
28+
public Dictionary<string, RelatedTopicBindingModel> ContentTypes { get; } = new();
2929

3030
} //Class
3131
} //Namespace

OnTopic.Tests/BindingModels/InvalidRelationshipTypeTopicBindingModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class InvalidRelationshipTypeTopicBindingModel : BasicTopicBindingModel {
2626
public InvalidRelationshipTypeTopicBindingModel(string? key = null) : base(key, "ContentTypeDescriptor") { }
2727

2828
[Relationship(RelationshipType.NestedTopics)]
29-
public List<RelatedTopicBindingModel> ContentTypes { get; } = new List<RelatedTopicBindingModel>();
29+
public List<RelatedTopicBindingModel> ContentTypes { get; } = new();
3030

3131
} //Class
3232
} //Namespace

OnTopic.Tests/BindingModels/MapToParentTopicBindingModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ namespace OnTopic.Tests.BindingModels {
1919
public class MapToParentTopicBindingModel : BasicTopicBindingModel {
2020

2121
[MapToParent(AttributePrefix="")]
22-
public ContactTopicBindingModel PrimaryContact { get; set; } = new ContactTopicBindingModel();
22+
public ContactTopicBindingModel PrimaryContact { get; set; } = new();
2323

2424
[MapToParent(AttributePrefix="Alternate")]
25-
public EmailTopicBindingModel AlternateContact { get; set; } = new EmailTopicBindingModel();
25+
public EmailTopicBindingModel AlternateContact { get; set; } = new();
2626

2727
[MapToParent]
28-
public EmailTopicBindingModel BillingContact { get; set; } = new EmailTopicBindingModel();
28+
public EmailTopicBindingModel BillingContact { get; set; } = new();
2929

3030
} //Class
3131
} //Namespace

OnTopic.Tests/ReverseTopicMappingServiceTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public async Task Map_Relationships_ReturnsMappedTopic() {
227227

228228
for (var i = 0; i < 3; i++) {
229229
bindingModel.ContentTypes.Add(
230-
new Models.RelatedTopicBindingModel() {
230+
new() {
231231
UniqueKey = contentTypes[i].GetUniqueKey()
232232
}
233233
);
@@ -290,7 +290,7 @@ public async Task Map_TopicReferences_ReturnsMappedTopic() {
290290
var mappingService = new ReverseTopicMappingService(_topicRepository);
291291

292292
var bindingModel = new ReferenceTopicBindingModel("Test") {
293-
DerivedTopic = new RelatedTopicBindingModel() {
293+
DerivedTopic = new() {
294294
UniqueKey = _topicRepository.Load("Root:Configuration:ContentTypes:Attributes:Title").GetUniqueKey()
295295
}
296296
};
@@ -394,7 +394,7 @@ public async Task Map_InvalidParentProperty_ThrowsInvalidOperationException() {
394394
var mappingService = new ReverseTopicMappingService(_topicRepository);
395395

396396
var bindingModel = new InvalidParentTopicBindingModel("Test") {
397-
Parent = new BasicTopicBindingModel("Test", "Page")
397+
Parent = new("Test", "Page")
398398
};
399399

400400
var target = await mappingService.MapAsync(bindingModel).ConfigureAwait(false);

OnTopic.Tests/TopicMappingServiceTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ public async Task Map_NullablePropertiesWithInvalidValues_ReturnsValues() {
236236
Assert.AreEqual<int?>(43, target.NullableInteger);
237237
Assert.AreEqual<double?>(3.14159265359, target.NullableDouble);
238238
Assert.AreEqual<bool?>(true, target.NullableBoolean);
239-
Assert.AreEqual<DateTime?>(new DateTime(1976, 10, 15), target.NullableDateTime);
240-
Assert.AreEqual<Uri?>(new Uri("/Web/Path/File?Query=String", UriKind.RelativeOrAbsolute), target.NullableUrl);
239+
Assert.AreEqual<DateTime?>(new(1976, 10, 15), target.NullableDateTime);
240+
Assert.AreEqual<Uri?>(new("/Web/Path/File?Query=String", UriKind.RelativeOrAbsolute), target.NullableUrl);
241241

242242
Assert.AreEqual<string?>(topic.Title, target.Title);
243243
Assert.AreEqual<bool?>(target.IsHidden, target.IsHidden);
@@ -676,7 +676,7 @@ public async Task Map_CompatibleProperties_MapObjectReference() {
676676

677677
var topic = (TextAttribute)TopicFactory.Create("Attribute", "TextAttribute");
678678

679-
topic.VersionHistory.Add(new DateTime(1976, 10, 15, 9, 30, 00));
679+
topic.VersionHistory.Add(new(1976, 10, 15, 9, 30, 00));
680680

681681
var target = await _mappingService.MapAsync<CompatiblePropertyTopicViewModel>(topic).ConfigureAwait(false);
682682

OnTopic.Tests/TypeMemberInfoCollectionTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ public void SetPropertyValue_DateTime_SetsValue() {
213213
);
214214

215215
Assert.IsTrue(isDateSet);
216-
Assert.AreEqual<DateTime>(new DateTime(2008, 6, 3), topic.LastModified);
217-
Assert.AreEqual<DateTime>(new DateTime(2008, 6, 3), lastModified);
216+
Assert.AreEqual<DateTime>(new(2008, 6, 3), topic.LastModified);
217+
Assert.AreEqual<DateTime>(new(2008, 6, 3), lastModified);
218218

219219
}
220220

OnTopic.Tests/ViewModels/AmbiguousRelationTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace OnTopic.Tests.ViewModels {
2828
public class AmbiguousRelationTopicViewModel: KeyOnlyTopicViewModel {
2929

3030
[Relationship("AmbiguousRelationship", Type=RelationshipType.IncomingRelationship)]
31-
public List<KeyOnlyTopicViewModel> RelationshipAlias { get; } = new List<KeyOnlyTopicViewModel>();
31+
public List<KeyOnlyTopicViewModel> RelationshipAlias { get; } = new();
3232

3333
} //Class
3434
} //Namespace

OnTopic.Tests/ViewModels/CircularTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class CircularTopicViewModel {
2323
public CircularTopicViewModel? Parent { get; set; }
2424

2525
[Follow(Relationships.Children | Relationships.Parents)]
26-
public List<CircularTopicViewModel> Children { get; } = new List<CircularTopicViewModel>();
26+
public List<CircularTopicViewModel> Children { get; } = new();
2727

2828
} //Class
2929
} //Namespace

OnTopic.Tests/ViewModels/DescendentTopicViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ namespace OnTopic.Tests.ViewModels {
2626
public class DescendentTopicViewModel: TopicViewModel {
2727

2828
[Follow(Relationships.Children)]
29-
public TopicViewModelCollection<DescendentTopicViewModel> Children { get; }
30-
= new TopicViewModelCollection<DescendentTopicViewModel>();
29+
public TopicViewModelCollection<DescendentTopicViewModel> Children { get; } = new();
3130

3231
} //Class
3332
} //Namespace

OnTopic.Tests/ViewModels/FilteredTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class FilteredTopicViewModel {
2222

2323
[FilterByAttribute("ContentType", "Page")]
2424
[FilterByAttribute("SomeAttribute", "ValueA")]
25-
public TopicViewModelCollection<TopicViewModel> Children { get; } = new TopicViewModelCollection<TopicViewModel>();
25+
public TopicViewModelCollection<TopicViewModel> Children { get; } = new();
2626

2727
} //Class
2828
} //Namespace

OnTopic.Tests/ViewModels/FlattenChildrenTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace OnTopic.Tests.ViewModels {
2121
public class FlattenChildrenTopicViewModel {
2222

2323
[Flatten]
24-
public List<FlattenChildrenTopicViewModel> Children { get; } = new List<FlattenChildrenTopicViewModel>();
24+
public List<FlattenChildrenTopicViewModel> Children { get; } = new();
2525

2626
} //Class
2727
} //Namespace

OnTopic.Tests/ViewModels/MapToParentTopicViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ namespace OnTopic.Tests.ViewModels {
1919
public class MapToParentTopicViewModel {
2020

2121
[MapToParent(AttributePrefix = "")]
22-
public KeyOnlyTopicViewModel? Primary { get; set; } = new KeyOnlyTopicViewModel();
22+
public KeyOnlyTopicViewModel? Primary { get; set; } = new();
2323

2424
[MapToParent(AttributePrefix = "Aliased")]
25-
public KeyOnlyTopicViewModel? Alternate { get; set; } = new KeyOnlyTopicViewModel();
25+
public KeyOnlyTopicViewModel? Alternate { get; set; } = new();
2626

2727
[MapToParent]
28-
public KeyOnlyTopicViewModel? Ancillary { get; set; } = new KeyOnlyTopicViewModel();
28+
public KeyOnlyTopicViewModel? Ancillary { get; set; } = new();
2929

3030
} //Class
3131
} //Namespace

OnTopic.Tests/ViewModels/Metadata/ContentTypeDescriptorTopicViewModel.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ namespace OnTopic.Tests.ViewModels.Metadata {
2020
/// </remarks>
2121
public class ContentTypeDescriptorTopicViewModel {
2222

23-
public List<AttributeDescriptorTopicViewModel> AttributeDescriptors
24-
{ get; } = new List<AttributeDescriptorTopicViewModel>();
23+
public List<AttributeDescriptorTopicViewModel> AttributeDescriptors { get; } = new();
2524

2625
[Relationship(RelationshipType.MappedCollection)]
2726
[Follow(Relationships.None)]
28-
public List<ContentTypeDescriptorTopicViewModel> PermittedContentTypes
29-
{ get; } = new List<ContentTypeDescriptorTopicViewModel>();
27+
public List<ContentTypeDescriptorTopicViewModel> PermittedContentTypes { get; } = new();
3028

3129
} //Class
3230
} //Namespace

OnTopic.Tests/ViewModels/MetadataLookupTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace OnTopic.Tests.ViewModels {
2020
public class MetadataLookupTopicViewModel {
2121

2222
[Metadata("Categories")]
23-
public TopicViewModelCollection<TopicViewModel> Categories { get; } = new TopicViewModelCollection<TopicViewModel>();
23+
public TopicViewModelCollection<TopicViewModel> Categories { get; } = new();
2424

2525
} //Class
2626
} //Namespace

OnTopic.Tests/ViewModels/NestedTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace OnTopic.Tests.ViewModels {
1818
/// </remarks>
1919
public class NestedTopicViewModel {
2020

21-
public List<KeyOnlyTopicViewModel> Categories { get; } = new List<KeyOnlyTopicViewModel>();
21+
public List<KeyOnlyTopicViewModel> Categories { get; } = new();
2222

2323
} //Class
2424
} //Namespace

OnTopic.Tests/ViewModels/RelatedEntityTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace OnTopic.Tests.ViewModels {
2525
/// </remarks>
2626
public class RelatedEntityTopicViewModel: KeyOnlyTopicViewModel {
2727

28-
public Collection<Topic> RelatedTopics { get; } = new Collection<Topic>();
28+
public Collection<Topic> RelatedTopics { get; } = new();
2929

3030
} //Class
3131
} //Namespace

OnTopic.Tests/ViewModels/RelationTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace OnTopic.Tests.ViewModels {
2626
public class RelationTopicViewModel: KeyOnlyTopicViewModel {
2727

2828
[Follow(Relationships.Children)]
29-
public List<RelationTopicViewModel> Cousins { get; } = new List<RelationTopicViewModel>();
29+
public List<RelationTopicViewModel> Cousins { get; } = new();
3030

3131
} //Class
3232
} //Namespace

OnTopic.Tests/ViewModels/RelationWithChildrenTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace OnTopic.Tests.ViewModels {
2626
public class RelationWithChildrenTopicViewModel: RelationTopicViewModel {
2727

2828
[Follow(Relationships.Relationships)]
29-
public List<RelationWithChildrenTopicViewModel> Children { get; } = new List<RelationWithChildrenTopicViewModel>();
29+
public List<RelationWithChildrenTopicViewModel> Children { get; } = new();
3030

3131
} //Class
3232
} //Namespace

0 commit comments

Comments
 (0)