ASP.NET MVC4 to WCF DataServices - asp.net-mvc

I have a ASP .NET MVC4 application using Entity framework CodeFirst and I want to expose its data with WCF data services. I don't know where and how to begin.
Could you give me ways to follow ?
My final goal is to deploy this service on Windows Azure PaaS.

Create a new Web Application project within your solution and add a new WCF DataServices item.
This WCF DataSercices should reference the same business layer as the one you might use within your controllers/model builders in your ASP .Net MVC4 application.
Then have a look here to learn about how to deploy on Azure.

Related

What is difference between Entity Framework and web service in ASP.NET MVC?

I really want to know what is difference between web service and Entity Framework as I'm not getting the below requirement in an ASP.NET project.
Use .NET project (MVC or Webforms), C# & SQL Server to do the following:
Create a web service for all the database calls (reading & writing)
For all database queries use stored procedures to call them

Silverlight/RIA Services and ASP .NET MVC/WebAPI

I did some research around but I have some doubts still about following topic...
I have Silverlight/RIA Services project that needs to have ASP.NET MVC look as well as WebAPI for some different clients.
So my question is following
Can we use somehow RIA Services with ASP.NET MVC 5?
And if not what is a painless way to represent all existing logic in ASP.NET MVC?
Thank you!
Ria services have nothing to do with look and feel.
A Silverlight app or a non plugin, which uses RIA services can be hosted in a web page created using ASP.Net.
Can we use somehow RIA Services with ASP.NET MVC 5?
Yes.
RIA services which could be used by an asp.net backend would not gain the benefit of RIA services because changes made in the backend end are not generated forward to an application such as a Silverlight plugin. It just becomes another way of accessing data.

What could be best MVC project structure with web API?

I am an MVC.NET developer but never used API web service before in an MVC project.
I just want to know like for WCF services we use different project in the application usually. Likewise, what is best practice likewise for web API services and how they work with proxy design patterns extra?
In my current application I am using WCF services but I am keen to learn if API web service can replace it and how?
yes , you can replace with API service.
For your project structure , you can refer below link content.
Implement ASP.Net Web API in ASP.Net MVC 5
http://www.c-sharpcorner.com/UploadFile/4b0136/implement-Asp-Net-web-api-2-in-Asp-Net-mvc-5/

When Creating a WCF service

I have already a MVC-webapplication, I wounder should I create a new WCF Service Application or should I insert a service in same webapp under the folder "Model"?
What is the best solution?
If the WCF service is exposing models from your MVC project, I would stick it it the same project. If it has logic pertained to code outside the MVC solution, I would create a separate application.

WCF Service with asp.net mvc application

I have started using asp.net MVC and as traditional way I want to keep my data access layer in WCF service. How can I achieve that using asp.net MVC ?
Scenario
I started a test application in asp.net MVC which Displays, Inserts and Edit data.
I successfully created that by adding 'ADO.Net Entity Data Model'.
So now if I wanted to move this dataaccess layer in WCF service, i.e. a WCF service with methods like GetData(), UpdateData(), CreateNewData(), how can i achieve that?
Short Answer:
You just need to move your dataaccess layer into a WCF service, expose it and then call it from your MVC application.
Long Answer:
1) I recommend going through Scott Guthrie's Nerd Dinner walkthrough to get a really good understanding of MVC basics.
2) The following blog goes through the process of writing a Layered ASP.NET MVC Applicaiton with a WCF Service (Parts III & IV specifically concentrate on WCF & MVC interaction):
Part I (General Concepts)
Part II (Building a Repository)
Part III (Building The Service)
Part IV (Using The Service)
I haven't read the linked arrticles in detail (just skimmed them) but they seem to give a decent overview of the process.
Asp.net MVC Application With Wcf Service
http://patilranjeet.blogspot.in/2014/11/aspnet-mvc-with-wcf-sample.html

Resources