Advertisement
Guest User

ServiceStack Error Response Example

a guest
Mar 20th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1.     [Route("/customer")]
  2.     public class CustomerRequest
  3.     {
  4.         public string Name { get; set; }
  5.         public bool IsActive { get; set; }
  6.     }
  7.  
  8.     public class CustomerService : Service
  9.     {
  10.  
  11.         public object Any(CustomerRequest request)
  12.         {
  13.             if (request.Name == null)
  14.             {
  15.                 throw new ArgumentException("Name is required");
  16.             }
  17.  
  18.             //  var objCustomer = //get customer from DB
  19.  
  20.             return null;
  21.         }
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement