示例#1
0
        internal string ToStringTest([PexAssumeUnderTest] YogaClass target)
        {
            string result = target.ToString();

            return(result);
            // TODO: add assertions to method YogaClassTest.ToStringTest(YogaClass)
        }
示例#2
0
        public ActionResult OnPost()
        {
            if (ModelState.IsValid)
            {
                //Retrieve the PoseList from TempData
                var    x = TempData["PoseList"] as String;
                Pose[] p = JsonSerializer.Deserialize <Pose[]>(x);

                //Create a new instance of YogaClass and store all the details of
                //the class.
                YogaClass yc = new YogaClass
                {
                    PoseDuration      = PoseDuration,
                    PrepDuration      = PrepDuration,
                    Shavasana         = Shavasana,
                    ShavasanaDuration = ShavasanaDuration,
                    PoseList          = p
                };

                TempData["YogaClass"] = yc.ToString();

                return(RedirectToPage("ClassConfirmation"));
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (ModelState.IsValid)
            {
                YogaClass yc = new YogaClass();

                if (Shavasana != "None")
                {
                    yc.ShavasanaLength = ShavasanaLength;
                }

                yc.PoseDuration = PoseDuration;
                yc.PrepDuration = PrepDuration;
                yc.Shavasana    = Shavasana;
                yc.PoseList     = TempData.Get <Poses[]>("PoseList");

                TempData["YogaClass"] = yc.ToString();
                return(RedirectToPage("Confirmation"));
            }
            return(Page());
        }
        public ActionResult OnPost()
        {
            if (ModelState.IsValid)
            {
                var     x = TempData["PoseList"] as String;
                Poses[] p = JsonSerializer.Deserialize <Poses[]>(x);

                YogaClass yc = new YogaClass
                {
                    PoseDuration    = PoseDuration,
                    PrepDuration    = PrepDuration,
                    Shavasana       = Shavasana,
                    ShavasanaLength = ShavasanaLength,
                    PoseList        = p
                };

                TempData["YogaClass"] = yc.ToString();

                //Redirecting to a Razor component that has been created as a page.
                //return Redirect("~/ClassConfirmation");
                return(RedirectToPage("ClassConfirmation"));
            }
            return(Page());
        }