Created
September 10, 2013 09:24
-
-
Save hagbarddenstore/6507019 to your computer and use it in GitHub Desktop.
WCF service example with DTOs per request/response pair.
This file contains hidden or 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
| [ServiceContract] | |
| public interface IRegistrator | |
| { | |
| [OperationContract] | |
| RegisterResponse Register(RegisterRequest request); | |
| } |
This file contains hidden or 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
| [DataContract] | |
| public class RegisterRequest | |
| { | |
| [DataMember] | |
| public string Username { get; set; } | |
| [DataMember] | |
| public string Password { get; set; } | |
| } |
This file contains hidden or 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
| [DataContract] | |
| public class RegisterResponse | |
| { | |
| [DataMember] | |
| public Guid UserId { get; set; } | |
| } |
This file contains hidden or 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
| public class Registrator : IRegistrator | |
| { | |
| public RegisterResponse Register(RegisterRequest request) | |
| { | |
| throw new NotImplementedException(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment