c# - Returning related elements in a single query (Is my query bad?) -
Hey, I have a table of those products with regards to myself, these table products, their sub-products , And then stores sub-sub-products. When a user searches for the top-most product, this query should be returned to parents, children, and children of his children. Now, my query works, but I am normally new to the structure of the organization and SQL, so I'm not sure that this is a way to do what should be done. To make things a little more hairy, I'm searching for many fields in the table.
else {productQuery = solutions in b. Presentation. Example (b.Product.Name == Search || B.Product.Description == Search || B.Product.product 2.Name == Search || B.Product.Product 2.Description ==Search || B Product Product 2. Product 2. Name == Search || B. Product.Product2.Product.Description == Search) Order by B.Product LastNumber Ascending Selection B; }
For clarification, Product 2 is a relationship that goes from child to parent.
Subsection: In the future, I want to search for a child. Return to the parents of my parents, and parents, the way I am currently going to do this Some lambda expressions are to be added and what I did, but raising the relationship is it smart?
There is really nothing wrong with this query. Certainly, the expected access to related members is likely to be in L2E.
Consider using Syntax:
b.Product.Name.Equals (Search, String Companion, Ordinal Ignore Case)
Search should usually be case-insensitive
Comments
Post a Comment