O'Reilly logo

ASP.NET Web API by Joydip Kanjilal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Security Service

Here is the complete code of Security Service that we will use.

The following code snippet illustrates the ISecurityService interface. This is the service contract.

[ServiceContract]
  public interface ISecurityService
  {
    /// <summary>
    /// GetAllUsers operation contract
    /// </summary>
    /// <returns></returns>
    [OperationContract]
    List<UserAuthentication> GetAllUsers();

    /// <summary>
    /// GetUserByID operation contract
    /// </summary>
    /// <param name="userID"></param>
    /// <returns></returns>
    [OperationContract]
    List<UserAuthentication> GetUserByID(Int32 userID);
  }

The following SecurityService class implements the ISecurityService interface:

public class SecurityService : ISecurityService { /// <summary> /// GetAllUsers service method /// ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required