public async Task <MemberUpgradeViewModel> AddUpdateUpgrade(int id, [FromBody] JObject value) { var model = new MemberUpgradeViewModel(); try { model = value.ToObject <MemberUpgradeViewModel>(); model.RSIId = id; model = await _context.AddUpdateUpgradeInfoAsync(model); } catch (Exception ex) { if (model == null) { model = new MemberUpgradeViewModel(); } model.Message = $"Error: {ex.Message}"; } return(model); }