Google Registration+ device info

This commit is contained in:
2016-07-03 23:57:33 +02:00
parent 5b3ed5f5ff
commit 1a7cd378ad
6 changed files with 25 additions and 32 deletions

View File

@ -3,34 +3,18 @@ using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models;
public class GoogleCloudMobileDeclaration {
[Key]
public string RegistrationId { get; set; }
public string GCMRegistrationId { get; set; }
public string DeviceOwnerId { get; set; }
[Key]
public string DeviceId { get; set; }
public string Name { get; set; }
public string Model { get; set; }
public string Platform { get; set; }
public string Version { get; set; }
[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();
}
}