本文整理汇总了C#中Response.Return方法的典型用法代码示例。如果您正苦于以下问题:C# Response.Return方法的具体用法?C# Response.Return怎么用?C# Response.Return使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Response
的用法示例。
在下文中一共展示了Response.Return方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteResult
/// <summary>
///
/// </summary>
/// <param name="context"></param>
public override void ExecuteResult(ControllerContext context)
{
Response response = new Response(true);
response.Success = this.Success;
response.Message = this.Message;
response.Data = JSON.Serialize(this.Data);
response.Return();
}
示例2: ExecuteResult
public override void ExecuteResult(ControllerContext context)
{
switch (this.ResponseFormat)
{
case StoreResponseFormat.Load:
StoreResponseData storeResponse = new StoreResponseData();
storeResponse.Data = JSON.Serialize(this.Data);
storeResponse.TotalCount = this.TotalCount;
storeResponse.Return();
break;
case StoreResponseFormat.Save:
Response response = new Response(true);
response.Success = this.SaveResponse.Success;
response.Msg = this.SaveResponse.ErrorMessage;
StoreResponseData saveResponse = new StoreResponseData();
saveResponse.Confirmation = this.SaveResponse.ConfirmationList;
response.Data = saveResponse.ToString();
response.Return();
break;
default:
throw new ArgumentOutOfRangeException();
}
}