sockscape/server/DAL/Origin.cs

26 lines
608 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
2017-06-06 21:13:25 +00:00
using System.Net;
using System.Text;
using System.Threading.Tasks;
2017-07-22 19:27:41 +00:00
namespace SockScape.DAL {
2017-06-05 12:20:39 +00:00
public partial class Origin {
public long Id { get; set; }
2017-06-05 12:20:39 +00:00
[ForeignKey("User")]
public long UserId { get; set; }
public virtual User User { get; set; }
2017-06-06 21:13:25 +00:00
protected string RawIp { get; set; }
2017-08-21 21:03:32 +00:00
[NotMapped]
2017-06-06 21:13:25 +00:00
public IPAddress Ip {
2017-08-21 21:03:32 +00:00
get => IPAddress.Parse(RawIp);
set => RawIp = value.ToString();
2017-06-06 21:13:25 +00:00
}
}
}