{"id":72,"date":"2020-02-14T12:02:00","date_gmt":"2020-02-14T12:02:00","guid":{"rendered":"https:\/\/www.mainmind.com\/blog\/?p=72"},"modified":"2022-12-13T22:50:15","modified_gmt":"2022-12-13T22:50:15","slug":"linq-could-not-find-an-implementation-of-the-query-pattern","status":"publish","type":"post","link":"https:\/\/www.mainmind.com\/blog\/linq-could-not-find-an-implementation-of-the-query-pattern\/","title":{"rendered":"TIP: Linq could not find an implementation of the query pattern"},"content":{"rendered":"<p>En modelos de datos generados con LINQ de forma autom\u00e1tica, el acceso separado en diferentes clases puede ocasionar errores del tipo:<\/p>\n<pre class=\"brush:plain;auto-links:false;toolbar:false\" contenteditable=\"false\">CS1936\tCould not find an implementation of the query pattern for source type 'DbSet&lt;nombreTabla&gt;'.  'Where' not found.<\/pre>\n<p>A priori puede parecer un error en la implementaci\u00f3n, alguna modificaci\u00f3n de clases incorrecta, siempre esta la posibilidad de <a href=\"\/post\/actualizar-modelo-edmx-con-los-cambios-de-la-base-de-datos\" target=\"_blank\" rel=\"noopener noreferrer\">volver a generar el modelo de datos<\/a>, si el error persiste debemos comprar que tenemos referenciada el espacio de nombres de LINQ<\/p>\n<pre class=\"brush:csharp;auto-links:false;toolbar:false\" contenteditable=\"false\">using System.Linq;<\/pre>\n<p>Una error tan sencillo y obvio que puede resultar confuso de resolver.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>En modelos de datos generados con LINQ de forma autom\u00e1tica, el acceso separado en diferentes clases puede ocasionar errores del tipo: CS1936 Could not find an implementation of the query pattern for source type &#8216;DbSet&lt;nombreTabla&gt;&#8217;. &#8216;Where&#8217; not found. A priori puede parecer un error en la implementaci\u00f3n, alguna modificaci\u00f3n de clases incorrecta, siempre esta la [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1413,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[72,112,79,113],"class_list":["post-72","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bases-de-datos","tag-error","tag-implementation","tag-linq","tag-query-pattern"],"_links":{"self":[{"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":0,"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/media\/1413"}],"wp:attachment":[{"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mainmind.com\/blog\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}