0

I am developing services using Asp.Net Web Api. I am debating on design of our controllers. We have this common scenario where user will be presented with bunch of search field, once he enters the search criteria we will show summary of records (not the complete details), user will select one summary record and can go to details for this.

Ex.

class PersonSummary {
 string FirstName {get;set;}
 string LastName {get;set;}
 string Gender {get;set;}
}
class Person {
 string FirstName {get;set;}
 string LastName {get;set;}
 string Gender {get;set;}
 string SSN {get;set;} 
 string Race {get;set;}
 Address Address {get;set;}
}

User will search by user first\last name and we will show will list of PersonSummary records, he can select one PersonSummary to look at the details (Person record).

Now is it best design that we go with two controllers PersonSummaryController and PersonController?

Thank you.

asked Dec 31, 2014 at 17:18

1 Answer 1

4

I don't see a need for two controllers. You're dealing with one type of resource (Person), but asking for data in two formats (summary and detail). I would leave it at one controller and go on with life.

answered Dec 31, 2014 at 17:37
1
  • I agree. Go on and don't stop even someone shout "SRP" out loud. Commented Jan 1, 2015 at 3:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.