Skip to content

Instantly share code, notes, and snippets.

@hagbarddenstore
Created September 10, 2013 09:24
Show Gist options
  • Save hagbarddenstore/6507019 to your computer and use it in GitHub Desktop.
Save hagbarddenstore/6507019 to your computer and use it in GitHub Desktop.
WCF service example with DTOs per request/response pair.
[ServiceContract]
public interface IRegistrator
{
[OperationContract]
RegisterResponse Register(RegisterRequest request);
}
[DataContract]
public class RegisterRequest
{
[DataMember]
public string Username { get; set; }
[DataMember]
public string Password { get; set; }
}
[DataContract]
public class RegisterResponse
{
[DataMember]
public Guid UserId { get; set; }
}
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