Exemplo n.º 1
0
        public void GroupTest()
        {
            Dictionary <int, int> sort = new Dictionary <int, int>();

            sort[1] = 300;
            sort[2] = 200;
            sort[3] = 100;

            TestX x1 = new TestX();

            x1.Id   = 1;
            x1.Name = "1";
            TestX x2 = new TestX();

            x2.Id   = 2;
            x2.Name = "2";
            TestX x3 = new TestX();

            x3.Id   = 3;
            x3.Name = "3";
            TestX x4 = new TestX();

            x4.Id   = 3;
            x4.Name = "3";

            List <TestX> list = new List <TestX>();

            list.Add(x1);
            list.Add(x4);
            list.Add(x2);
            list.Add(x3);

            var ff = list.GroupBy(x => x.Id).OrderBy(x => sort[x.Key]);
        }
Exemplo n.º 2
0
        private void ExportYZData()
        {
            string prefix = "Exporting YZ data...";

            Utils.DrawMessage(prefix, Utils.CreateProgressBar(Utils.ProgressBarLength, 0), ConsoleColor.Gray);

            File.WriteAllLines(DataManager.Config.FullPredictedYYFile, PriceOutput.Select(x => String.Join(";", x)));

            Utils.DrawMessage(prefix, Utils.CreateProgressBar(Utils.ProgressBarLength, 50), ConsoleColor.Gray);

            File.WriteAllLines(DataManager.Config.FullPredictedZFile, TestX.Select(x => String.Join(";", x.Take(DataSourcesCounts[0]))));

            Utils.DrawMessage(prefix, Utils.CreateProgressBar(Utils.ProgressBarLength, 100), ConsoleColor.Green);
            Console.WriteLine();
        }
Exemplo n.º 3
0
 public void TestRedisUnitStepEditTest()
 {
     CacheHelper.SetCache <TestX>(new TestX(), CacheKeyEnum.UnitStepEdit_Cache, DateTime.Now, 10000);
     TestX obj = CacheHelper.GetCache <TestX>(CacheKeyEnum.UnitStepEdit_Cache, 10000);
 }