I have made a complex solution using EF5 (Lets call it EF5), this solution works perfectly fine and has a Logic.cs file,lies at the app_code, which has multiple functions that access , control and modify this solution, So far so good.
I would like that my business’ clients to access these function and I’d like to expose these functions by using WCF.
The steps I did are the following.
- Adding WCF project to the solution where the EF5 project is.
- Writing “OperationContract”s for each of the functions I’d like to expose to my client.
- Try implementing each of the functions by calling the EF5 functions.
The problem lies at the implementation, VS fails to recognize the logic.cs file , and therefore I cannot call the functions and expose my EF5 project to my clients.
I am new with WCF, obviously I’m doing something wrong here.
My question is, how do I expose EF5 project’s functions, that lies in a .cs class , to WCF?
I believe that the major mistake that I made was that I didn’t make a WCF project and added EF5 item to it, but I’m not entirely sure.
Here are the screenshots that displays my steps to add the EF5 Reference to the WCF project.



Thanks
You need to add a reference to your EF5 project from your WCF project.
You also need to make sure all your function to be called in Logic.cs are public.
Also make sure you are ‘using’ the namespace in which those functions are declared.