/*public Layout GetFormLayout(string FormModelJson)
         * {
         *  var sl = new StackLayout();
         *
         *  //string FormModelJson = _formRepository.GetFormModel(friendlyName);
         *  FormModel view = JsonConvert.DeserializeObject<FormModel>(FormModelJson);
         *
         *  return _layoutGenerator.GenerateLayout(view);
         * }*/


        public List <FormInstance> GetAllForms(string trackingNumber)
        {
            List <FormInstance>     formInstances    = new List <FormInstance>();
            List <FormInstanceData> allFormInstances = _formRepository.GetAllForms(trackingNumber);

            foreach (FormInstanceData formInstanceData in allFormInstances)
            {
                FormInstance formInstance = new FormInstance();
                formInstance.FriendlyName     = formInstanceData.FriendlyName;
                formInstance.FormModelView    = JsonConvert.DeserializeObject <FormModel>(formInstanceData.FormModel);
                formInstance.FormData         = formInstanceData.FormData;
                formInstance.ValidationSchema = formInstanceData.ValidationSchema;

                formInstances.Add(formInstance);
            }

            return(formInstances);
        }