Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Technologies: Javascript for $http call, ASP.NET Web API, MSSQL for data retrieval

Web API will return array of widget objects with following properties:

WidgetId, WidgetAttribute1 Bool, WidgetAttribute2 Bool, WidgetAttribute3 Bool, etc. attributes to return is defined by user.

Basically, we are returning the widget's attributes, where each attribute is a True/False. True if attribute exists for the widget, false if not. The exact attributes to return will be defined by the user. The available list of attributes (50-100) is pre-defined. User selects the attributes he/she cares about (will be a subset of the total), and API should only return those.

My idea for approach: User posts simple array with list of WidgetAttributeIds he/she wants returned. Web API looks at simple array and executes query according to the present Ids.

Should i use a stored procedure and pass in parameters of which attributes to return, or should i construct the query within the web api controller, then pass it to sql server?

share|improve this question
    
Possible duplicate: stackoverflow.com/questions/22907/… –  thorsten müller Nov 9 at 7:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.