Use C#9 features

This commit is contained in:
Tyrrrz
2020-12-14 17:36:46 +02:00
parent 90d1b11430
commit 94f63631db
13 changed files with 55 additions and 65 deletions

View File

@@ -47,9 +47,9 @@ namespace CliFx.Demo.Commands
public partial class BookAddCommand
{
private static readonly Random Random = new Random();
private static readonly Random Random = new();
private static DateTimeOffset CreateRandomDate() => new DateTimeOffset(
private static DateTimeOffset CreateRandomDate() => new(
Random.Next(1800, 2020),
Random.Next(1, 12),
Random.Next(1, 28),
@@ -58,7 +58,7 @@ namespace CliFx.Demo.Commands
Random.Next(1, 59),
TimeSpan.Zero);
private static Isbn CreateRandomIsbn() => new Isbn(
private static Isbn CreateRandomIsbn() => new(
Random.Next(0, 999),
Random.Next(0, 99),
Random.Next(0, 99999),

View File

@@ -15,6 +15,6 @@ namespace CliFx.Demo.Models
public partial class Library
{
public static Library Empty { get; } = new Library(Array.Empty<Book>());
public static Library Empty { get; } = new(Array.Empty<Book>());
}
}