hn-dotnet/Domain/Vote.cs
Julien Leicher 3cd5133f66 add-aspnet-identity (#26)
add exception filter when user not connected
default to needing authentication and apply anonymous to some actions
add user in get requests
add user relation in link, comment and vote
signup and in are ok now!
2020-12-11 17:59:35 +01:00

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;
}
}
}