{"id":438,"date":"2019-03-13T22:20:13","date_gmt":"2019-03-13T19:20:13","guid":{"rendered":"http:\/\/localhost\/bilisimkurdu\/?p=438"},"modified":"2019-03-13T22:20:13","modified_gmt":"2019-03-13T19:20:13","slug":"c-entity-framework-uzerinden-select-ve-like-deyimleri","status":"publish","type":"post","link":"http:\/\/localhost\/bilisimkurdu\/c-entity-framework-uzerinden-select-ve-like-deyimleri\/","title":{"rendered":"C# Entity Framework \u00fczerinden “Select” ve “Like” deyimleri"},"content":{"rendered":"\n

Merhaba Muhterem Ziyaret\u00e7iler,<\/p>\n\n\n\n

Bu yaz\u0131mda C# Entity Framework \u00fczerinden birtak\u0131m sorgular\u0131 yap\u0131lmas\u0131 \u00fczerinden duraca\u011f\u0131m.<\/p>\n\n\n\n

Bildi\u011finiz \u00fczere C# derslerini Youtube \u00fczerinden yay\u0131nlamaktayd\u0131m. Yapt\u0131\u011f\u0131n\u0131z geri bildirimlerinize istinaden dersleri blog \u00fczerinden yo\u011funla\u015ft\u0131rmaya karar verdim.<\/p>\n\n\n\n\n\n\n\n

\u015eimdi ba\u015flayal\u0131m;<\/p>\n\n\n\n

Where<\/strong><\/p>\n\n\n\n

SQL dilinde “Where” ifadesini a\u015fa\u011f\u0131daki gibi kullan\u0131yorduk;<\/p>\n\n\n\n

SELECT secilecekSatir FROM tabloAdi WHERE i \/\/i = Where sorgusunda kullan\u0131lan ifadeler<\/code><\/pre>\n\n\n\n

Entity sorgumuzda kulland\u0131\u011f\u0131m\u0131z context ve entitiesleri tan\u0131mlad\u0131\u011f\u0131m\u0131z varsayarak;<\/p>\n\n\n\n

s<\/strong> parametrasiyle studentName de\u011feri “Bill” de\u011ferini i\u00e7eren \u00f6geleri listeledik.<\/p>\n\n\n\n

\/\/Entity Framework \n\/\/SchoolDBEntities tan\u0131mlad\u0131\u011f\u0131m\u0131z\u0131 varsay\u0131yoruz.\nusing (var context = new SchoolDBEntities())\n{\n    var query = context.Students\n                       .where(s => s.StudentName == \"Bill\")\n                       .FirstOrDefault<Student>();\n}<\/code><\/pre>\n\n\n\n

Like<\/strong><\/p>\n\n\n\n

SQL dilinde “Like” ifadesini a\u015fa\u011f\u0131daki gibi kullan\u0131yorduk; <\/p>\n\n\n\n

SELECT secilecekSatir FROM tabloAdi WHERE \nsatir LIKE i \/\/i = Like sorgusunda kullan\u0131lan ifadeler<\/code><\/pre>\n\n\n\n

Entity sorgumuzda kulland\u0131\u011f\u0131m\u0131z context ve entitiesleri tan\u0131mlad\u0131\u011f\u0131m\u0131z varsayarak; <\/p>\n\n\n\n

person<\/code> de\u011fi\u015fkenini context.People<\/code> i\u00e7ine al\u0131n\u0131p where person.FirstName.Like(\"Col%\")<\/code>deyiminden sonra se\u00e7ilmekte.<\/p>\n\n\n\n

var query =\n    from person in context.People\n    where person.FirstName.Like(\"Col%\")\n    select person;<\/code><\/pre>\n\n\n\n

Bu yaz\u0131mla birlikte C# Entity Framework temel sorgular\u0131 anlatm\u0131\u015f oldum.<\/p>\n\n\n\n

E\u011fer bu yaz\u0131yla ili\u015fkin anlatamad\u0131\u011f\u0131m\\anla\u015f\u0131lamayan konular varsa yaz\u0131n\u0131n alt\u0131na yorum yapabilirsiniz.<\/p>\n\n\n\n

\u0130yi ak\u015famlar.<\/p>\n","protected":false},"excerpt":{"rendered":"

Merhaba Muhterem Ziyaret\u00e7iler, Bu yaz\u0131mda C# Entity Framework \u00fczerinden birtak\u0131m sorgular\u0131 yap\u0131lmas\u0131 \u00fczerinden duraca\u011f\u0131m. Bildi\u011finiz \u00fczere C# derslerini Youtube \u00fczerinden yay\u0131nlamaktayd\u0131m. Yapt\u0131\u011f\u0131n\u0131z geri bildirimlerinize istinaden dersleri blog \u00fczerinden yo\u011funla\u015ft\u0131rmaya karar verdim.<\/p>\n","protected":false},"author":3,"featured_media":234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[89,90,84,85],"tags":[266,267,268,269,270,271,272,348,490,637],"_links":{"self":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/posts\/438"}],"collection":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":0,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/media\/234"}],"wp:attachment":[{"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost\/bilisimkurdu\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}