public int Test5(TestSerializerModel3 model)
 {
     if (model.Equals(s_lastTestSerializerModel3))
     {
         return(1);
     }
     else
     {
         return(0);
     }
 }
        public int Test6(Category category, Product product, Customer customer, string stringVal)
        {
            TestSerializerModel3 model = new TestSerializerModel3 {
                StringVal = stringVal,
                Category  = category,
                Customer  = customer,
                Product   = product
            };

            if (model.Equals(s_lastTestSerializerModel3))
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
        private TestSerializerModel3 GetTestSerializerModel3()
        {
            Random rand = new Random();
            TestSerializerModel3 model = new TestSerializerModel3 {
                StringVal = "Fish Li"
            };

            int index = rand.Next(1, WebSiteDB.MyNorthwind.Categories.Count - 1);

            model.Category = WebSiteDB.MyNorthwind.Categories.Skip(index).Take(1).First();

            index         = rand.Next(1, WebSiteDB.MyNorthwind.Products.Count - 1);
            model.Product = WebSiteDB.MyNorthwind.Products.Skip(index).Take(1).First();

            index          = rand.Next(1, WebSiteDB.MyNorthwind.Customers.Count - 1);
            model.Customer = WebSiteDB.MyNorthwind.Customers.Skip(index).Take(1).First();

            s_lastTestSerializerModel3 = model;
            return(model);
        }
        public object GetJson5()
        {
            TestSerializerModel3 model = GetTestSerializerModel3();

            return(new JsonResult(model));
        }
        public object GetXml5()
        {
            TestSerializerModel3 model = GetTestSerializerModel3();

            return(new XmlResult(model));
        }