Skip to content

Commit

Permalink
Initialize non-nullable properties
Browse files Browse the repository at this point in the history
  • Loading branch information
sabihoshi committed Oct 17, 2021
1 parent f3deb52 commit 6c10b01
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion GenshinLyreMidiPlayer.Data/Entities/History.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public History() { }

public Guid Id { get; set; }

public string Path { get; set; }
public string Path { get; set; } = null!;
}
}
6 changes: 3 additions & 3 deletions GenshinLyreMidiPlayer.Data/Git/GitVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public class GitVersion

[JsonPropertyName("prerelease")] public bool Prerelease { get; set; }

[JsonPropertyName("name")] public string Name { get; set; }
[JsonPropertyName("name")] public string Name { get; set; } = null!;

[JsonPropertyName("tag_name")] public string TagName { get; set; }
[JsonPropertyName("tag_name")] public string TagName { get; set; } = null!;

[JsonPropertyName("html_url")] public string Url { get; set; }
[JsonPropertyName("html_url")] public string Url { get; set; } = null!;

public Version Version => new(TagName.Replace("v", string.Empty));
}
Expand Down
2 changes: 1 addition & 1 deletion GenshinLyreMidiPlayer.Data/LyreContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public class LyreContext : DbContext
{
public LyreContext(DbContextOptions<LyreContext> options) : base(options) { }

public DbSet<History> History { get; set; }
public DbSet<History> History { get; set; } = null!;
}
}
2 changes: 1 addition & 1 deletion GenshinLyreMidiPlayer.Data/Midi/MidiFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public int Position
set => SetAndNotify(ref _position, value);
}

public Melanchall.DryWetMidi.Core.MidiFile Midi { get; private set; }
public Melanchall.DryWetMidi.Core.MidiFile Midi { get; private set; } = null!;

public string Path { get; }

Expand Down

0 comments on commit 6c10b01

Please sign in to comment.