first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Landmark.OLA.Models
|
||||
{
|
||||
public class OlaModel
|
||||
{
|
||||
//This will either hold an ToString'ed int or a 36-char long GUID
|
||||
[StringLength(36)]
|
||||
public string Id { get; set; }
|
||||
|
||||
public Guid GetOrCreateGuid()
|
||||
{
|
||||
if (Guid.TryParse(Id, out Guid parsedGuid))
|
||||
{
|
||||
return parsedGuid;
|
||||
}
|
||||
else
|
||||
{
|
||||
var newGuid = Guid.NewGuid();
|
||||
Id = newGuid.ToString();
|
||||
return newGuid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user