Home Using a ternary operator in a lambda expression gives "Only Assignment, Call, Increment, Decrement ... as a statement" exception
 I'm getting a "Only Assignment, Call, Increment, Decrement, Await Expression and New Object expressions can be used as a statement" error with the following ternary operator: @using (Html.BeginForm( x => (Model.Id == -1 ? x.Create() : x.Edit(Model.Id) ) , FormMethod.Post, new { @class = "form-horizontal", id = "save-assetType-form" }))  And a "A lambda expression with a statement body cannot be converted to an expression tree" error for the following code: @using (Html.BeginForm(x => { if (Model.Id == -1) x.Create(); else x.Edit(Model.Id); }, FormMethod.Post, new { @class = "form-horizontal", id = "save-assetType-form" })) }  Is there a way to achieve concise conditional logic in my lambda here? Having trouble with the syntax.