public static void logErrors(myStatusCodeHandling _statusProblem = null, object _exceptionHandlerPathFeature = null, HttpResponse _response = null)
        {
            using (MVCContext myContext = new MVCContext())
            {
                TblErrorLogs errorObj = new TblErrorLogs();
                if (_exceptionHandlerPathFeature != null)
                {
                    var exceptionHandlerPathFeature = (IExceptionHandlerPathFeature)_exceptionHandlerPathFeature;
                    errorObj.ExMsg             = exceptionHandlerPathFeature.Error?.Message;
                    errorObj.ExStackTrace      = exceptionHandlerPathFeature.Error?.StackTrace;
                    errorObj.ExPath            = exceptionHandlerPathFeature?.Path;
                    errorObj.InnerExMsg        = exceptionHandlerPathFeature.Error?.InnerException?.Message;
                    errorObj.InnerExStackTrace = exceptionHandlerPathFeature.Error?.InnerException?.StackTrace;
                }

                if (_response != null)
                {
                    errorObj.HttpErrorStatusCode = (short)_response?.StatusCode;
                    errorObj.HttpErrorCookies    = _response?.Cookies.ToString();
                    errorObj.HttpErrorPath       = _response?.HttpContext?.Request?.Path;
                    errorObj.HttpErrorRequest    = _response?.HttpContext?.Request?.ToString();
                }

                if (_statusProblem != null)
                {
                    errorObj.HttpErrorStatusCode = (short)_statusProblem.irStatusCode;
                    errorObj.HttpErrorPath       = _statusProblem.OriginalPath;
                    errorObj.HttpErrorRequest    = _statusProblem.OriginalPathBase;
                    errorObj.HttpErrorCookies    = _statusProblem.OriginalQueryString;
                }

                myContext.TblErrorLogs.Add(errorObj);
                myContext.SaveChanges();
            }
        }
        public static void updateUser(TblUsers myUser)
        {
            using (MVCContext myContext = new MVCContext())
            {
                var vrUser = myContext.TblUsers.Where(pr => pr.UserId == myUser.UserId).FirstOrDefault();
                if (vrUser != null)
                {
                    vrUser.FirstName = myUser.FirstName;
                    vrUser.LastName  = myUser.LastName;
                    vrUser.Email     = myUser.Email;
                    vrUser.BirthDay  = myUser.BirthDay;
                }
                else
                {
                    myContext.Add(myUser);
                }

                myContext.SaveChanges();
            }
        }