예제 #1
0
        public void Test1()
        {
            var ent   = new RedmineEntities();
            var items =
                from t in ent.Projects
                where t.Identifier == "projname"
                where t.IsPublic == true
                select t;
            var lst = items.ToList();

            Assert.NotNull(lst);
            Assert.Empty(lst);
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("copy MySQL to SQLite");

            var mysql  = new RedmineEntitiesMySql();
            var sqlite = new RedmineEntities();

            // projectsとisseusの中身を消す
            sqlite.Database.ExecuteSqlCommand("delete from projects");
            sqlite.Database.ExecuteSqlCommand("delete from issues");
            // データをコピーする
            sqlite.projects.AddRange(mysql.projects.ToListAsync().Result);
            sqlite.issues.AddRange(mysql.issues.ToListAsync().Result);
            sqlite.SaveChanges();
            Console.WriteLine("コピーしました");
        }
예제 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var ent   = new RedmineEntities();
            var items =
                from t in ent.Projects
                where t.Identifier == "projname"
                where t.IsPublic == true
                select t;

            /*
             * var items = ent.Projects
             *  .Where(t => t.Identifier == "projname" && t.IsPublic == true);
             */
            items.Expression.Dump();


            var items2 =
                from p in ent.Projects
                join i in ent.Issues on p.Id equals i.Project.Id
                where p.IsPublic == true && p.Identifier == "project_name"
                where i.Priority.Name == "高め"
                select i;

            items2.Expression.Dump();

            var lst = items2.ToList();



            var issue = new Issue();

            ent.Issues.Add(issue);
            ent.Issues.Update(issue);



            Console.ReadKey();
        }