vgquotes/Src/VideoGameQuotes.Api/Vote.cs

19 lines
491 B
C#
Raw Normal View History

2011-02-09 00:05:32 +00:00
using System;
using Portoa.Persistence;
namespace VideoGameQuotes.Api {
public class Vote : Entity<Vote, int> {
public Vote() {
Created = DateTime.UtcNow;
}
2011-02-09 00:05:32 +00:00
public virtual User Voter { get; set; }
public virtual Quote Quote { get; set; }
public virtual DateTime Created { get; set; }
public virtual VoteDirection Direction { get; set; }
2011-02-09 00:05:32 +00:00
public static explicit operator int(Vote vote) {
return vote.Direction == VoteDirection.Up ? 1 : -1;
2011-02-09 00:05:32 +00:00
}
}
}