Exemple #1
0
 /// <summary>
 /// Json通用返回格式:返回成功
 /// </summary>
 /// <param name="dataTable"><see cref="DataTable"/></param>
 /// <param name="count">数据量(默认为 <see cref="DataTable.Rows"/> 的Count)</param>
 /// <returns>
 /// Json格式 : {code:0,data:DataTable,count:DataTable.Rows.Count,message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseSuccess(DataTable dataTable, int count = 0) => HttpResponseMessageResultFormat.ResponseSuccess(dataTable, count);
Exemple #2
0
 /// <summary>
 /// Json通用返回格式:返回成功
 /// </summary>
 /// <param name="data">要返回的数据</param>
 /// <param name="count">返回的数据行数(默认为1,数据为null则为0)</param>
 /// <returns>
 /// Json格式 : {code:0,data:data,count:1,message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseSuccess <T>(T data, int count = 1) => HttpResponseMessageResultFormat.ResponseSuccess(data, count);
Exemple #3
0
 /// <summary>
 /// Json通用返回格式:返回成功
 /// </summary>
 /// <param name="list"><see cref="List{T}"/></param>
 /// <param name="count">数据量(默认为 <see cref="List{T}.Count"/>)</param>
 /// <returns>
 /// Json格式 : {code:0,data:List,count:List.Count(),message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseSuccess <T>(List <T> list, int count = 0) => HttpResponseMessageResultFormat.ResponseSuccess(list, count);
Exemple #4
0
 /// <summary>
 /// Json通用返回格式:返回成功
 /// </summary>
 /// <returns>
 /// Json格式 : {code:0,data:"",count:0,message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseSuccess() => HttpResponseMessageResultFormat.ResponseSuccess();