Skip to content

Instantly share code, notes, and snippets.

@slmcmahon
Created December 7, 2010 20:56
Show Gist options
  • Save slmcmahon/732395 to your computer and use it in GitHub Desktop.
Save slmcmahon/732395 to your computer and use it in GitHub Desktop.
Container for transferring data between a client application and an ASP.NET server
namespace AppServer.Models
{
/// <summary>
/// This is a generic server response container that provides a way to
/// transfer any serializable type between the client and the server with
/// meta info about the data being transferred
/// </summary>
/// <typeparam name="T">The type of the Payload Property</typeparam>
public class ServerResponse<T>
{
/// <summary>
/// Holds the data that we want to return from the server
/// </summary>
public T Payload { get; set; }
/// <summary>
/// Indicates whether or not the action on the server was successful
/// </summary>
public bool Success { get; set; }
/// <summary>
/// Contains any messages that need to accompany the payload. This is
/// generally used to contain any exception mesages encountered during
/// the server operation.
/// </summary>
public string Message { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment