public IActionResult Insert(S p) { var apiRep = new APIResponse(); var userId = string.Empty; if (HttpContext.User.Identity is ClaimsIdentity identity) { userId = identity.FindFirst(ClaimTypes.Name).Value; } var Save = new Save { UserId = userId, Product = p }; _saveService.Insert(Save); apiRep.Error = false; apiRep.Data = Save; return(Ok(apiRep)); }