From ca9d36e8625d916ff2a38b60cbca084e9318deb6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 8 Dec 2020 17:28:11 +0200 Subject: Replaced identation spaces with tabs in User class --- Models/Classes/User.cs | 128 ++++++++++++++++++++++++------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/Models/Classes/User.cs b/Models/Classes/User.cs index 4903679..70f9c59 100644 --- a/Models/Classes/User.cs +++ b/Models/Classes/User.cs @@ -6,76 +6,76 @@ using System.Collections.Generic; namespace Models.Classes { - [Table("Users")] + [Table("Users")] public class User : IdentityUser { - private string firstName; - private string lastName; - private string profilePicture; - - [Required] - [Range(3, 50)] - [Display(Name = "Username")] - public override string UserName { - get => base.UserName; - set { - ValidateString("Username", 3, 50, value, true); - base.UserName = value; - } - } - - [Required] - [Range(3, 30)] - public string FirstName { - get => this.firstName; - set { - ValidateString("FirstName", 3, 30, value, false); - this.firstName = value; - } - } + private string firstName; + private string lastName; + private string profilePicture; - [Required] - [Range(3, 30)] - public string LastName { - get => this.lastName; - set { - ValidateString("LastName", 3, 30, value, false); - this.lastName = value; - } - } + [Required] + [Range(3, 50)] + [Display(Name = "Username")] + public override string UserName { + get => base.UserName; + set { + ValidateString("Username", 3, 50, value, true); + base.UserName = value; + } + } + + [Required] + [Range(3, 30)] + public string FirstName { + get => this.firstName; + set { + ValidateString("FirstName", 3, 30, value, false); + this.firstName = value; + } + } + + [Required] + [Range(3, 30)] + public string LastName { + get => this.lastName; + set { + ValidateString("LastName", 3, 30, value, false); + this.lastName = value; + } + } - public string ProfilePicture { - get => this.profilePicture; - set { - ValidateURL(value); - this.profilePicture = value; - } - } + public string ProfilePicture { + get => this.profilePicture; + set { + ValidateURL(value); + this.profilePicture = value; + } + } + + public List> Friends { get; set; } - 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}."); + /// + /// 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}."); - foreach (char character in value) { // more efficient than Linq - if (!Char.IsLetter(character) || (canBeDigit && !Char.IsDigit(character))) - throw new ArgumentException($"{name} contains invalid characters."); - } - } + foreach (char character in value) { // more efficient than Linq + if (!Char.IsLetter(character) || (canBeDigit && !Char.IsDigit(character))) + throw new ArgumentException($"{name} contains invalid characters."); + } + } - /// - /// 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; - Uri.TryCreate(urlValue, UriKind.Absolute, out validatedUri); - } + /// + /// 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; + Uri.TryCreate(urlValue, UriKind.Absolute, out validatedUri); + } } } -- cgit v1.2.3