{"id":1967,"date":"2015-02-22T18:18:56","date_gmt":"2015-02-22T16:18:56","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=1967"},"modified":"2015-02-22T18:18:56","modified_gmt":"2015-02-22T16:18:56","slug":"net-fejtoro-5-megoldas","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2015\/02\/22\/net-fejtoro-5-megoldas\/","title":{"rendered":".NET fejt\u00f6r\u0151 5. &#8211; megold\u00e1s"},"content":{"rendered":"<p>A <a href=\"http:\/\/soci.hu\/blog\/index.php\/2015\/02\/09\/net-fejtoro-5\/\">fejt\u00f6r\u0151<\/a>.<\/p>\n<p>Moln\u00e1r Csaba olyan teljesen megv\u00e1laszolta a k\u00e9rd\u00e9st (k\u00f6sz\u00f6net \u00e9rte), hogy a kommentj\u00e9t egy az egyben bepaszt\u00e1zom:<\/p>\n<p>C#-ban az idexer egy indexelt property, aminek alap\u00e9rtelmezetten Item a neve. Ez\u00e9rt ford\u00edt\u00e1si hib\u00e1t kapunk enn\u00e9l a k\u00f3dn\u00e1l, hogy m\u00e1r van defin\u00edci\u00f3 az Item-re.<br \/>\nEzt k\u00e9tf\u00e9le m\u00f3don tudjuk elker\u00fclni:<br \/>\n1. Az Item property-t \u00e1tnevezz\u00fck valami m\u00e1sra.<br \/>\n2. Haszn\u00e1ljuk az indexeren az IndexerNameAttribute-ot, amivel megadhatjuk, hogy milyen n\u00e9ven j\u00f6jj\u00f6n l\u00e9tre az indexer (ne Item n\u00e9ven).<\/p>\n<p>\u00c9n szem\u00e9ly szerint nem er\u0151ltetn\u00e9m a n\u00e9v\u00fctk\u00f6z\u00e9st, ink\u00e1bb v\u00e1lasztan\u00e9k m\u00e1s nevet. <\/p>\n<p>Ami pluszk\u00e9nt \u00e9rdekes a p\u00e9ld\u00e1ban (nekem nem volt mag\u00e1t\u00f3l \u00e9rtet\u0151d\u0151), hogy lehet haszn\u00e1lni a params m\u00f3dos\u00edt\u00f3t indexer eset\u00e9n is. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A fejt\u00f6r\u0151. Moln\u00e1r Csaba olyan teljesen megv\u00e1laszolta a k\u00e9rd\u00e9st (k\u00f6sz\u00f6net \u00e9rte), hogy a kommentj\u00e9t egy az egyben bepaszt\u00e1zom: C#-ban az idexer egy&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,10,4,93],"tags":[],"class_list":["post-1967","post","type-post","status-publish","format-standard","hentry","category-net","category-c","category-szakmai-elet","category-teaser"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1967"}],"version-history":[{"count":1,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1967\/revisions"}],"predecessor-version":[{"id":1968,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1967\/revisions\/1968"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}