简体   繁体   English

有没有一种有效的方法可以将C#类增量从Web api 2.2应用传播到测试器应用?

[英]is there an efficient way to propogate c# class deltas from a web api 2.2 app to a tester app?

Is there an efficient way to propogate c# classes from a web api 2.2 app to a tester app? 有没有一种有效的方法可以将c#类从Web api 2.2应用程序推广到测试器应用程序? I have a Web API 2.2 app and I need to consume this service from a C# console tester app. 我有一个Web API 2.2应用程序,我需要通过C#控制台测试器应用程序使用此服务。 So let's say that the Web API 2.2 app has models, request objects, etc. Whenever I cut a new version of the API I'm manually comparing all of the models, request objects, etc, b/t the API and the tester console app and then updating these classes in the tester app with any deltas. 因此,假设Web API 2.2应用程序具有模型,请求对象等。每当我剪切API的新版本时,我都会手动比较所有模型,请求对象等,包括API和测试器控制台应用程序,然后使用任何增量更新测试器应用程序中的这些类。 These classes exist in my tester app, each with a namespace reflecting its existence in the tester app. 这些类存在于我的测试器应用程序中,每个类都有一个反映其在测试器应用程序中的存在的名称空间。 So are there any processes or tools which would simplify the process of keeping these models and request classes in sync between these 2 apps? 那么,是否有任何流程或工具可以简化使这些模型和请求类在这两个应用程序之间保持同步的过程?

As I understand it, you create your model in API project and have a duplicate of those classes in a test project and other projects and when you change a class in API you have to change same classes in other projects ... 据我了解,您可以在API项目中创建模型,并在测试项目和其他项目中具有这些类的副本,并且当您在API中更改类时,必须在其他项目中更改相同的类...

you can separate your model classes in other project and then add reference model project, to API and test and all projects that you need so when you change a model its syncs in all projects 您可以在其他项目中分离模型类,然后将参考模型项目添加到API和测试以及您需要的所有项目中,因此当您更改模型时,其在所有项目中的同步

Make a new Class Library project, put your models in there, then have both the app and webapi refer to the classes in that library. 新建一个“类库”项目,将模型放入其中,然后让app和webapi都引用该库中的类。 Then you can push that dll to both when it changes. 然后,您可以在该dll更改时将其同时推送到两者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用我的API中的访问令牌对C#MVC Web应用程序进行身份验证的最佳方法 - Best way to authenticate a C# MVC web app using an access token from my API 我如何从 web api 获取数据到 ac# windows 窗体应用程序类 - How do i get data from a web api into a c# windows forms app class vNext中具有Web API的c#控制台应用 - c# Console App With Web API In vNext 在C#Web API中的现有类中添加属性是否会影响角度应用程序UI? - Does adding the property in existing class in C# Web API impact the angular app UI? 使用HttpClient进行C#制作Web测试工具 - C# making web tester tool with HttpClient 反序列化 c# 中的 json 从 web 在 Z240AA2CEC4B29C56F3BEE520A8DCEE7ZE - deserialize json in c# from the web in a c# console app 在C#中从控制台应用程序中的列表获取数据到Web应用程序 - Get data from a list in a console app to web app in c# 在DotNet Core 2.2 Web API C#中创建3层体系结构 - Create 3 Tier Architecture In DotNet Core 2.2 Web API C# 有没有办法将 Windows 控制台应用程序转换为库,然后从 ac# web 应用程序 html 链接调用其中一种方法? - Is there a way to convert a Windows Console app into a library, and then call one of the methods from a c# web application html link? 如何将文件(内容)从Angular 5应用传递到C#.NET Web Api 2? - How to pass a file (contents) from an Angular 5 app to a C# .NET Web Api 2?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM