views:

59

answers:

1

Iam implementing entity spaces in C# application and was able to execute queries such as the below one successfully.

coll.query.where(coll.prodlineid.equal("id") if( coll.query.load())

However I need to replace all these queries in the code with Stored procedures. For this I used: coll.Load(esQuerytype.storedprocedure, "testproc", param)

At this point, Iam getting error as 'EntitySpaces.Core.esEntityCollection.Load(EntitySpaces.DynamicQuery.esQueryType, string, params object[])' is inaccessible due to its protection level

esEntityCollection is a metadata file, so I could not change the access modifier there from protected to public.

Help:-)

A: 

In your Custom partial classes (which you've generated), add a method like the following.

public void GetProducts(int LineID)
{
   this.Load( ...<put your stored proc call here>...);
}

Then you can call your stored proc by:

ProductCollection coll = new ProductCollection();
coll.GetProducts(lineID);
davewasthere