24 lines
477 B
C#
24 lines
477 B
C#
using System;
|
|
|
|
namespace HN.Domain
|
|
{
|
|
public class Link
|
|
{
|
|
public Guid Id { get; }
|
|
public string Url { get; }
|
|
public DateTime CreatedAt { get; }
|
|
|
|
private Link(string url)
|
|
{
|
|
this.Id = Guid.NewGuid();
|
|
this.CreatedAt = DateTime.UtcNow;
|
|
this.Url = url;
|
|
}
|
|
|
|
public static Link FromUrl(string url)
|
|
{
|
|
return new Link(url);
|
|
}
|
|
}
|
|
}
|