Skip to content

Instantly share code, notes, and snippets.

@avegaraju
Created February 21, 2019 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avegaraju/9c71b7d3b946211332bc51220b67737b to your computer and use it in GitHub Desktop.
Save avegaraju/9c71b7d3b946211332bc51220b67737b to your computer and use it in GitHub Desktop.
public class OrdersResponseCreator : IResponseCreator
{
public Response CreateResponse()
{
var orderCreatedResponse = new OrderCreatedResponse
{
Message = "Order created.",
OrderId = (uint)new Random().Next(int.MaxValue)
};
return new ResponseBuilder().WithContent(orderCreatedResponse, new JsonContentSerializer())
.WithStatusCode(HttpStatusCode.Created)
.Build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment