From f2732d11fdc2036c85092b59a4a78719260d2aea Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 8 Dec 2020 16:07:32 +0200 Subject: Added a bit of documentation of User class --- Models/Classes/User.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Models') diff --git a/Models/Classes/User.cs b/Models/Classes/User.cs index 2549f81..4903679 100644 --- a/Models/Classes/User.cs +++ b/Models/Classes/User.cs @@ -53,7 +53,11 @@ namespace Models.Classes } public List> Friends { get; set; } - + + /// + /// Throws an argument exception if the given value is not composed only of letters, and if specified, also of digits. + /// Does nothing otherwise. + /// private static void ValidateString(string name, int minLength, int maxLength, string value, bool canBeDigit) { if (value.Length < minLength || value.Length > maxLength) throw new ArgumentException($"{name} length cannot be less than {minLength} and more than {maxLength}."); @@ -64,6 +68,10 @@ namespace Models.Classes } } + /// + /// Throws an exception if the absolute url isn't valid. + /// Does nothing otherwise. + /// private static void ValidateURL(string urlValue) { // Throws an error is URL is invalid Uri validatedUri; -- cgit v1.2.3