You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
821 B
31 lines
821 B
using Infrastructure.Web.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Infrastructure.Extensions
|
|
{
|
|
public static class JsonResultExtensions
|
|
{
|
|
public static SelectList SelectList(this JsonResult result)
|
|
{
|
|
return result.Value as SelectList;
|
|
}
|
|
|
|
public static MultiSelectList MultiSelectList(this JsonResult result)
|
|
{
|
|
return result.Value as MultiSelectList;
|
|
}
|
|
|
|
public static T To<T>(this JsonResult result)where T : class
|
|
{
|
|
return result.Value as T;
|
|
}
|
|
|
|
public static List<AjaxSelectListItem> AjaxSelectList(this JsonResult result)
|
|
{
|
|
return result.Value as List<AjaxSelectListItem>;
|
|
}
|
|
}
|
|
}
|