[英]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.