- Type of response is still predictable for the client
- On exception, response can still be created on the fly (generic must be new())
- End-user isn't force to compose all properties in one single response DTO
- End-user doesn't need to follow naming convention
Created
January 2, 2012 13:52
-
-
Save steff-mueller/1550758 to your computer and use it in GitHub Desktop.
ServiceStack improvement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[RestService("/users", Verbs = "POST, GET")] | |
public class User | |
{ | |
... | |
} | |
public class UserResponse | |
{ | |
... | |
} | |
public class UserCreationResponse | |
{ | |
... | |
} | |
public class UserService : ServiceBase, | |
IGetResponse<UserResponse>, | |
IPostResponse<UserCreationResponse> | |
{ | |
public UserResponse OnGet() | |
{ | |
... | |
return new UserResponse(); | |
} | |
public UserCreationResponse OnPost() | |
{ | |
... | |
return new UserCreationResponse(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment