Reputation: 11
My code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DevExpress.AspNetCore.RichEdit;
using DevExpress.AspNetCore;
using DevExpress.Web.Mvc.UI;
using DevExpress.Blazor.RichEdit;
using System.Runtime;
namespace TextEditor.Pages
{
public static RichEditBuilder RichEdit(this BuilderFactory factory,
string name
);
}
I get these errors:
Error CS1106
Extension method must be defined in a non-generic static classError CS0116
A namespace cannot directly contain members such as fields or methodsError CS0501
'.RichEdit(BuilderFactory, string)' must declare a body because it is not marked abstract, extern, or partial TextEditor
Upvotes: 0
Views: 197
Reputation: 755013
You need to have a public static class RichEditUtils
which then contains this method of yours - you cannot have that method directly in the namespace level...
namespace TextEditor.Pages
{
public static class RichEditUtils
{
public static RichEditBuilder RichEdit(this BuilderFactory factory, string name)
{
// do something here that ends up returning a "RichEditBuilder" ...
}
}
}
Upvotes: 0