Code styling in StringFilterForm

This commit is contained in:
Benedek Farkas
2024-04-16 15:36:35 +02:00
parent d4fea2b07f
commit c9f3330b1c
@@ -7,7 +7,6 @@ using Orchard.Forms.Services;
using Orchard.Localization; using Orchard.Localization;
namespace Orchard.Projections.FilterEditors.Forms { namespace Orchard.Projections.FilterEditors.Forms {
public class StringFilterForm : IFormProvider { public class StringFilterForm : IFormProvider {
public const string FormName = "StringFilter"; public const string FormName = "StringFilter";
@@ -20,9 +19,7 @@ namespace Orchard.Projections.FilterEditors.Forms {
} }
public void Describe(DescribeContext context) { public void Describe(DescribeContext context) {
Func<IShapeFactory, object> form = object form(IShapeFactory shape) {
shape => {
var f = Shape.Form( var f = Shape.Form(
Id: "StringFilter", Id: "StringFilter",
_Operator: Shape.SelectList( _Operator: Shape.SelectList(
@@ -57,9 +54,9 @@ namespace Orchard.Projections.FilterEditors.Forms {
f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.NotContains), Text = T("Does not contain").Text }); f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.NotContains), Text = T("Does not contain").Text });
return f; return f;
}; }
context.Form(FormName, form); context.Form(FormName, (Func<IShapeFactory, object>)form);
} }