aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web.Models
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-02-15 19:06:14 +0200
committertranstrike <transtrike@gmail.com>2021-02-15 19:06:14 +0200
commit4c03712af14c37718b7be5b23fcadeb86f2a2191 (patch)
tree0c6b5a592244e5b2574afa9e4919d4a3111eea34 /src/Web/DevHive.Web.Models
parent09fc4603e82f69c926f9457085aa3fa48bb3939c (diff)
downloadDevHive-4c03712af14c37718b7be5b23fcadeb86f2a2191.tar
DevHive-4c03712af14c37718b7be5b23fcadeb86f2a2191.tar.gz
DevHive-4c03712af14c37718b7be5b23fcadeb86f2a2191.zip
Code Analyzer added to all csproj; Removed unnessessary code; Fixed formatting
Diffstat (limited to 'src/Web/DevHive.Web.Models')
-rw-r--r--src/Web/DevHive.Web.Models/Attributes/GoodPasswordAttribute.cs (renamed from src/Web/DevHive.Web.Models/Attributes/GoodPasswordModelValidation.cs)5
-rw-r--r--src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs4
-rw-r--r--src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj8
-rw-r--r--src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs1
4 files changed, 8 insertions, 10 deletions
diff --git a/src/Web/DevHive.Web.Models/Attributes/GoodPasswordModelValidation.cs b/src/Web/DevHive.Web.Models/Attributes/GoodPasswordAttribute.cs
index 5ecb41a..c452499 100644
--- a/src/Web/DevHive.Web.Models/Attributes/GoodPasswordModelValidation.cs
+++ b/src/Web/DevHive.Web.Models/Attributes/GoodPasswordAttribute.cs
@@ -1,9 +1,8 @@
-using System;
using System.ComponentModel.DataAnnotations;
namespace DevHive.Web.Models.Attributes
{
- public class GoodPassword : ValidationAttribute
+ public class GoodPasswordAttribute : ValidationAttribute
{
public override bool IsValid(object value)
{
@@ -11,7 +10,7 @@ namespace DevHive.Web.Models.Attributes
for (int i = 0; i < stringValue.Length; i++)
{
- if (Char.IsDigit(stringValue[i]))
+ if (char.IsDigit(stringValue[i]))
{
base.ErrorMessage = "Password must be atleast 5 characters long!";
return stringValue.Length >= 5;
diff --git a/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs b/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs
index 0f6adb1..faaeee4 100644
--- a/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs
+++ b/src/Web/DevHive.Web.Models/Attributes/OnlyLettersModelValidation.cs
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
namespace DevHive.Web.Models.Attributes
{
- public class OnlyLetters : ValidationAttribute
+ public class OnlyLettersAttribute : ValidationAttribute
{
public override bool IsValid(object value)
{
@@ -11,7 +11,7 @@ namespace DevHive.Web.Models.Attributes
foreach (char ch in stringValue)
{
- if (!Char.IsLetter(ch))
+ if (!char.IsLetter(ch))
return false;
}
return true;
diff --git a/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj b/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj
index ca49b8c..64d0bd0 100644
--- a/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj
+++ b/src/Web/DevHive.Web.Models/DevHive.Web.Models.csproj
@@ -3,10 +3,10 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
- <ProjectReference Include="..\..\Common\DevHive.Common.Models\DevHive.Common.csproj" />
+ <ProjectReference Include="..\..\Common\DevHive.Common.Models\DevHive.Common.csproj"/>
</ItemGroup>
-
<ItemGroup>
- <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
+ <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2"/>
+ <PackageReference Include="SonarAnalyzer.CSharp" Version="8.18.0.27296"/>
</ItemGroup>
-</Project>
+</Project> \ No newline at end of file
diff --git a/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs b/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs
index 8238f47..3ae93aa 100644
--- a/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs
+++ b/src/Web/DevHive.Web.Models/Post/ReadPostWebModel.cs
@@ -21,6 +21,5 @@ namespace DevHive.Web.Models.Post
public List<IdModel> Comments { get; set; }
public List<string> FileUrls { get; set; }
- // public List<FileContentResult> Files { get; set; }
}
}