diff --git a/src/Workleap.ComponentModel.DataAnnotations/GuidAttribute.cs b/src/Workleap.ComponentModel.DataAnnotations/GuidAttribute.cs index cfe0180..e123c55 100644 --- a/src/Workleap.ComponentModel.DataAnnotations/GuidAttribute.cs +++ b/src/Workleap.ComponentModel.DataAnnotations/GuidAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using System.Globalization; @@ -37,8 +37,9 @@ public GuidAttribute(string format) private bool IsValidGuid(string valueAsString) { + Guid guid; return this.Format is null - ? Guid.TryParse(valueAsString, out Guid guid) && this.IsValidGuid(guid) + ? Guid.TryParse(valueAsString, out guid) && this.IsValidGuid(guid) : Guid.TryParseExact(valueAsString, this.Format, out guid) && this.IsValidGuid(guid); }