Drop files from .gitignore

This commit is contained in:
marco committed 2026-08-30 16:12:12 +02:00
1 parent 1b1f0f6b01
commit 84ad43af76
48 files changed
+33 -21367

No files matched your search

+30
View File
@@ -8,4 +8,34 @@ public sealed class Person
public DateOnly Birthday { get; }
private Person(String username, String realName, DateOnly birthday)
{
Username = username;
RealName = realName;
Birthday = birthday;
}
public static Person Create(String username, String realName, DateOnly birthday)
{
username = NormalizeUsername(username);
realName = realName.Trim();
// TODO: Error Handling
if (username.Length is < 3 or > 32) throw new Exception();
if (realName.Length == 0) throw new Exception();
if (birthday >= DateOnly.FromDateTime(DateTime.Today)) throw new Exception();
if (!IsAtLeast16(birthday)) throw new Exception();
return new Person(username, realName, birthday);
}
// Konstruktor zum Erzeugen von Nutzerobjekten aus der Datenbank
internal static Person FromStorage(String username, String realName, DateOnly birthday)
=> new(username, realName, birthday);
public static String NormalizeUsername(String username)
=> username.Trim().ToLowerInvariant();
public static bool IsAtLeast16(DateOnly birthday)
=> birthday.AddYears(16) <= DateOnly.FromDateTime(DateTime.Today);
}