[英]Is it possible to reference a C# class that's not defined in a .nswag file?
I have a .Net Core project with multiple APIs that are generated by using Swagger (Nswag). 我有一个.Net Core项目,具有使用Swagger(Nswag)生成的多个API。 I also have a few projects that contain shared classes that are used in multiple of the APIs and are not generated.
我也有一些项目,这些项目包含在多个API中使用但未生成的共享类。
Now I want one generated controller method to return an object of a type that's specified in one of these model projects and written by myself (not generated by Swagger) 现在,我希望一个生成的控制器方法返回一个在这些模型项目之一中指定并由我自己编写的类型的对象(不是由Swagger生成)
Is this even possible and, if yes, how can I achieve it? 这是否有可能,如果可以,我将如何实现?
您可以从生成中排除一些dto(我认为是它的ExcludedTypes设置),然后在您的命名空间中添加using(AdditionalNamespaceUsages)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.