如何为现有的ASP.NET extjs应用程序实现API [英] How to implement API for the existing ASP.NET extjs application

查看:84
本文介绍了如何为现有的ASP.NET extjs应用程序实现API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨开发者,



我需要澄清我的问题。



我有一个申请。它分为4个主要项目。



Quote:



1.Libraries Projects:跨应用程序使用的通用类。

2.Windows服务:(代理,代理)。

3.Admin接口:WinForms管理员界面。这适用于管理员用户。

4.UI:用户提交请求的Web界面。此用户界面使用vs2010和extJS 3.5实现







应用程序运行正常,

但是这里的问题知道我们得到了最新的请求,就像我们想要为当前应用程序实现API一样。创建API的主要原因是,我们希望通过在任何其他项目中调用这个新实现的API来使用上述应用程序。

我们可以说通过调用API我们必须提交任何其他项目的请求其他应用



上述场景中的任何想法或建议都会发布给我。



什么我试过了:



现在没有尝试过,现在我正在努力从哪里开始以及如何开始,我是否需要创建单独的应用程序或者我是否需要将API项目添加到当前的UI项目中。

解决方案

如果您希望api共存,那么这主要是部署问题。如果它正在服务于任何其他有效的应用程序,也取决于它。所以说你的2. 3.或4.也需要使用它,这可以提倡为什么要共同定位它,但通常人们选择分离关注点,我个人已经两种方式,取决于前面提到的,通常我们正在为设备等提供http,而且不必部署和调试单独的实例是有意义的。



无论如何,我们大多数人使用.net使用web api 2,除非.net核心是一个选项。这就像从nuget添加它一样简单,它适用于webforms和mvc一样



NuGet Gallery | Microsoft.AspNet.WebApi 5.2.3 [ ^ ]

Hi Developers,

I needed a clear clarification for my question.

I am having one application. It was divided in to 4 major projects.

Quote:


1.Libraries Projects: genericized classes for use across applications.
2.Windows services: (Agent, Broker).
3.Admin Interface: WinForms administrator interface. This is for admin users.
4.UI: Web interface for users submitting requests. This User Interface Implemented using vs2010 and extJS 3.5



Application works fine very well,
But the problem here know we got the latest request like we wanted to implement the API for the current application. The main reason for creating the API is, we wanted to use the above application by calling this newly implemented API in any other projects.
We can say by calling the API we have to submit the requests from any other applications

Any ideas or suggestions n above mentioned scenario kindly post me.

What I have tried:

Nothing tried as of now, now I am struggling where to start and how to start, whether do I need to create separate application or do I need to add the API project to the our current UI Project.

解决方案

It's mostly a deployment issue, if you want your api to coexist. Depends on also if it's serving any of the other applications in effect. so say your 2. 3. or 4. would also need to use it, that could advocate as to why to co-locate it, but often people choose to seperate the concerns, i personally have been going both ways, depending on aforemetioned, often we're serving http to devices etc and it makes sense not to have to deploy and debug seperate instances.

Anyway, most of us using .net use web api 2, unless .net core is an option. That's as easy as adding it from nuget and it works on webforms and mvc alike

NuGet Gallery | Microsoft.AspNet.WebApi 5.2.3[^]


这篇关于如何为现有的ASP.NET extjs应用程序实现API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆