Ejemplo n.º 1
0
        static void Test()
        {
            CuentaManager cuentaManager = new CuentaManager();
            var           result        = cuentaManager.FindAllWithUsuarioMaestro();

            Console.WriteLine(JsonConvert.SerializeObject(result));


            var entities = new Entities();

            var query = (from g in entities.ordencompras
                         join u in entities.proveedores on g.ProveedorId equals u.Id
                         select new { g, u, }).Take(2);


            var json = JsonConvert.SerializeObject(query);
            // Console.Write(json);
            //Console.ReadLine();


            var quer2 = (from c in entities.cuentas
                         from u in c.AspNetUsers
                         where u.Tipo == UsuarioManager.Tipo.MaestroProveedor
                         select  new { c, u }).ToList();

//            var sql = ((System.Data.Objects.ObjectQuery)query).ToTraceString();

            Console.WriteLine(quer2.ToString());

            json = JsonConvert.SerializeObject(quer2.ToList());
            Console.Write(json);
            Console.ReadLine();
        }