mirror of
https://github.com/morbalint/kemkas-backend.git
synced 2026-07-17 21:23:46 +00:00
fix nullable warnings (#49)
* fix nullable warnings * use collection initalizers
This commit is contained in:
@@ -4,7 +4,7 @@ public class MailgunOptions
|
|||||||
{
|
{
|
||||||
public const string Section = "Email";
|
public const string Section = "Email";
|
||||||
|
|
||||||
public string ApiKey { get; set; }
|
public string ApiKey { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string DomainName { get; set; }
|
public string DomainName { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
@@ -13,5 +13,5 @@ public class V1Felszereles
|
|||||||
public bool IsFegyver { get; set; } = true;
|
public bool IsFegyver { get; set; } = true;
|
||||||
|
|
||||||
[ForeignKey(nameof(KarakterId))]
|
[ForeignKey(nameof(KarakterId))]
|
||||||
public virtual V1Karakter Karakter { get; set; }
|
public virtual V1Karakter Karakter { get; set; } = null!;
|
||||||
}
|
}
|
||||||
@@ -35,11 +35,11 @@ public class V1Karakter
|
|||||||
public ApplicationUser? OwnerUser { get; set; }
|
public ApplicationUser? OwnerUser { get; set; }
|
||||||
|
|
||||||
[InverseProperty(nameof(V1KarakterKepzettseg.Karakter))]
|
[InverseProperty(nameof(V1KarakterKepzettseg.Karakter))]
|
||||||
public virtual IEnumerable<V1KarakterKepzettseg> KarakterKepzettsegek { get; set; }
|
public virtual IEnumerable<V1KarakterKepzettseg> KarakterKepzettsegek { get; set; } = [];
|
||||||
|
|
||||||
[InverseProperty(nameof(V1Szintlepes.Karakter))]
|
[InverseProperty(nameof(V1Szintlepes.Karakter))]
|
||||||
public virtual IEnumerable<V1Szintlepes> Szintlepesek { get; set; }
|
public virtual IEnumerable<V1Szintlepes> Szintlepesek { get; set; } = [];
|
||||||
|
|
||||||
[InverseProperty(nameof(V1Felszereles.Karakter))]
|
[InverseProperty(nameof(V1Felszereles.Karakter))]
|
||||||
public virtual IEnumerable<V1Felszereles> Felszereles { get; set; }
|
public virtual IEnumerable<V1Felszereles> Felszereles { get; set; } = [];
|
||||||
}
|
}
|
||||||
@@ -13,5 +13,5 @@ public class V1KarakterKepzettseg
|
|||||||
public bool IsTolvajKepzettseg { get; set; } = false;
|
public bool IsTolvajKepzettseg { get; set; } = false;
|
||||||
|
|
||||||
[ForeignKey(nameof(KarakterId))]
|
[ForeignKey(nameof(KarakterId))]
|
||||||
public virtual V1Karakter Karakter { get; set; }
|
public virtual V1Karakter Karakter { get; set; } = null!;
|
||||||
}
|
}
|
||||||
@@ -24,5 +24,5 @@ public class V1Szintlepes
|
|||||||
public string? FegyverSpecializacio { get; set; }
|
public string? FegyverSpecializacio { get; set; }
|
||||||
|
|
||||||
[ForeignKey(nameof(KarakterId))]
|
[ForeignKey(nameof(KarakterId))]
|
||||||
public virtual V1Karakter Karakter { get; set; }
|
public virtual V1Karakter Karakter { get; set; } = null!;
|
||||||
}
|
}
|
||||||
@@ -24,5 +24,5 @@ public class V2Felszereles
|
|||||||
public bool IsAprosag { get; set; } = false;
|
public bool IsAprosag { get; set; } = false;
|
||||||
|
|
||||||
[ForeignKey(nameof(KarakterId))]
|
[ForeignKey(nameof(KarakterId))]
|
||||||
public virtual V2Karakter Karakter { get; set; }
|
public virtual V2Karakter Karakter { get; set; } = null!;
|
||||||
}
|
}
|
||||||
@@ -40,14 +40,14 @@ public class V2Karakter
|
|||||||
public ApplicationUser? OwnerUser { get; set; }
|
public ApplicationUser? OwnerUser { get; set; }
|
||||||
|
|
||||||
[InverseProperty(nameof(V2KarakterKepzettseg.Karakter))]
|
[InverseProperty(nameof(V2KarakterKepzettseg.Karakter))]
|
||||||
public virtual IEnumerable<V2KarakterKepzettseg> KarakterKepzettsegek { get; set; }
|
public virtual IEnumerable<V2KarakterKepzettseg> KarakterKepzettsegek { get; set; } = [];
|
||||||
|
|
||||||
[InverseProperty(nameof(V2Szintlepes.Karakter))]
|
[InverseProperty(nameof(V2Szintlepes.Karakter))]
|
||||||
public virtual IEnumerable<V2Szintlepes> Szintlepesek { get; set; }
|
public virtual IEnumerable<V2Szintlepes> Szintlepesek { get; set; } = [];
|
||||||
|
|
||||||
[InverseProperty(nameof(V2Felszereles.Karakter))]
|
[InverseProperty(nameof(V2Felszereles.Karakter))]
|
||||||
public virtual IEnumerable<V2Felszereles> Felszereles { get; set; }
|
public virtual IEnumerable<V2Felszereles> Felszereles { get; set; } = [];
|
||||||
|
|
||||||
[InverseProperty(nameof(V2KarakterVarazslat.Karakter))]
|
[InverseProperty(nameof(V2KarakterVarazslat.Karakter))]
|
||||||
public virtual ISet<V2KarakterVarazslat> Varazslatok { get; set; }
|
public virtual ISet<V2KarakterVarazslat> Varazslatok { get; set; } = new HashSet<V2KarakterVarazslat>();
|
||||||
}
|
}
|
||||||
@@ -13,5 +13,5 @@ public class V2KarakterKepzettseg
|
|||||||
public bool IsTolvajKepzettseg { get; set; } = false;
|
public bool IsTolvajKepzettseg { get; set; } = false;
|
||||||
|
|
||||||
[ForeignKey(nameof(KarakterId))]
|
[ForeignKey(nameof(KarakterId))]
|
||||||
public virtual V2Karakter Karakter { get; set; }
|
public virtual V2Karakter Karakter { get; set; } = null!;
|
||||||
}
|
}
|
||||||
@@ -18,5 +18,5 @@ public class V2KarakterVarazslat
|
|||||||
public Osztaly2E Osztaly { get; set; }
|
public Osztaly2E Osztaly { get; set; }
|
||||||
|
|
||||||
[ForeignKey(nameof(KarakterId))]
|
[ForeignKey(nameof(KarakterId))]
|
||||||
public V2Karakter Karakter { get; set; }
|
public V2Karakter Karakter { get; set; } = null!;
|
||||||
}
|
}
|
||||||
@@ -25,5 +25,5 @@ public class V2Szintlepes
|
|||||||
public Kepzettseg2E? TolvajExtraKepzettseg { get; set; }
|
public Kepzettseg2E? TolvajExtraKepzettseg { get; set; }
|
||||||
|
|
||||||
[ForeignKey(nameof(KarakterId))]
|
[ForeignKey(nameof(KarakterId))]
|
||||||
public virtual V2Karakter Karakter { get; set; }
|
public virtual V2Karakter Karakter { get; set; } = null!;
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
using System.Net;
|
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Text.Unicode;
|
using System.Text.Unicode;
|
||||||
using Kemkas.Web.Config;
|
using Kemkas.Web.Config;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Kemkas.Web.Db;
|
using Kemkas.Web.Db;
|
||||||
using Kemkas.Web.Db.Models;
|
using Kemkas.Web.Db.Models;
|
||||||
using Kemkas.Web.Services.FirstEdition.Character;
|
using Kemkas.Web.Services.FirstEdition.Character;
|
||||||
@@ -12,10 +10,10 @@ using Kemkas.Web.Services.SecondEdition.Character;
|
|||||||
using Microsoft.AspNetCore.DataProtection;
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
using Microsoft.AspNetCore.HttpOverrides;
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
// using OpenTelemetry.Metrics;
|
// using OpenTelemetry.Metrics;
|
||||||
// using OpenTelemetry.Resources;
|
// using OpenTelemetry.Resources;
|
||||||
// using OpenTelemetry.Trace;
|
// using OpenTelemetry.Trace;
|
||||||
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
@@ -65,7 +63,7 @@ app.UseForwardedHeaders(new ForwardedHeadersOptions
|
|||||||
ForwardedHostHeaderName = "X-Forwarded-Host",
|
ForwardedHostHeaderName = "X-Forwarded-Host",
|
||||||
ForwardedProtoHeaderName = "X-Forwarded-Proto",
|
ForwardedProtoHeaderName = "X-Forwarded-Proto",
|
||||||
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedHost | ForwardedHeaders.XForwardedProto,
|
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedHost | ForwardedHeaders.XForwardedProto,
|
||||||
KnownNetworks = { new IPNetwork(new IPAddress([0,0,0,0]), 0) }
|
KnownIPNetworks = { System.Net.IPNetwork.Parse("0.0.0.0/0") }
|
||||||
});
|
});
|
||||||
|
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Kemkas.Web.ViewModels;
|
|||||||
public class FelszerelesIdAndCount
|
public class FelszerelesIdAndCount
|
||||||
{
|
{
|
||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public string Id { get; set; }
|
public required string Id { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("count")]
|
[JsonPropertyName("count")]
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class Karakter1eDto
|
|||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
[JsonPropertyName("name")]
|
[JsonPropertyName("name")]
|
||||||
public string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("nem")]
|
[JsonPropertyName("nem")]
|
||||||
public string? Nem { get; set; }
|
public string? Nem { get; set; }
|
||||||
@@ -16,22 +16,22 @@ public class Karakter1eDto
|
|||||||
public double? Kor { get; set; }
|
public double? Kor { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("jellem")]
|
[JsonPropertyName("jellem")]
|
||||||
public string Jellem { get; set; }
|
public required string Jellem { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("isten")]
|
[JsonPropertyName("isten")]
|
||||||
public string? Isten { get; set; }
|
public string? Isten { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("faj")]
|
[JsonPropertyName("faj")]
|
||||||
public string Faj { get; set; }
|
public required string Faj { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("osztaly")]
|
[JsonPropertyName("osztaly")]
|
||||||
public string Osztaly { get; set; }
|
public required string Osztaly { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("tulajdonsagok")]
|
[JsonPropertyName("tulajdonsagok")]
|
||||||
public KarakterTulajdonsagokDto Tulajdonsagok { get; set; }
|
public required KarakterTulajdonsagokDto Tulajdonsagok { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("kepzettsegek")]
|
[JsonPropertyName("kepzettsegek")]
|
||||||
public IList<string> Kepzettsegek { get; set; }
|
public IList<string> Kepzettsegek { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("tolvajkepzettsegek")]
|
[JsonPropertyName("tolvajkepzettsegek")]
|
||||||
public IList<string>? Tolvajkepzettsegek { get; set; }
|
public IList<string>? Tolvajkepzettsegek { get; set; }
|
||||||
@@ -40,19 +40,19 @@ public class Karakter1eDto
|
|||||||
public byte Szint { get; set; }
|
public byte Szint { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("hpRolls")]
|
[JsonPropertyName("hpRolls")]
|
||||||
public IList<byte> HpRolls { get; set; }
|
public IList<byte> HpRolls { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("tulajdonsagNovelesek")]
|
[JsonPropertyName("tulajdonsagNovelesek")]
|
||||||
public IList<string> TulajdonsagNovelesek { get; set; }
|
public IList<string> TulajdonsagNovelesek { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("harcosSpecializaciok")]
|
[JsonPropertyName("harcosSpecializaciok")]
|
||||||
public IList<string> HarcosSpecializaciok { get; set; }
|
public IList<string> HarcosSpecializaciok { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("kalozKritikus")]
|
[JsonPropertyName("kalozKritikus")]
|
||||||
public IList<string> KalozKritikus { get; set; }
|
public IList<string> KalozKritikus { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("felszereles")]
|
[JsonPropertyName("felszereles")]
|
||||||
public KarakterFelszereles1eDto Felszereles1E { get; set; }
|
public required KarakterFelszereles1eDto Felszereles1E { get; set; }
|
||||||
|
|
||||||
public bool? IsPublic { get; set; }
|
public bool? IsPublic { get; set; }
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ public class Karakter2eDto
|
|||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
[JsonPropertyName("nev")]
|
[JsonPropertyName("nev")]
|
||||||
public string Nev { get; set; }
|
public required string Nev { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("nem")]
|
[JsonPropertyName("nem")]
|
||||||
public string? Nem { get; set; }
|
public string? Nem { get; set; }
|
||||||
@@ -16,19 +16,19 @@ public class Karakter2eDto
|
|||||||
public double? Kor { get; set; }
|
public double? Kor { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("jellem")]
|
[JsonPropertyName("jellem")]
|
||||||
public string Jellem { get; set; }
|
public required string Jellem { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("isten")]
|
[JsonPropertyName("isten")]
|
||||||
public string? Isten { get; set; }
|
public string? Isten { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("faj")]
|
[JsonPropertyName("faj")]
|
||||||
public string Faj { get; set; }
|
public required string Faj { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("tulajdonsagok")]
|
[JsonPropertyName("tulajdonsagok")]
|
||||||
public KarakterTulajdonsagokDto Tulajdonsagok { get; set; }
|
public required KarakterTulajdonsagokDto Tulajdonsagok { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("kepzettsegek")]
|
[JsonPropertyName("kepzettsegek")]
|
||||||
public IList<string> Kepzettsegek { get; set; }
|
public IList<string> Kepzettsegek { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("tolvajkepzettsegek")]
|
[JsonPropertyName("tolvajkepzettsegek")]
|
||||||
public IList<string>? Tolvajkepzettsegek { get; set; }
|
public IList<string>? Tolvajkepzettsegek { get; set; }
|
||||||
@@ -37,10 +37,10 @@ public class Karakter2eDto
|
|||||||
public byte Szint { get; set; }
|
public byte Szint { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("szintlepesek")]
|
[JsonPropertyName("szintlepesek")]
|
||||||
public IList<Szintlepes> Szintlepesek { get; set; }
|
public IList<Szintlepes> Szintlepesek { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("felszereles")]
|
[JsonPropertyName("felszereles")]
|
||||||
public KarakterFelszereles2eDto Felszereles { get; set; }
|
public required KarakterFelszereles2eDto Felszereles { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("varazslatok")]
|
[JsonPropertyName("varazslatok")]
|
||||||
public IList<KarakterVarazslat2eDto>? Varazslatok { get; set; }
|
public IList<KarakterVarazslat2eDto>? Varazslatok { get; set; }
|
||||||
|
|||||||
@@ -11,5 +11,5 @@ public class KarakterFelszereles1eDto
|
|||||||
public string? PajzsId { get; set; }
|
public string? PajzsId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("fegyverIDk")]
|
[JsonPropertyName("fegyverIDk")]
|
||||||
public IList<string> FegyverIds { get; set; }
|
public IList<string> FegyverIds { get; set; } = [];
|
||||||
}
|
}
|
||||||
@@ -11,16 +11,16 @@ public class KarakterFelszereles2eDto
|
|||||||
public string? PajzsId { get; set; }
|
public string? PajzsId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("fegyverek")]
|
[JsonPropertyName("fegyverek")]
|
||||||
public IList<FelszerelesIdAndCount> Fegyverek { get; set; }
|
public IList<FelszerelesIdAndCount> Fegyverek { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("viselt")]
|
[JsonPropertyName("viselt")]
|
||||||
public IList<FelszerelesIdAndCount> Viselt { get; set; }
|
public IList<FelszerelesIdAndCount> Viselt { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("cipelt")]
|
[JsonPropertyName("cipelt")]
|
||||||
public IList<FelszerelesIdAndCount> Cipelt { get; set; }
|
public IList<FelszerelesIdAndCount> Cipelt { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("aprosagok")]
|
[JsonPropertyName("aprosagok")]
|
||||||
public IList<FelszerelesIdAndCount> Aprosagok { get; set; }
|
public IList<FelszerelesIdAndCount> Aprosagok { get; set; } = [];
|
||||||
|
|
||||||
[JsonPropertyName("at")]
|
[JsonPropertyName("at")]
|
||||||
public int AranyTaller { get; set; }
|
public int AranyTaller { get; set; }
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ namespace Kemkas.Web.ViewModels;
|
|||||||
public class KarakterVarazslat2eDto
|
public class KarakterVarazslat2eDto
|
||||||
{
|
{
|
||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public string VarazslatId { get; set; }
|
public required string VarazslatId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("bekeszitve")]
|
[JsonPropertyName("bekeszitve")]
|
||||||
public bool Bekeszitve { get; set; }
|
public bool Bekeszitve { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("osztaly")]
|
[JsonPropertyName("osztaly")]
|
||||||
public string Osztaly { get; set; }
|
public required string Osztaly { get; set; }
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ namespace Kemkas.Web.ViewModels;
|
|||||||
public class Szintlepes
|
public class Szintlepes
|
||||||
{
|
{
|
||||||
[JsonPropertyName("osztaly")]
|
[JsonPropertyName("osztaly")]
|
||||||
public string Osztaly { get; set; }
|
public required string Osztaly { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("HProll")]
|
[JsonPropertyName("HProll")]
|
||||||
public byte HProll { get; set; }
|
public byte HProll { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user