Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC & Web Services

Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC?

That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution).

Should I add this to the Controller or Model layer?

like image 276
ANaimi Avatar asked Sep 23 '08 03:09

ANaimi


People also ask

What is ASP.NET MVC explain?

The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System. Web.

Is ASP.NET MVC still used?

ASP.NET MVC is no longer in active development. The last version update was in November 2018. Despite this, a lot of projects are using ASP.NET MVC for web solution development. As to JetBrains' research, 42% of software developers were using the framework in 2020.

Is ASP.NET and MVC the same?

ASP.NET is a web platform. It provides a layer that sits on top of IIS (the web server) which facilitates the creation of web applications and web services. ASP.NET MVC is a framework specifically for building web applications. It sits ontop of ASP.NET and uses APIs provided by ASP.NET.

Is ASP.NET MVC easy to learn?

It's really difficult to try and learn an entirely new language/framework under pressure. If you're required to deliver working software for your day job, trying to learn ASP.NET Core at the same time might be heaping too much pressure on yourself.


1 Answers

It sounds like you should split out your model into its own assembly and reference it from your MVC-application and WCF-application.

  • YourApp.Data -- Shared model and data access maybe
  • YourApp.Web -- If you want to share more across your web-apps
  • YourApp.Web.Mvc
  • YourApp.Web.WebService

If you want to do WebServices MVC-style maybe you should use MVC to build your own REST-application.

like image 84
Seb Nilsson Avatar answered Oct 05 '22 14:10

Seb Nilsson