Sculpture Community  Sculpture Discu...  General  Repository Methods for Entity
Previous Previous
 
Next Next
New Post 7/21/2010 3:51 PM
  fhoogduin
5 posts


Repository Methods for Entity 
Modified By fhoogduin  on 7/21/2010 8:32:51 AM)

 Let's say I have a very simple Entity 'Settings' with the following members:

  • ID : Int32
  • Name : String
  • Value : String

ID is the primary key, without meaning. Name is unique.

The generated data access repository methods will be -among others- "Settings GetSettings(Int32 iD);" and "IQueryable<Settings> GetAll();". I want to add a method like "Settings GetSettings(string name);".

Is there a way to do this as a Repository Mehod on the Entity in the model? I noticed two problems:

  1. Sculpture complains when creating an overloaded 'GetSettings'.
  2. I can not find a way to specify parameters for a Repository Method.

 

Or is the only way to do this, to code it completely by hand in de CustomCode files?

Regards,

F

 
New Post 7/21/2010 4:53 PM
  fhoogduin
5 posts


Re: Repository Methods for Entity 

 Ok, I partly answered my own questions.

Specifying parameters for repository methods:

  1. select the repository method, open the sculpture details window and there is a Parameter Editor
  2. right click on the repository method, select "Locate in Explorer", right click on the method in the Sculpture Explorere and select "Add New Parameter"

I still can't create a method with the same name as the default "GetSettings" though.

 
Previous Previous
 
Next Next
  Sculpture Community  Sculpture Discu...  General  Repository Methods for Entity
Users Minimize
 
Membership Membership:
Latest New User Latest: EricNichols
New Today New Today: 3
New Yesterday New Yesterday: 4
User Count Overall: 2776

People Online People Online:
Visitors Visitors: 0
Members Members: 0
Total Total: 0

Online Now Online Now: