c# - Linq query with a Conditional WHERE Clause -


I'm new to LINQ, I'm upset

I have the following Linux query: - < / P> var orderbieber anches = join all in one order. One on the brunch Branches are equal. One by Branch Order Select the new {branch order group] in the new branch, in the branchOrder group in the new {a.Date, a.paymentMethod} by the debt group. Key.Date, CurrencyAmount = BranchOrderGrouped.Sum (a => a.CurrencyAmount), branch order group .Key.paymentMethod};

I have to include a section where in the above query ... only if there is a winch called a branch ""

I try to use another statement And there is only one question on the question which has been repeated with one, in which there is one section and one is not.

Regards

/ P>

Include

var orderbierch = all in one of the allers. A on AllBranchKeys BranchKey equal b.BranchKey Arderba a.Date Group new branch Order Group in New {a.Date, a.paymentMethod} (Shakhaodersmuhkkakdet, Mudraaamaunt = Shakhaordersmuh. Syuem (A = & gt; A. Karjemount) , Shakhaoder group. Keepamentment method; if (string.IsNullOrEmpty (BranchKeySelected)) {ORDERSByBranches = OrdersByBranches.How (/ * blbabla * /);} return order;

Comments