yavsc/Yavsc.Api/Model/Identity/MobileAppDeclaration.cs

36 lines
915 B
C#
Raw Normal View History

2016-05-17 18:22:18 +02:00
using System.ComponentModel.DataAnnotations;
2016-05-30 13:54:52 +02:00
using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models;
2016-05-17 18:22:18 +02:00
public class GoogleCloudMobileDeclaration {
[Key]
public string RegistrationId { get; set; }
2016-05-30 13:54:52 +02:00
public string DeviceOwnerId { get; set; }
public string Name { get; set; }
2016-05-30 13:54:52 +02:00
[ForeignKeyAttribute("DeviceOwnerId")]
public virtual ApplicationUser DeviceOwner { get; set; }
// override object.Equals
public override bool Equals (object obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
var other = obj as GoogleCloudMobileDeclaration;
return RegistrationId == other.RegistrationId
&& Name == other.Name;
}
// override object.GetHashCode
public override int GetHashCode()
{
return (RegistrationId+Name).GetHashCode();
}
2016-05-17 18:22:18 +02:00
}