{"id":9093,"date":"2018-05-17T09:47:00","date_gmt":"2018-05-17T00:47:00","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=9093"},"modified":"2018-05-16T09:27:28","modified_gmt":"2018-05-16T00:27:28","slug":"linq%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6mysql%e3%81%ab%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/9093","title":{"rendered":"LINQ\u3092\u4f7f\u3063\u3066MySQL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b"},"content":{"rendered":"<p>\u5e38\u3005\u3001LINQ \u3092\u4f7f\u3046\u305f\u3081\u306b SQL Server \u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u3063\u3066\u3001\u3058\u3083\u3042\u3001Linux+MySQL\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u5bfe\u3057\u3066 C#+LINQ \u306f\u3069\u3046\u30a2\u30af\u30bb\u30b9\u3059\u308c\u3070\u3088\u3044\u306e\u304b\uff1f\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u3044\u3064\u306e\u9593\u306b\u304b Entity Framework \u76f8\u5f53\u306e\u3082\u306e\u3001\u3068\u3044\u3046\u304b MySql.Data.EntityFramework \u304c\u51fa\u6765\u3066\u3044\u305f\u3089\u3057\u3044\u3002<\/p>\n<p>MySQL :: Download Connector\/Net<br \/>\n<a href=\"https:\/\/dev.mysql.com\/downloads\/connector\/net\/\">https:\/\/dev.mysql.com\/downloads\/connector\/net\/<\/a><\/p>\n<p>\u3044\u304d\u306a\u308a\u3001Connector\/Net 8.0.11 \u3068\u3044\u3046\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u4e0a\u304c\u3063\u3066\u3044\u3066\uff08\u3042\u3061\u3053\u3061\u306e\u8a18\u4e8b\u306f 6.x \u3060\u3063\u305f\u308a\u3059\u308b\u3093\u3060\u304c\uff09\u3001\u3069\u3046\u3084\u30894\u6708\u9803\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u4f55\u304c\u3067\u304d\u308b\u306e\u3068\u3044\u3046\u3068\u3001Redmine \u3084 WordPress \u306e\u5185\u90e8\u306b\u3042\u308b MySQL \u306b LINQ \u3092\u4f7f\u3063\u3066\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3068\u3044\u3046\u3053\u3068\u3060\u3002\u3053\u3093\u306a\u611f\u3058\u306b\u3001wordpress \u306e wp_posts \u30c6\u30fc\u30d6\u30eb\u306bACCESS\u3067\u304d\u308b\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-14.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-14.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"640\" height=\"361\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<h2>NuGet \u304b\u3089 MySql.Data.EntityFramework \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h2>\n<p>\u5b9f\u306f Oracle \u306e\u30b5\u30a4\u30c8\u304b\u3089\u3001Connector\/Net \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u306a\u304f\u3066\u3082\u3001NuGet \u306b\u3042\u308b\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-15.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-15.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"640\" height=\"306\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u307b\u3046\u306f\u3001MySql.Data.EntityFramework \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070 ok. MySql.Data \u3082\u4e00\u7dd2\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3002<\/p>\n<h2>MySQL \u306e\u30d7\u30ed\u30d0\u30a4\u30c0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h2>\n<p>EF \u81ea\u4f53\u306f\u3001NuGet \u304b\u3089\u53d6\u308c\u308b\u306e\u3060\u304c\u3001SQL Server \u306e\u3088\u3046\u306b\u30c7\u30b6\u30a4\u30ca\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u3001MySQL for Visual Studio \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<p>MySQL :: Download MySQL for Visual Studio <a href=\"https:\/\/dev.mysql.com\/downloads\/windows\/visualstudio\/\">https:\/\/dev.mysql.com\/downloads\/windows\/visualstudio\/<\/a><\/p>\n<p>\u3053\u308c\u3092\u5165\u308c\u308b\u3068\u3001EF \u3067\u300c\u65b0\u3057\u3044\u63a5\u7d9a\u300d\u3092\u9078\u629e\u3057\u305f\u3068\u304d\u306b &#8220;MySQL Database\u201d \u3063\u3066\u306e\u304c\u51fa\u308b\u3088\u3046\u306b\u306a\u308b<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-16.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-16.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"504\" height=\"341\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<h2>MySQL \u306e\u30c6\u30fc\u30d6\u30eb\u3092\u53d6\u308a\u8fbc\u3080<\/h2>\n<p>\u6e96\u5099\u304c\u3067\u304d\u305f\u3089\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u300cADO NET Entity Data Model\u300d\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-17.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-17.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"640\" height=\"444\" style=\"border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<p>\u30e2\u30c7\u30eb\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u9078\u629e\u3067\u306f\u3001<\/p>\n<ul>\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089 EF Designer<\/li>\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089 Code First<\/li>\n<\/ul>\n<p>\u304c2\u3064\u3042\u308b\u3002Designer \u306f\u3001*.edmx \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u30b0\u30e9\u30d5\u30a3\u30ab\u30eb\u306a\u30c6\u30fc\u30d6\u30eb\u304c\u8868\u793a\u3055\u308c\u308b\u3082\u306e\u3002\u7279\u306b\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u90e8\u5206\u304c\u8981\u3089\u306a\u3044\u306e\u3067\u3042\u308c\u3070\u3001Code First \u3067\u5341\u5206\u3060\u3063\u305f\u308a\u3059\u308b\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-18.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-18.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"528\" height=\"480\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<p>\u300c\u65b0\u3057\u3044\u63a5\u7d9a\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001MySQL Database \u3092\u9078\u3076\u3068\u3001\u63a5\u7d9a\u5148\u306e\u30b5\u30fc\u30d0\u30fc\u540d\u3068\u304b\u3092\u5165\u308c\u308b\u753b\u9762\u304c\u51fa\u308b\u3002\u3053\u3053\u3067\u300c\u30c6\u30b9\u30c8\u63a5\u7d9a\u300d\u3092\u3057\u3066\u63a5\u7d9a\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304a\u304f\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-19.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-19.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"528\" height=\"480\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<p>\u3055\u3066\u3001\u5b9f\u306f Connector\/Net 8.0.11 \u306b\u30d0\u30b0\u304c\u3042\u308b\u3089\u3057\u304f\u3001\u3053\u3053\u306e\u300c\u8a73\u7d30\u8a2d\u5b9a\u300d\u3092\u62bc\u3057\u3066\u3001Ssl Mode \u306e\u5024\u3092\u300cNone\u300d\u306b\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-20.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-20.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"345\" height=\"412\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<p>\u30de\u30cb\u30e5\u30a2\u30eb\u306b\u306f SslMode \u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 None \u306a\u306e\u3060\u3051\u3069\u3001\u521d\u671f\u5024\u304c\u9593\u9055\u3063\u3066\u3044\u308b\u3089\u3057\u304f\u3001\u6b21\u306e\u53d6\u5f97\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u9078\u3076\u3068\u3053\u308d\u3067\u843d\u3061\u3066\u3057\u307e\u3046\u306e\u3060\u3002<\/p>\n<p>SQL Server \u306b LINQ \u3059\u308b\u3068\u304d\u3068\u540c\u3058\u3088\u3046\u306b\u30af\u30e9\u30b9\u5316\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u9078\u3076\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-21.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-21.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"528\" height=\"480\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<p>redmine \u306e projects \u3068 issues \u304c\u7121\u4e8b\u53d6\u5f97\u3067\u304d\u308b\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image-22.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2018\/05\/image_thumb-22.png\" border=\"0\" alt=\"image\" title=\"image\" width=\"419\" height=\"480\" style=\"margin: 0px; border: 0px currentcolor; display: inline; background-image: none;\" \/><\/a><\/p>\n<p>\u3053\u308c\u3067 LINQ \u304c\u4f7f\u3048\u308b\u306e\u3067\u3001<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nprivate void clickGetIssues(object sender, RoutedEventArgs e)\r\n {\r\n     var ent = new RedmineModel.RedmineEntities();\r\n     var q = from t in ent.issues\r\n             where t.project_id == 10\r\n             select t;\r\n     lv.ItemsSource = q.ToList();\r\n }\r\n<\/pre>\n<p>\u3068\u304b<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nprivate void clickGetWpPosts(object sender, RoutedEventArgs e)\r\n{\r\n     var ent = new WordPressModel.WordpressEntities();\r\n     ent.Database.Log = s =&gt; System.Diagnostics.Debug.WriteLine(s);\r\n     var q = from t in ent.posts\r\n             orderby t.post_date descending\r\n             select new { id = t.ID, title = t.post_title, date = t.post_date }\r\n             ;\r\n     q = q.Take(30);\r\n     lv.ItemsSource = q.ToList();\r\n}\r\n<\/pre>\n<p>\u306a\u611f\u3058\u3067\u3001MySQL \u3078 LINQ \u3092\u4f7f\u3063\u3066\u30a2\u30af\u30bb\u30b9\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u3057\u3066\u3044\u308b\u5834\u5408\u306f wordpress \u306e MySQL \u306b\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u306f\u3067\u304d\u306a\u3044\u3060\u308d\u3046\u3051\u3069\u3001\u30ed\u30fc\u30ab\u30eb\u3067\u4f5c\u3063\u3066\u3044\u308b\u3068\u304b\u9ad8\u901f\u306b\u30da\u30fc\u30b8\u3092\u30a2\u30c3\u30d7\u3059\u308b\u3068\u304b\u4fee\u6b63\u3059\u308b\u3068\u304d\u306b\u4fbf\u5229\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e38\u3005\u3001LINQ \u3092\u4f7f\u3046\u305f\u3081\u306b SQL Server \u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u3063\u3066\u3001\u3058\u3083\u3042\u3001Linux+MySQL\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u5bfe\u3057\u3066 C#+LINQ \u306f\u3069\u3046\u30a2\u30af\u30bb\u30b9\u3059\u308c\u3070\u3088\u3044\u306e\u304b\uff1f\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u3044\u3064\u306e\u9593\u306b\u304b Entity F &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/9093\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[23,38],"tags":[],"class_list":["post-9093","post","type-post","status-publish","format-standard","hentry","category-csharp","category-mysql"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/9093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=9093"}],"version-history":[{"count":4,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/9093\/revisions"}],"predecessor-version":[{"id":9098,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/9093\/revisions\/9098"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=9093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=9093"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=9093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}