Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Coincidentally, Stack Exchange hired the original Service Stack authorauthor. He continues to commit actively to the Service Stack project.

Coincidentally, Stack Exchange hired the original Service Stack author. He continues to commit actively to the Service Stack project.

Coincidentally, Stack Exchange hired the original Service Stack author. He continues to commit actively to the Service Stack project.

added 5 characters in body; Post Made Community Wiki
Source Link
Kyle
  • 2.8k
  • 18
  • 24

Either WebAPI or Service Stack might be good candidates for building your back end API. I recommend Service Stack, as I've been using it for the last few months and have found it to be an excellent replacement to WCF. I'm currently writing a tutorial series on service stack on my blogblog.

Either WebAPI or Service Stack might be good candidates for building your back end API. I recommend Service Stack, as I've been using it for the last few months and have found it to be an excellent replacement to WCF. I'm currently writing a tutorial series on service stack on my blog.

Either WebAPI or Service Stack might be good candidates for building your back end API. I recommend Service Stack, as I've been using it for the last few months and have found it to be an excellent replacement to WCF. I'm currently writing a tutorial series on service stack on my blog.

Change old sample code to use ServiceStack's new API
Source Link
[DataContract]
[RestService[Route("/customers", "GET"]
[RestService[Route("/customers/search/{SearchTerm}", "GET"]
[RestService[Route("/customers/region/{Region}", "GET"]
[RestService[Route("/customers/region/{Region}/search/{SearchTerm}", "GET"]
public class Customers 
{
  [DataMember]
  public int? RegionId { get; set; }
  [DataMember]
  public string SearchTerm { get; set; }
}

public class CustomersService : RestServiceBase<Customer>Service
{
  public override classpublic OnGetobject Get(Customers request) {
        // handle request
 
        return new CustomersResponse();
    }
}
[DataContract]
[RestService("/customers", "GET"]
[RestService("/customers/search/{SearchTerm}", "GET"]
[RestService("/customers/region/{Region}", "GET"]
[RestService("/customers/region/{Region}/search/{SearchTerm}", "GET"]
public class Customers 
{
  [DataMember]
  public int? RegionId { get; set; }
  [DataMember]
  public string SearchTerm { get; set; }
}

public class CustomersService : RestServiceBase<Customer>
{
  public override class OnGet(Customers request) {
    // handle request
 
    return new CustomersResponse();
  }
}
[Route("/customers", "GET"]
[Route("/customers/search/{SearchTerm}", "GET"]
[Route("/customers/region/{Region}", "GET"]
[Route("/customers/region/{Region}/search/{SearchTerm}", "GET"]
public class Customers 
{
    public int? RegionId { get; set; }
    public string SearchTerm { get; set; }
}

public class CustomersService : Service
{
    public object Get(Customers request) {
        // handle request
        return new CustomersResponse();
    }
}
added 164 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 152 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 38 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 538 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 538 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 538 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 538 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 538 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
added 538 characters in body
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading
Source Link
Kyle
  • 2.8k
  • 18
  • 24
Loading