Exemplo n.º 1
0
    static void Main()
    {
        var r = new List <int>();
        var h = Read();
        var n = h[0];

        var uf = new UFW(n);

        for (int i = 0; i < h[1]; i++)
        {
            var q = Read();
            if (q[0] == 0)
            {
                uf.Unite(q[1], q[2], q[3]);
            }
            else
            {
                r.Add(uf.Diff(q[1], q[2]));
            }
        }
        Console.WriteLine(string.Join("\n", r.Select(d => d == int.MaxValue ? "?" : $"{d}")));
    }
Exemplo n.º 2
0
        public void dddd()
        {
            var ufw = new ABMLib.DAL.LocalDB.UnitOfWork2(_Context, new DBContextHLog());

            var H = UFW.Repository <HLog>();

            var r = UFW.Repository <DBContext, QdtAction, QdtActionHLog>();

            //var r2 = UFW.Repository<RepQdtAction , QdtAction, long>();
            //var fff1 = r2.GetAll();
            //r2.Add(new QdtAction());
            r.Add(new QdtAction());
            H.Add(new HLog("ثبت داده QdtAction"));
            UFW.Save();
            //var fff2 = r2.GetAll();
            var it = r.GetEntityById(1);

            it.Name = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
            r.Add(it);
            UFW.Save();
            UFW.Dispose();
            //UFW.dIRep["RepQdtAction"].
        }