AOT Builds
This commit is contained in:
20
Shared/Models/Stateless/Id.cs
Normal file
20
Shared/Models/Stateless/Id.cs
Normal file
@ -0,0 +1,20 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
internal abstract class Id
|
||||
{
|
||||
|
||||
internal static bool NameWithoutExtensionIsIdFormat(string fileNameWithoutExtension)
|
||||
{
|
||||
bool result;
|
||||
int intMinValueLength = int.MinValue.ToString().Length;
|
||||
if (fileNameWithoutExtension.Length < 5 || fileNameWithoutExtension.Length > intMinValueLength)
|
||||
result = false;
|
||||
else
|
||||
{
|
||||
bool skipOneAllAreNumbers = fileNameWithoutExtension[1..].All(l => char.IsNumber(l));
|
||||
result = (skipOneAllAreNumbers && fileNameWithoutExtension[0] == '-') || (skipOneAllAreNumbers && char.IsNumber(fileNameWithoutExtension[0]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user