aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-30 18:09:01 +0800
committercrupest <crupest@outlook.com>2021-04-30 18:09:01 +0800
commitc2998e5833da46bbe5539bb4ce49fb3f10867a1d (patch)
tree334db84212be85520fd4d1b5a7c17595c78b8318
parente536121d97610af09d6bf4a51a875b0f7d50f702 (diff)
downloadtimeline-c2998e5833da46bbe5539bb4ce49fb3f10867a1d.tar.gz
timeline-c2998e5833da46bbe5539bb4ce49fb3f10867a1d.tar.bz2
timeline-c2998e5833da46bbe5539bb4ce49fb3f10867a1d.zip
refactor: ...
-rw-r--r--BackEnd/Timeline.Tests/UsernameValidatorUnitTest.cs3
-rw-r--r--BackEnd/Timeline/Models/Validation/NameValidator.cs9
-rw-r--r--BackEnd/Timeline/Models/Validation/NicknameValidator.cs3
-rw-r--r--BackEnd/Timeline/Models/Validation/Resource.Designer.cs (renamed from BackEnd/Timeline/Resources/Models/Validation/Validator.Designer.cs)83
-rw-r--r--BackEnd/Timeline/Models/Validation/Resource.resx (renamed from BackEnd/Timeline/Resources/Models/Validation/Validator.resx)35
-rw-r--r--BackEnd/Timeline/Models/Validation/Validator.cs11
-rw-r--r--BackEnd/Timeline/Resources/Helper/DataCacheHelper.Designer.cs90
-rw-r--r--BackEnd/Timeline/Resources/Helper/DataCacheHelper.resx129
-rw-r--r--BackEnd/Timeline/Resources/Models/Validation/NameValidator.Designer.cs99
-rw-r--r--BackEnd/Timeline/Resources/Models/Validation/NameValidator.resx132
-rw-r--r--BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.Designer.cs72
-rw-r--r--BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.resx123
-rw-r--r--BackEnd/Timeline/Timeline.csproj41
13 files changed, 107 insertions, 723 deletions
diff --git a/BackEnd/Timeline.Tests/UsernameValidatorUnitTest.cs b/BackEnd/Timeline.Tests/UsernameValidatorUnitTest.cs
index 7022b311..9e845641 100644
--- a/BackEnd/Timeline.Tests/UsernameValidatorUnitTest.cs
+++ b/BackEnd/Timeline.Tests/UsernameValidatorUnitTest.cs
@@ -41,8 +41,7 @@ namespace Timeline.Tests
[InlineData("ab c!")] // This is a chinese ! .
public void BadCharactor(string value)
{
- FailAndMessage(value).Should().ContainEquivalentOf("invalid")
- .And.ContainEquivalentOf("character");
+ FailAndMessage(value).Should().ContainEquivalentOf("only consists of");
}
[Fact]
diff --git a/BackEnd/Timeline/Models/Validation/NameValidator.cs b/BackEnd/Timeline/Models/Validation/NameValidator.cs
index b74c40b7..2220de6f 100644
--- a/BackEnd/Timeline/Models/Validation/NameValidator.cs
+++ b/BackEnd/Timeline/Models/Validation/NameValidator.cs
@@ -1,6 +1,5 @@
using System.Linq;
using System.Text.RegularExpressions;
-using static Timeline.Resources.Models.Validation.NameValidator;
namespace Timeline.Models.Validation
{
@@ -14,26 +13,26 @@ namespace Timeline.Models.Validation
{
if (value.Length == 0)
{
- return (false, MessageEmptyString);
+ return (false, Resource.NameCantBeEmpty);
}
if (value.Length > MaxLength)
{
- return (false, MessageTooLong);
+ return (false, string.Format(Resource.NameCantBeLongerThan, MaxLength));
}
foreach ((char c, int i) in value.Select((c, i) => (c, i)))
{
if (!(char.IsLetterOrDigit(c) || c == '-' || c == '_'))
{
- return (false, MessageInvalidChar);
+ return (false, Resource.NameInvalidChar);
}
}
// Currently name can't be longer than 26. So this is not needed. But reserve it for future use.
if (UniqueIdRegex.IsMatch(value))
{
- return (false, MessageUnqiueId);
+ return (false, Resource.NameCantBeUniqueIdPattern);
}
return (true, GetSuccessMessage());
diff --git a/BackEnd/Timeline/Models/Validation/NicknameValidator.cs b/BackEnd/Timeline/Models/Validation/NicknameValidator.cs
index 1d6ab163..43365dce 100644
--- a/BackEnd/Timeline/Models/Validation/NicknameValidator.cs
+++ b/BackEnd/Timeline/Models/Validation/NicknameValidator.cs
@@ -1,5 +1,4 @@
using System;
-using static Timeline.Resources.Models.Validation.NicknameValidator;
namespace Timeline.Models.Validation
{
@@ -8,7 +7,7 @@ namespace Timeline.Models.Validation
protected override (bool, string) DoValidate(string value)
{
if (value.Length > 25)
- return (false, MessageTooLong);
+ return (false, Resource.NicknameTooLong);
return (true, GetSuccessMessage());
}
diff --git a/BackEnd/Timeline/Resources/Models/Validation/Validator.Designer.cs b/BackEnd/Timeline/Models/Validation/Resource.Designer.cs
index 74d4c169..47ad4248 100644
--- a/BackEnd/Timeline/Resources/Models/Validation/Validator.Designer.cs
+++ b/BackEnd/Timeline/Models/Validation/Resource.Designer.cs
@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
-namespace Timeline.Resources.Models.Validation {
+namespace Timeline.Models.Validation {
using System;
@@ -22,14 +22,14 @@ namespace Timeline.Resources.Models.Validation {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Validator {
+ internal class Resource {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Validator() {
+ internal Resource() {
}
/// <summary>
@@ -39,7 +39,7 @@ namespace Timeline.Resources.Models.Validation {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Models.Validation.Validator", typeof(Validator).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Models.Validation.Resource", typeof(Resource).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -61,47 +61,92 @@ namespace Timeline.Resources.Models.Validation {
}
/// <summary>
- /// Looks up a localized string similar to Failed to create a validator instance from default constructor. See inner exception..
+ /// Looks up a localized string similar to it can&apos;t be null.
/// </summary>
- internal static string ValidateWithAttributeExceptionCreateFail {
+ internal static string CantBeNull {
get {
- return ResourceManager.GetString("ValidateWithAttributeExceptionCreateFail", resourceCulture);
+ return ResourceManager.GetString("CantBeNull", resourceCulture);
}
}
/// <summary>
- /// Looks up a localized string similar to Given type is not assignable to IValidator..
+ /// Looks up a localized string similar to name can&apos;t be empty.
/// </summary>
- internal static string ValidateWithAttributeExceptionNotValidator {
+ internal static string NameCantBeEmpty {
get {
- return ResourceManager.GetString("ValidateWithAttributeExceptionNotValidator", resourceCulture);
+ return ResourceManager.GetString("NameCantBeEmpty", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to name can&apos;t be longer than {0}.
+ /// </summary>
+ internal static string NameCantBeLongerThan {
+ get {
+ return ResourceManager.GetString("NameCantBeLongerThan", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to name can&apos;t has the same pattern of unique id.
+ /// </summary>
+ internal static string NameCantBeUniqueIdPattern {
+ get {
+ return ResourceManager.GetString("NameCantBeUniqueIdPattern", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to name can only consists of alphabet, number, &apos;_&apos; and &apos;-&apos; .
+ /// </summary>
+ internal static string NameInvalidChar {
+ get {
+ return ResourceManager.GetString("NameInvalidChar", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to nickname can&apos;t be longer than 25.
+ /// </summary>
+ internal static string NicknameTooLong {
+ get {
+ return ResourceManager.GetString("NicknameTooLong", resourceCulture);
}
}
/// <summary>
- /// Looks up a localized string similar to Value is not of type {0}..
+ /// Looks up a localized string similar to it is not of type {0}.
/// </summary>
- internal static string ValidatorMessageBadType {
+ internal static string NotOfType {
get {
- return ResourceManager.GetString("ValidatorMessageBadType", resourceCulture);
+ return ResourceManager.GetString("NotOfType", resourceCulture);
}
}
/// <summary>
- /// Looks up a localized string similar to Value can&apos;t be null..
+ /// Looks up a localized string similar to Failed to create validator instance..
/// </summary>
- internal static string ValidatorMessageNull {
+ internal static string ValidateWithAttributeExceptionCreateFail {
get {
- return ResourceManager.GetString("ValidatorMessageNull", resourceCulture);
+ return ResourceManager.GetString("ValidateWithAttributeExceptionCreateFail", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Given type is not a IValidator instance..
+ /// </summary>
+ internal static string ValidateWithAttributeExceptionNotValidator {
+ get {
+ return ResourceManager.GetString("ValidateWithAttributeExceptionNotValidator", resourceCulture);
}
}
/// <summary>
- /// Looks up a localized string similar to Validation succeeded..
+ /// Looks up a localized string similar to validation passed.
/// </summary>
- internal static string ValidatorMessageSuccess {
+ internal static string ValidationPassed {
get {
- return ResourceManager.GetString("ValidatorMessageSuccess", resourceCulture);
+ return ResourceManager.GetString("ValidationPassed", resourceCulture);
}
}
}
diff --git a/BackEnd/Timeline/Resources/Models/Validation/Validator.resx b/BackEnd/Timeline/Models/Validation/Resource.resx
index 8317e3eb..68ba3810 100644
--- a/BackEnd/Timeline/Resources/Models/Validation/Validator.resx
+++ b/BackEnd/Timeline/Models/Validation/Resource.resx
@@ -117,19 +117,34 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <data name="ValidateWithAttributeExceptionCreateFail" xml:space="preserve">
- <value>Failed to create a validator instance from default constructor. See inner exception.</value>
+ <data name="CantBeNull" xml:space="preserve">
+ <value>it can't be null</value>
</data>
- <data name="ValidateWithAttributeExceptionNotValidator" xml:space="preserve">
- <value>Given type is not assignable to IValidator.</value>
+ <data name="NameCantBeEmpty" xml:space="preserve">
+ <value>name can't be empty</value>
+ </data>
+ <data name="NameCantBeLongerThan" xml:space="preserve">
+ <value>name can't be longer than {0}</value>
+ </data>
+ <data name="NameCantBeUniqueIdPattern" xml:space="preserve">
+ <value>name can't has the same pattern of unique id</value>
+ </data>
+ <data name="NameInvalidChar" xml:space="preserve">
+ <value>name can only consists of alphabet, number, '_' and '-' </value>
</data>
- <data name="ValidatorMessageBadType" xml:space="preserve">
- <value>Value is not of type {0}.</value>
+ <data name="NicknameTooLong" xml:space="preserve">
+ <value>nickname can't be longer than 25</value>
</data>
- <data name="ValidatorMessageNull" xml:space="preserve">
- <value>Value can't be null.</value>
+ <data name="NotOfType" xml:space="preserve">
+ <value>it is not of type {0}</value>
+ </data>
+ <data name="ValidateWithAttributeExceptionCreateFail" xml:space="preserve">
+ <value>Failed to create validator instance.</value>
+ </data>
+ <data name="ValidateWithAttributeExceptionNotValidator" xml:space="preserve">
+ <value>Given type is not a IValidator instance.</value>
</data>
- <data name="ValidatorMessageSuccess" xml:space="preserve">
- <value>Validation succeeded.</value>
+ <data name="ValidationPassed" xml:space="preserve">
+ <value>validation passed</value>
</data>
</root> \ No newline at end of file
diff --git a/BackEnd/Timeline/Models/Validation/Validator.cs b/BackEnd/Timeline/Models/Validation/Validator.cs
index ec6cc0af..d334960e 100644
--- a/BackEnd/Timeline/Models/Validation/Validator.cs
+++ b/BackEnd/Timeline/Models/Validation/Validator.cs
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel.DataAnnotations;
-using static Timeline.Resources.Models.Validation.Validator;
namespace Timeline.Models.Validation
{
@@ -56,7 +55,7 @@ namespace Timeline.Models.Validation
if (PermitNull)
return (true, GetSuccessMessage());
else
- return (false, ValidatorMessageNull);
+ return (false, Resource.CantBeNull);
}
if (value is T v)
@@ -65,11 +64,11 @@ namespace Timeline.Models.Validation
}
else
{
- return (false, ValidatorMessageBadType);
+ return (false, string.Format(Resource.NotOfType, typeof(T).Name));
}
}
- protected static string GetSuccessMessage() => ValidatorMessageSuccess;
+ protected static string GetSuccessMessage() => Resource.ValidationPassed;
protected abstract (bool, string) DoValidate(T value);
}
@@ -99,7 +98,7 @@ namespace Timeline.Models.Validation
throw new ArgumentNullException(nameof(validatorType));
if (!typeof(IValidator).IsAssignableFrom(validatorType))
- throw new ArgumentException(ValidateWithAttributeExceptionNotValidator, nameof(validatorType));
+ throw new ArgumentException(Resource.ValidateWithAttributeExceptionNotValidator, nameof(validatorType));
try
{
@@ -107,7 +106,7 @@ namespace Timeline.Models.Validation
}
catch (Exception e)
{
- throw new ArgumentException(ValidateWithAttributeExceptionCreateFail, e);
+ throw new ArgumentException(Resource.ValidateWithAttributeExceptionCreateFail, e);
}
}
diff --git a/BackEnd/Timeline/Resources/Helper/DataCacheHelper.Designer.cs b/BackEnd/Timeline/Resources/Helper/DataCacheHelper.Designer.cs
deleted file mode 100644
index acf56d13..00000000
--- a/BackEnd/Timeline/Resources/Helper/DataCacheHelper.Designer.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Helper {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class DataCacheHelper {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal DataCacheHelper() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Helper.DataCacheHelper", typeof(DataCacheHelper).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Header If-None-Match is of bad format..
- /// </summary>
- internal static string LogBadIfNoneMatch {
- get {
- return ResourceManager.GetString("LogBadIfNoneMatch", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Cache is invalid and data is returned..
- /// </summary>
- internal static string LogResultData {
- get {
- return ResourceManager.GetString("LogResultData", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Cache is valid and 304 Not Modified is returned..
- /// </summary>
- internal static string LogResultNotModified {
- get {
- return ResourceManager.GetString("LogResultNotModified", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Helper/DataCacheHelper.resx b/BackEnd/Timeline/Resources/Helper/DataCacheHelper.resx
deleted file mode 100644
index 515cfa9b..00000000
--- a/BackEnd/Timeline/Resources/Helper/DataCacheHelper.resx
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="LogBadIfNoneMatch" xml:space="preserve">
- <value>Header If-None-Match is of bad format.</value>
- </data>
- <data name="LogResultData" xml:space="preserve">
- <value>Cache is invalid and data is returned.</value>
- </data>
- <data name="LogResultNotModified" xml:space="preserve">
- <value>Cache is valid and 304 Not Modified is returned.</value>
- </data>
-</root> \ No newline at end of file
diff --git a/BackEnd/Timeline/Resources/Models/Validation/NameValidator.Designer.cs b/BackEnd/Timeline/Resources/Models/Validation/NameValidator.Designer.cs
deleted file mode 100644
index 3050049e..00000000
--- a/BackEnd/Timeline/Resources/Models/Validation/NameValidator.Designer.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Models.Validation {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class NameValidator {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal NameValidator() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Models.Validation.NameValidator", typeof(NameValidator).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to An empty string is not allowed..
- /// </summary>
- internal static string MessageEmptyString {
- get {
- return ResourceManager.GetString("MessageEmptyString", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Invalid character, only alphabet, digit, underscore and hyphen are allowed..
- /// </summary>
- internal static string MessageInvalidChar {
- get {
- return ResourceManager.GetString("MessageInvalidChar", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Too long, more than 26 characters is not premitted..
- /// </summary>
- internal static string MessageTooLong {
- get {
- return ResourceManager.GetString("MessageTooLong", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Name can&apos;t be of the same format of unique id..
- /// </summary>
- internal static string MessageUnqiueId {
- get {
- return ResourceManager.GetString("MessageUnqiueId", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Models/Validation/NameValidator.resx b/BackEnd/Timeline/Resources/Models/Validation/NameValidator.resx
deleted file mode 100644
index 5e7e1745..00000000
--- a/BackEnd/Timeline/Resources/Models/Validation/NameValidator.resx
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="MessageEmptyString" xml:space="preserve">
- <value>An empty string is not allowed.</value>
- </data>
- <data name="MessageInvalidChar" xml:space="preserve">
- <value>Invalid character, only alphabet, digit, underscore and hyphen are allowed.</value>
- </data>
- <data name="MessageTooLong" xml:space="preserve">
- <value>Too long, more than 26 characters is not premitted.</value>
- </data>
- <data name="MessageUnqiueId" xml:space="preserve">
- <value>Name can't be of the same format of unique id.</value>
- </data>
-</root> \ No newline at end of file
diff --git a/BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.Designer.cs b/BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.Designer.cs
deleted file mode 100644
index 522f305a..00000000
--- a/BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.Designer.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Timeline.Resources.Models.Validation {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class NicknameValidator {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal NicknameValidator() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Models.Validation.NicknameValidator", typeof(NicknameValidator).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Nickname is too long..
- /// </summary>
- internal static string MessageTooLong {
- get {
- return ResourceManager.GetString("MessageTooLong", resourceCulture);
- }
- }
- }
-}
diff --git a/BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.resx b/BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.resx
deleted file mode 100644
index b191b505..00000000
--- a/BackEnd/Timeline/Resources/Models/Validation/NicknameValidator.resx
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="MessageTooLong" xml:space="preserve">
- <value>Nickname is too long.</value>
- </data>
-</root> \ No newline at end of file
diff --git a/BackEnd/Timeline/Timeline.csproj b/BackEnd/Timeline/Timeline.csproj
index 96f65301..b9653b25 100644
--- a/BackEnd/Timeline/Timeline.csproj
+++ b/BackEnd/Timeline/Timeline.csproj
@@ -63,30 +63,15 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resource.resx</DependentUpon>
</Compile>
- <Compile Update="Resources\Helper\DataCacheHelper.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>DataCacheHelper.resx</DependentUpon>
- </Compile>
<Compile Update="Models\Http\Resource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resource.resx</DependentUpon>
</Compile>
- <Compile Update="Resources\Models\Validation\NicknameValidator.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>NicknameValidator.resx</DependentUpon>
- </Compile>
- <Compile Update="Resources\Models\Validation\NameValidator.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>NameValidator.resx</DependentUpon>
- </Compile>
- <Compile Update="Resources\Models\Validation\Validator.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>Validator.resx</DependentUpon>
+ <Compile Update="Models\Validation\Resource.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resource.resx</DependentUpon>
</Compile>
<Compile Update="Routes\Resource.Designer.cs">
<DesignTime>True</DesignTime>
@@ -153,25 +138,13 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
- <EmbeddedResource Update="Resources\Helper\DataCacheHelper.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>DataCacheHelper.Designer.cs</LastGenOutput>
- </EmbeddedResource>
<EmbeddedResource Update="Models\Http\Resource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
- <EmbeddedResource Update="Resources\Models\Validation\NicknameValidator.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>NicknameValidator.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <EmbeddedResource Update="Resources\Models\Validation\NameValidator.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>NameValidator.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <EmbeddedResource Update="Resources\Models\Validation\Validator.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Validator.Designer.cs</LastGenOutput>
+ <EmbeddedResource Update="Models\Validation\Resource.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Routes\Resource.resx">
<Generator>ResXFileCodeGenerator</Generator>