Dtos: Use collection initializer

This commit is contained in:
2024-01-29 12:13:15 +01:00
parent 116d88d3d6
commit ff3bd5cea5
3 changed files with 6 additions and 6 deletions

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Elwig.Models.Dtos { namespace Elwig.Models.Dtos {
public class DeliveryConfirmationDeliveryData : DataTable<DeliveryConfirmationDeliveryRow> { public class DeliveryConfirmationDeliveryData : DataTable<DeliveryConfirmationDeliveryRow> {
private static readonly (string, string, string?, int)[] FieldNames = new[] { private static readonly (string, string, string?, int)[] FieldNames = [
("LsNr", "LsNr.", null, 26), ("LsNr", "LsNr.", null, 26),
("DPNr", "Pos.", null, 8), ("DPNr", "Pos.", null, 8),
("Variety", "Sorte", null, 40), ("Variety", "Sorte", null, 40),
@ -17,7 +17,7 @@ namespace Elwig.Models.Dtos {
("Gradation", "Gradation", "°Oe|°KMW", 32), ("Gradation", "Gradation", "°Oe|°KMW", 32),
("Buckets", "Flächenbindung", "|kg", 36), ("Buckets", "Flächenbindung", "|kg", 36),
("Weight", "Gewicht", "kg", 16), ("Weight", "Gewicht", "kg", 16),
}; ];
private readonly int MgNr; private readonly int MgNr;

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace Elwig.Models.Dtos { namespace Elwig.Models.Dtos {
public class MemberDeliveryPerVariantData : DataTable<MemberDeliveryPerVariantRow> { public class MemberDeliveryPerVariantData : DataTable<MemberDeliveryPerVariantRow> {
private static readonly (string, string, string?, int)[] FieldNames = new[] { private static readonly (string, string, string?, int)[] FieldNames = [
("MgNr", "MgNr.", null, 12), ("MgNr", "MgNr.", null, 12),
("Name", "Name", null, 40), ("Name", "Name", null, 40),
("GivenName", "Vorname", null, 40), ("GivenName", "Vorname", null, 40),
@ -20,7 +20,7 @@ namespace Elwig.Models.Dtos {
("Weights", "Geliefert", "kg", 22), ("Weights", "Geliefert", "kg", 22),
("Areas", "Fläche", "m²", 22), ("Areas", "Fläche", "m²", 22),
("Yields", "Ertrag", "kg/ha", 22), ("Yields", "Ertrag", "kg/ha", 22),
}; ];
public MemberDeliveryPerVariantData(IEnumerable<MemberDeliveryPerVariantRow> rows, int year) : public MemberDeliveryPerVariantData(IEnumerable<MemberDeliveryPerVariantRow> rows, int year) :

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Elwig.Models.Dtos { namespace Elwig.Models.Dtos {
public class OverUnderDeliveryData : DataTable<OverUnderDeliveryRow> { public class OverUnderDeliveryData : DataTable<OverUnderDeliveryRow> {
private static readonly (string, string, string?, int)[] FieldNames = new[] { private static readonly (string, string, string?, int)[] FieldNames = [
("MgNr", "MgNr.", null, 12), ("MgNr", "MgNr.", null, 12),
("Name", "Name", null, 40), ("Name", "Name", null, 40),
("GivenName", "Vorname", null, 40), ("GivenName", "Vorname", null, 40),
@ -19,7 +19,7 @@ namespace Elwig.Models.Dtos {
("DeliveryRight", "Lieferrecht", "kg", 22), ("DeliveryRight", "Lieferrecht", "kg", 22),
("Weight", "Geliefert", "kg", 22), ("Weight", "Geliefert", "kg", 22),
("OverUnderDelivery", "Über-/Unterliefert", "kg|%", 34), ("OverUnderDelivery", "Über-/Unterliefert", "kg|%", 34),
}; ];
public OverUnderDeliveryData(IEnumerable<OverUnderDeliveryRow> rows, int year) : public OverUnderDeliveryData(IEnumerable<OverUnderDeliveryRow> rows, int year) :
base($"Über-Unterlieferungen", $"Über- und Unterlieferungen laut gezeichneten Geschäftsanteilen {year}", rows, FieldNames) { base($"Über-Unterlieferungen", $"Über- und Unterlieferungen laut gezeichneten Geschäftsanteilen {year}", rows, FieldNames) {