Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Services expose methods (Operation Contracts) to the client. Your interface doesn't have any methods, so there's nothing to implement (from a service perspective).</p> <p>You could do something like this:</p> <pre><code>[ServiceContract] public interface INewUser { [OperationContract] UserInfo CreateNewUser(string userName); } </code></pre> <p>Then in the implementing class, you'd have:</p> <pre><code>public NewUser : INewUser { public UserInfo CreateNewUser(string userName) { return new UserInfo() { UserName = "John Doe", UserRole = 5, LoweredUserName = "john doe" }; } } </code></pre> <p><code>UserInfo</code> would be the class used to represent the info, per your original code, marked as a data contract:</p> <pre><code>[DataContract] public class UserInfo { [DataMember] public string UserName { get; set; } [DataMember] public int UserRole { get; set; } [DataMember] public string LoweredUserName { get; set; } } </code></pre> <p>This is a trivial example based on your above code, to show you how it can all go together.</p> <p><strong>HOWEVER</strong></p> <p>What you really should do is look at your existing library, wrap the <em>functionality</em> in a WCF service, and mark the <code>NewUser</code> class up as a data contract. It looks like you're focusing on the data, and you should first focus on the functionality.</p> <p>Put another way, what methods in your current library <strong>use</strong> <code>NewUser</code>, as either inputs or return types - that is what goes into the service, not the properties of the <code>NewUser</code> class.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload