28 lines
564 B
C#
28 lines
564 B
C#
using System;
|
|
|
|
namespace HN.Domain
|
|
{
|
|
public sealed class Vote
|
|
{
|
|
public VoteType Type { get; private set; }
|
|
public Guid CreatedBy { get; }
|
|
public DateTime CreatedAt { get; private set; }
|
|
|
|
internal Vote(Guid createdBy, VoteType type)
|
|
{
|
|
CreatedBy = createdBy;
|
|
Type = type;
|
|
CreatedAt = DateTime.UtcNow;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Change le type d'un vote
|
|
/// </summary>
|
|
/// <param name="type"></param>
|
|
public void HasType(VoteType type)
|
|
{
|
|
Type = type;
|
|
CreatedAt = DateTime.UtcNow;
|
|
}
|
|
}
|
|
} |