小编use*_*483的帖子

如何在CKEditor中自动为img标签添加类或属性?

我正在使用CKEditor版本3.6

我想自动添加class="newsleft"到通过WYSIWYG 添加的任何图像标签.

我看过几篇提到dataProcessor的帖子,但不知道应该添加哪个文件或者怎么做.

有人能告诉我在哪里放置以下代码吗?

editor.dataProcessor.htmlFilter.addRules(
{
    elements:
    {
        img: function( element )
        {
            if ( !element.attributes.alt )
                element.attributes.alt = 'An image';
        }
    }
} );
Run Code Online (Sandbox Code Playgroud)

javascript ckeditor

7
推荐指数
3
解决办法
9507
查看次数

InvalidOperationException: 没有为此 DbContext 配置数据库提供程序。

使用 entityframeworkcore 2.03 .net core 构建一个 web api

不断收到以下错误尝试了我能想到的一切来克服它不知道问题是什么其他人有这个问题吗?

InvalidOperationException: 没有为此 DbContext 配置数据库提供程序。可以通过覆盖 DbContext.OnConfiguring 方法或在应用程序服务提供者上使用 AddDbContext 来配置提供者。如果使用 AddDbContext,则还要确保您的 DbContext 类型在其构造函数中接受 DbContextOptions 对象并将其传递给 DbContext 的基本构造函数

启动文件

using churchy.Repository;
    using churchy.Service;
    using churchy.Service.Abstractions;
    using Microsoft.AspNetCore.Builder;
    using Microsoft.AspNetCore.Hosting;
    using Microsoft.EntityFrameworkCore;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.DependencyInjection;

namespace churchy
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public …
Run Code Online (Sandbox Code Playgroud)

.net c# entity-framework asp.net-core-webapi asp.net-core-2.0

0
推荐指数
1
解决办法
1923
查看次数