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