using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp
{
    public class Ye
    {
        public string Y { get; set; }

        public string E { get; set; }
    }

    public class Hao
    {
        public string H { get; set; }

        public string A { get; set; }

        public string O { get; set; }
    }


    class Program
    {
        static void Main(string[] args)
        {
            List<Ye> yes = new List<Ye>() {
                new Ye() { E = "e1", Y = "y1" },
                new Ye() { E = "e2", Y = "y2" },
                new Ye() { E = "e3", Y = "y3" },
            };

            List<Hao> haos = new List<Hao>()
            {
                new Hao(){ A="A1", H="H1", O="O1" },
                new Hao(){ A="A2", H="H2", O="O2" },
                new Hao(){ A="A3", H="H3", O="O3" }
            };
            //笛卡尔积
            var data = from d in yes
                       from t in haos
                       select new { d, t };
            //笛卡尔积
            var data1 = from d in yes
                       from t in haos
                       select new
                       {
                           d.E,
                           d.Y,
                           t.A,
                           t.H,
                           t.O
                       };
            Console.Read();

        }
       
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2021-11-14
  • 2021-08-26
  • 2022-12-23
  • 2021-06-08
猜你喜欢
  • 2021-04-11
  • 2021-08-09
  • 2021-06-10
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案