Say I have products and receipts in many ways. Is there a way in which I can directly query product.receipts or receipt.products and get Iqueryable without reference to join_table at all?
I assume you are using Linq-to-SQL.
The answer is "no, but ..."
You can work with many relationships in Linq-to-SQL, but you need to have a separate type representing the connection table.
If you just want, for example, a databind against a child property of a model object, you can do something really simple: -
public partial class Order { public IEnumerable<Product> Products { get { return Order_Details.Select(x => x.Product); } } }
select-n-plus-one, , .
: http://www.iaingalloway.com/2015/06/many-to-many-relationships-in-linq-to-sql.html .
, : -
LINQ --: ?
LINQ?
.
Linq to Entities, Entity Framework - . , Linq Sql , ( ) Linq NHibernate . ( , NHibernate --)
Source: https://habr.com/ru/post/1730855/More articles:How to add combobox and button to info area on google map? - iphoneHow long should the SAML token be installed - samlJSF link in SelectItem shortcut - jsfHow to search in 5 different fields with all possible options not defined in MySQL using LIKE - sqlкак вы получаете доступ к переменным, определенным в masterpage.master.vb, в masterpage.master - syntaxRe: Saving the loaded files in MyDocuments - c #Token indentation in PowerPoint 2007 compatibility mode through .NET interop issue - .nethttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1730858/how-to-create-a-datetime-nicely-which-is-today-at-2300&usg=ALkJrhisacpAlvzzAoODe6SsLDSqayes4gregex expression logic - regexhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1730860/windows-performance-analysis-tool-usage-as-a-profiler&usg=ALkJrhjLv2fV1DpFbimCvQcJohkgBZa9JwAll Articles