30 lines
No EOL
758 B
C#
30 lines
No EOL
758 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SockScape.DAL {
|
|
public partial class Session {
|
|
[Key, ForeignKey("User")]
|
|
public long Id { get; set; }
|
|
[Required]
|
|
public virtual User User { get; set; }
|
|
|
|
[Required, Index(IsUnique = true)]
|
|
public byte[] Secret { get; set; }
|
|
|
|
[Required]
|
|
public DateTime LastPing { get; set; }
|
|
|
|
[NotMapped]
|
|
public TimeSpan DeltaLastPing
|
|
=> DateTime.UtcNow - LastPing;
|
|
|
|
[Required]
|
|
public int ServerId { get; set; }
|
|
}
|
|
} |