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 From dbc382f9ea7afa5a7db4adc94b466c47f6b0deb0 Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 8 Dec 2020 17:44:20 +0200 Subject: git instuctions added --- API/API.code-workspace | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 API/API.code-workspace diff --git a/API/API.code-workspace b/API/API.code-workspace deleted file mode 100644 index 875e3c8..0000000 --- a/API/API.code-workspace +++ /dev/null @@ -1,19 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": { - "files.exclude": { - "**/.vscode": true, - "**/bin": true, - "**/obj": true, - ".gitignore" : true, - "**/README.md" : true, - "**/LICENSE" : true, - "**/Properties" : true, - "**/*.code-workspace" : true - } - } -} \ No newline at end of file -- cgit v1.2.3 From c61d3c8cfaa6ec9143eb752efffbc7df0940bf75 Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 8 Dec 2020 17:45:52 +0200 Subject: git instuctions added --- DevHive.code-workspace | 6 +++++- Web/Web.code-workspace | 19 ------------------- git.md | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 20 deletions(-) delete mode 100644 Web/Web.code-workspace create mode 100644 git.md diff --git a/DevHive.code-workspace b/DevHive.code-workspace index 5679111..e3e0ab6 100644 --- a/DevHive.code-workspace +++ b/DevHive.code-workspace @@ -7,7 +7,11 @@ { "name": "Web", "path": "./Web" - } + }, + { + "name": "DevHive", + "path": "." + } ], "settings": { "files.exclude": { diff --git a/Web/Web.code-workspace b/Web/Web.code-workspace deleted file mode 100644 index 875e3c8..0000000 --- a/Web/Web.code-workspace +++ /dev/null @@ -1,19 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": { - "files.exclude": { - "**/.vscode": true, - "**/bin": true, - "**/obj": true, - ".gitignore" : true, - "**/README.md" : true, - "**/LICENSE" : true, - "**/Properties" : true, - "**/*.code-workspace" : true - } - } -} \ No newline at end of file diff --git a/git.md b/git.md new file mode 100644 index 0000000..1adec79 --- /dev/null +++ b/git.md @@ -0,0 +1,37 @@ +# Git commands with instructions + +## git clone *url* + +Clones a GitHub repository in the current directory, in a folder, the name of which is the repo's name + +## git branch *option* *branch* + +git branch - View a list of the branches + +## git checkout *option* *branch* + +git checkout *branch_name* - Switch to exiting branch +git checkout -b *branch_name* - Create a new branch + +## git fetch + +git fetch - Downloads commits, files and references from remote repo to local repo + Fetching is what you do when you want to see what everybody else has been working on. + Doesn't force a merge + +## git pull *option* + +git pull - Fetches changes and immediately merges them to local repo + Combo of git fetch & git merge +git pull --rebase - "I want to put my changes on top of what everybody else has done in this branch." +git pull --rebase origin - This simply moves your local changes onto the top of what everybody else has already contributed. + +## git add *files* + +git add . - Add all files to track the changes made to them +git add *filename* - Add file with name *filename* to track the changes made to it + +## git commit *options* + +git commit - Opens a editor to write a message, documenting the changes made +git commit -m *Message* - Write the message inline, documenting the changes made -- cgit v1.2.3