Dtos: Get rid of more warnings

This commit is contained in:
2024-02-29 16:13:46 +01:00
parent e693f83152
commit 247367d1bf
6 changed files with 27 additions and 27 deletions

View File

@ -36,7 +36,7 @@ namespace Elwig.Models.Dtos {
var elType = type?.GetElementType();
return type != null && type.IsValueType && type.Name.StartsWith("ValueTuple") ? type.GetFields().Select(f => f.FieldType) :
type != null && elType != null && type.IsArray && elType.IsValueType && elType.Name.StartsWith("ValueTuple") ? elType.GetFields().Select(f => f.FieldType) :
new Type?[] { type };
[type];
}).ToList();
ColumnSpans = ColumnTypes.Select(type => {
var elType = type?.GetElementType();
@ -44,7 +44,7 @@ namespace Elwig.Models.Dtos {
type != null && elType != null && type.IsArray && elType.IsValueType && elType.Name.StartsWith("ValueTuple") ? elType.GetFields().Length : 1;
}).ToList();
ColumnWidths = colNames.Select(c => c.Item4).ToList();
ColumnUnits = colNames.Select(c => c.Item3?.Split("|").Select(p => p.Length == 0 ? null : p).ToArray() ?? Array.Empty<string?>()).ToList();
ColumnUnits = colNames.Select(c => c.Item3?.Split("|").Select(p => p.Length == 0 ? null : p).ToArray() ?? []).ToList();
}
public DataTable(string name, string fullName, IEnumerable<T> rows, IEnumerable<(string, string, string?)>? colNames = null) :