public Task <int> SubmitForm <TDto>(LabInstrumentEntity entity, TDto dto) where TDto : class { //var claimsIdentity = _httpContext.HttpContext.User.Identity as ClaimsIdentity; //claimsIdentity.CheckArgumentIsNull(nameof(claimsIdentity)); //var claim = claimsIdentity?.FindFirst(t => t.Type == ClaimTypes.NameIdentifier)); if (!string.IsNullOrEmpty(entity.F_Id)) { entity.Modify(entity.F_Id); entity.F_LastModifyUserId = _usersService.GetCurrentUserId(); return(_service.UpdateAsync(entity, dto)); } else { entity.Create(); if (!entity.F_EnabledMark.HasValue) { entity.F_EnabledMark = true; } if (!entity.F_Sorter.HasValue) { entity.F_Sorter = 0; } entity.F_CreatorUserId = _usersService.GetCurrentUserId(); return(_service.InsertAsync(entity)); } }