using System;
namespace Abp.Web.Models
{
///
/// This class is used to create standard responses for AJAX requests.
///
[Serializable]
public class AjaxResponse: AjaxResponseBase
{
///
/// The actual result object of AJAX request.
/// It is set if is true.
///
public TResult Result { get; set; }
///
/// Creates an object with specified.
/// is set as true.
///
/// The actual result object of AJAX request
public AjaxResponse(TResult result)
{
Result = result;
Success = true;
}
///
/// Creates an object.
/// is set as true.
///
public AjaxResponse()
{
Success = true;
}
///
/// Creates an object with specified.
///
/// Indicates success status of the result
public AjaxResponse(bool success)
{
Success = success;
}
///
/// Creates an object with specified.
/// is set as false.
///
/// Error details
/// Used to indicate that the current user has no privilege to perform this request
public AjaxResponse(ErrorInfo error, bool unAuthorizedRequest = false)
{
Error = error;
UnAuthorizedRequest = unAuthorizedRequest;
Success = false;
}
}
}