public async Task <IActionResult> SetActivationDeActivationUser([FromBody] UserActivateModel obj) { if (ModelState.IsValid) { return(Ok(await _userService.ActivateDeactivateUser(obj))); } else { return(UnprocessableEntity()); } }
//Created By : Ashwajit Bansod to acitvate deactivate user public async Task <int> ActivateDeactivateUser(UserActivateModel obj) { try { var sp = StringGenerator.GetProcedureParameter(obj, SPConstants.spSetActivationDeActivationUser); var result = await _connectContext.spSetActivationDeActivationUser .FromSqlRaw(sp, obj.UID_UserId, obj.IsActive) .ToListAsync(); return(result.FirstOrDefault().Result); } catch (Exception ex) { _ILogger.Log(LogLevel.Critical, "Exception while calling ActivateDeactivateUser ", ex); return(0); } }