public void AddMobileDevice(MobileDevice dv) { if (HasDeviceRegistered(dv.InstallationId)) { return; } UsesDevices.Add(new MobileDeviceForUser(this, dv)); }
public bool HasDeviceRegistered(string installationId) { return(UsesDevices.Any(d => d.MobileDevice.InstallationId == installationId)); }
public MobileDevice GetMobileDevice(string installationId) { return(UsesDevices.Where(ud => ud.MobileDevice.InstallationId == installationId) .Select(ud => ud.MobileDevice).FirstOrDefault()); }
public void InvalidatePushTokensForDevice(string installationId) { UsesDevices.SingleOrDefault(d => d.MobileDevice.InstallationId == installationId) ?.MobileDevice.InvalidateRegisteredPushTokens(); }