예제 #1
0
        //private IJsonProvider jsonProvider;
        //public JsonScheme(IUserServices _userService, IJsonProvider _jsonProvider)
        //{
        //    userService = _userService;
        //    jsonProvider = _jsonProvider;
        //}

        public IForm <JObject> ValidateUser()
        {
            OnCompletionAsyncDelegate <JObject> endingResult = async(context, state) =>
            {
                string testKey = String.Empty;
                foreach (JProperty item in (JToken)state)
                {
                    testKey = item.Value.ToString();
                }

                context.UserData.SetValue("tescik", testKey);
            };
            //This one is starter Form and is calling the second one

            var schema = JObject.Parse(_jsonProvider.GetValidationJson());

            return(new FormBuilderJson(schema)
                   .AddRemainingFields()
                   .OnCompletion(endingResult)
                   .Build());
        }