public ResponseModel NotiRegistration(NotificationRegisModel model) { var response = new ResponseModel { Success = false, Messages = new List<string>() }; if (model == null || string.IsNullOrEmpty(model.UserId) || string.IsNullOrEmpty(model.Token)) { response.Messages.Add("Mandatory data can not be empty"); response.Data = model; } else { try { var res = NotificationService.AddNewToken(model); response.Data = model; response.Messages.Add("Token added"); response.Success = res; } catch (Exception excep) { response.Messages.Add("Something bad happened."); } } return response; }