简体   繁体   中英

ASP.NET Core richtexteditor devexpress blazor

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 class

Error CS0116
A namespace cannot directly contain members such as fields or methods

Error CS0501
'.RichEdit(BuilderFactory, string)' must declare a body because it is not marked abstract, extern, or partial TextEditor

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" ...
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM