Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从主体生成通用参数的招摇过市模型_C#_Asp.net Core_Swagger_Swashbuckle_Nswag - Fatal编程技术网

C# 从主体生成通用参数的招摇过市模型

C# 从主体生成通用参数的招摇过市模型,c#,asp.net-core,swagger,swashbuckle,nswag,C#,Asp.net Core,Swagger,Swashbuckle,Nswag,我目前正在做一个项目,我们会自动生成所有控制器。我们的BaseController有一个类似这样的操作: [HttpPost("")] public virtual Task<IActionResult> Create([FromBody] ICreateEntityModel<TBaseEntity> model) { return ProcessActionAsync(model); } 接口只是一个标记,API用户对

我目前正在做一个项目,我们会自动生成所有控制器。我们的BaseController有一个类似这样的操作:

    [HttpPost("")]
    public virtual Task<IActionResult> Create([FromBody] ICreateEntityModel<TBaseEntity> model)
    {
        return ProcessActionAsync(model);
    }

接口只是一个标记,API用户对此不感兴趣。是否有方法为实际类型(在本例中为Person)而不是接口生成模型?我是缺少正确的配置还是需要额外的处理器?

使用
[ProducesResponseType(200,typeof(…)]
指定给定状态代码的响应类型。

[ProducesResponseType(typeof(ErrorMessage),StatusCodes.Status400BadRequest]

为我工作

   ICreateEntityModelOfPerson:{  
     type:"object",
     x-abstract:true,
     additionalProperties:false
   }