简体   繁体   English

将C#控制台应用程序合并到MVC 4应用程序中

[英]merge C# console application into an MVC 4 app

I am writing to get suggestions and opinions. 我写信是为了寻求建议和意见。

I have a console application that is using a SOAP Web Service. 我有一个使用SOAP Web服务的控制台应用程序。

I have finished implementing all the logic I need in a console app and now I need to build a web page for it. 我已经完成了在控制台应用程序中所需的所有逻辑的实现,现在需要为其构建一个网页。

I am thinking of using MVC instead of C# Web Application as suggested by peers. 我正在考虑使用MVC代替同行建议的C#Web应用程序。

I hope that I can get some pointers of how to start working with this. 我希望我可以从中获得一些有关如何开始使用此工具的指示。

How could I merge the existing project into the MVC project? 如何将现有项目合并到MVC项目中? and would all of my back end logic sit in the model part?? 并将我所有的后端逻辑都放在模型部分中吗? I am getting confused about the MVC concept. 我对MVC概念感到困惑。

Your backend logic would sit in a Controller Action Method, where you would eventually create a strongly typed Model or dynamically into the ViewBag dynamic type. 您的后端逻辑将位于Controller Action Method中,在该方法中您最终将创建一个强类型的Model或动态地添加到ViewBag动态类型中。 Your View (aspx or cshtml) would consume that information and bind it to the page. 您的View(aspx或cshtml)将使用该信息并将其绑定到页面。

Please see http://www.asp.net/mvc/tutorials for more information/tutorials. 有关更多信息/教程,请参见http://www.asp.net/mvc/tutorials

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM