//URL POST : http://localhost:50538/RestService/RestService.svc/RegisterDevice public Response RegisterDevice(DeviceInfoContract deviceInfo) { var user = _userService.GetBy(deviceInfo.UserLogin); if (user != null) { var newDevice = new Device { RegistrationId = deviceInfo.RegistrationId, Imei = deviceInfo.Imei, User = user }; _deviceService.Create(newDevice); return new SuccessResponse(); } else { return new FailureResponse(); } }
//URL POST : http://localhost:50538/RestService/RestService.svc/RegisterDevice public Response RegisterDevice(DeviceInfoContract deviceInfo) { var user = _userService.GetBy(deviceInfo.UserLogin); if (user != null) { var newDevice = new Device { RegistrationId = deviceInfo.RegistrationId, Imei = deviceInfo.Imei, User = user }; _deviceService.Create(newDevice); return(new SuccessResponse()); } else { return(new FailureResponse()); } }