From 0495dc10de6a693a74d185ca36b6d386bba06318 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Fri, 25 Oct 2024 09:43:22 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Eigenschaften=20zu=20LogInDto=20f=C3=BC?= =?UTF-8?q?r=20Validierung=20und=20Null-Pr=C3=BCfungen=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WorkFlow.API/Models/LoginDto.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WorkFlow.API/Models/LoginDto.cs b/WorkFlow.API/Models/LoginDto.cs index 05ae5fe..0d11d41 100644 --- a/WorkFlow.API/Models/LoginDto.cs +++ b/WorkFlow.API/Models/LoginDto.cs @@ -1,4 +1,9 @@ namespace WorkFlow.API.Models { - public record LogInDto(int? UserId, string? Username, string Password); + public record LogInDto(int? UserId, string? Username, string Password) + { + public bool HasUserId => UserId is not null; + public bool HasUsername => Username is not null; + public bool IsInvalid => !HasUserId && !HasUsername; + }; } \ No newline at end of file