Google Registration+ device info
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user