IW4M-Admin/Data/Models/Client/Stats/EFRating.cs

32 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Data.Models.Server;
namespace Data.Models.Client.Stats
{
public class EFRating : SharedEntity
{
[Key]
public int RatingId { get; set; }
2018-05-31 20:17:52 -04:00
public int RatingHistoryId { get; set; }
[ForeignKey("RatingHistoryId")]
public virtual EFClientRatingHistory RatingHistory { get; set; }
// if null, indicates that the rating is an average rating
public long? ServerId { get; set; }
2018-05-31 20:17:52 -04:00
// [ForeignKey("ServerId")] can't make this nullable if this annotation is set
public virtual EFServer Server { get; set; }
[Required]
public double Performance { get; set; }
[Required]
public int Ranking { get; set; }
2018-05-31 20:17:52 -04:00
[Required]
// indicates if the rating is the latest
public bool Newest { get; set; }
2018-06-01 20:55:26 -04:00
[Required]
public int ActivityAmount { get; set; }
[Required]
public DateTime When { get; set; } = DateTime.UtcNow;
}
}