2018-05-30 21:50:20 -04:00
|
|
|
|
using SharedLibraryCore.Database.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace IW4MAdmin.Plugins.Stats.Models
|
|
|
|
|
{
|
|
|
|
|
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 int? ServerId { get; set; }
|
|
|
|
|
// [ForeignKey("ServerId")] can't make this nullable if this annotation is set
|
|
|
|
|
public virtual EFServer Server { get; set; }
|
2018-05-30 21:50:20 -04:00
|
|
|
|
[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; }
|
2018-09-07 23:29:42 -04:00
|
|
|
|
[Required]
|
|
|
|
|
public DateTime When { get; set; } = DateTime.UtcNow;
|
2018-05-30 21:50:20 -04:00
|
|
|
|
}
|
|
|
|
|
}
|