private List <RequestParameter> LegacyFillParameters(ref List <RequestParameter> parameters,
                                                             ref string action, ref IController controller)
        {
            string msg = "You are using an old version of the native client for the server, or the format of the parameters is out of date. The framework will use the hourly backward compatibility mode, but in future versions support for this parameter format will be discontinued.";

            logger.WriteLog(msg, ServerLogType.ALERT);
            ServerAlertManager.CreateAlert(new ServerAlert(controller.GetType().Name, action, msg));
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(msg);
            Console.ForegroundColor = ConsoleColor.White;

            object entityParameterObject      = null;
            HashSet <RequestParameter> result = new HashSet <RequestParameter>();
            MethodInfo       method           = controller.GetType().GetMethod(action);
            RequestParameter requestParameter = null;
            string           currentAlias     = null;

            foreach (RequestParameter parameter in parameters)
            {
                string pName  = parameter.Name;
                string pValue = Convert.ToString(parameter.Value);

                foreach (ParameterInfo pInfo in method.GetParameters())
                {
                    if (parameter.IsComplexType() && !IsSimpleType(pInfo.ParameterType))
                    {
                        ObjectRequestParameter objectRequestParameter = GetObjectParameterType(pName, action, controller.GetType().Name);
                        if (currentAlias != objectRequestParameter.Alias)
                        {
                            currentAlias     = objectRequestParameter.Alias;
                            requestParameter = null;
                            ModelRegister model = modelsManager.GetModelRegister(objectRequestParameter.TypeName);
                            if (model == null)
                            {
                                throw new Exception($"Model type '{objectRequestParameter.TypeName}' not found or not registered");
                            }

                            //instantiate object parameter (public ctor)
                            entityParameterObject = Activator.CreateInstance(model.ModelType);
                        }
                        //requestParameter for a complex type object
                        if (requestParameter == null)
                        {
                            requestParameter = new RequestParameter(parameter.GetAliasName(), entityParameterObject);
                        }
                        FillProperty(entityParameterObject, parameter.GetParameterProperyName(), pValue);
                        break;
                    }

                    //requestParameter for simple type object
                    requestParameter = GetRequestParameterFromType(pInfo, pName, pValue);
                    if (requestParameter != null)
                    {
                        break;
                    }
                }

                if (requestParameter != null)
                {
                    result.Add(requestParameter);
                }
            }
            return(result.ToList());
        }
        internal void ComputeStatisticks(ActionResult result)
        {
            if (AppServerConfigurator.DisableStatisticsCalculating)
            {
                return;
            }
            if (result.Type == 1)
            {
                return;
            }
            StringBuilder json = new StringBuilder();

            using (StringWriter sw = new StringWriter(json))
            {
                using (JsonWriter jw = new JsonTextWriter(sw))
                {
                    JsonSerializer js = new JsonSerializer();
                    js.ApplyCustomSettings();
                    js.Serialize(jw, result.Content);
                }
            }

            int bufferSize = coreServer.GetConfiguration().BufferSize;

            byte[] bytes             = encoder.ConvertToByteArray(json.ToString());
            int    lenght            = bytes.Length;
            double percentBufferUsed = (lenght / (double)bufferSize) * 100;

            result.ResponseLenght = lenght;
            result.PercentUsage   = percentBufferUsed;

            if (percentBufferUsed >= 100)
            {
                string msg = $@"
The action response on the controller is using around {percentBufferUsed.ToString("N2")}% of the buffer quota configured on the server.
Server Buffer Size: {bufferSize}
Response Size:      {lenght}
Operation has stopped.";

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(msg);
                Console.ForegroundColor = ConsoleColor.Gray;

                var alert = new ServerAlert
                {
                    Action     = Action,
                    Controller = Controller.GetType().Name,
                    Date       = DateTime.Now,
                    Message    = msg
                };

                ServerAlertManager.CreateAlert(alert);
                throw new Exception(msg);
            }

            if (percentBufferUsed >= 80)
            {
                string msg = $"\nThe action response on the controller is using around {percentBufferUsed.ToString("N2")}% of the buffer quota configured on the server. Review your code as soon as possible before the server collapses and begins to give incomplete responses to connected clients.";
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(msg);
                Console.ForegroundColor = ConsoleColor.Gray;

                var alert = new ServerAlert
                {
                    Action     = Action,
                    Controller = Controller.GetType().Name,
                    Date       = DateTime.Now,
                    Message    = msg
                };

                ServerAlertManager.CreateAlert(alert);
            }
        }