Hi
I am having problems performing a simple linq query against a STE in my WCF.
I have one table in my DB named 'User_Main' and I have used LLBLGen Pro v3.0 (July 12th, 2010 release) to generate the 2 STE projects (model + persistence).
In my WCF service I have 1 class and 1 method
[ServiceContract]
public interface IMyService
{
[OperationContract]
string testFunc(int userID);
}
public class myService : IMyService
{
public string testFunc(int userID)
{
using (myLlblgenEfv4DataContext context = new myLlblgenEfv4DataContext())
{
UserMain userMain = context.UserMains.Where(c => c.Id == userID).SingleOrDefault();
return userMain.EmailAddress;
}
}
}
I have referenced both the model and the persistence projects as well as system.data.entity.
This WCF compiles fine and I can add the service reference to my consuming website. However, when i call the testFunc() form my website I get the following error when it tries to execute my Linq statement:
'An error occurred while executing the command definition. See the inner exception for details.'
going further into the Inner exception i get:
'Invalid object name 'dbo.User_Main''
Looks like there's a mapping issue. Am I doing something stupid in my Linq query? Have I missed a reference? Is there a property that I have not set properly in the designer? I am totally stumped.
Any help woud be appreciated.
Thanks