I am working in an MVC web application. This application also use WCF service and Entity-framework. In solution explorer I have two projects 1. MVC 2. WCF Service. I am little bit confuse how should I use entities in MVC and WCF service.
For instance I have created Employee.cs class in Model folder in MVC. And in controller I call a method of Get Employee() of WCF service which returns employee class type. In WCF service how I will return as employee type because I added that class in Model folder of MVC project which is not accessible to MY WCF service project.
So in this case how I should use that entity in such way that it can be accessible to MVC as well to my WCF service.
Please let me know you need more clarification..

Nimit JoshiPosted Jul 8, 2014, 2:20 AM
If you still want to use that then you should have to create the Employee table in the database and add that table using the ADO.NET Entity Data Model in the WCF Project. Then you can use Entity Framework to access the entity class.
Ramesh MaruthiPosted Jul 2, 2014, 11:30 AM
Even I started working on MVC5 recently, what we are doing means in entity framework we are going with database first approach, so we are not creating any models and we are getting all the entities from database to wcf service layer by using ado.entity file(or) we call .edmx file and we are using those entities and writing some services, and in mvc we are just adding those service wsdl and calling those methods and getting the objects.
look at the below urls, it might be helpful for you :)
http://www.codeproject.com/Articles/581273/WCF-Services-Development-with-Entity-Framework
http://www.codeproject.com/Articles/434282/A-N-Tier-Architecture-Sample-with-ASP-NET-MVC-WCF
http://code.msdn.microsoft.com/MVC-4-Open-Framework-296fa001