Exemplo n.º 1
0
 public static CustomResultSet <TModel> MapResults <TEntity, TModel>(CustomResultSet <TEntity> results) where TModel : IModel <TModel, TEntity>, new()
 {
     return(new CustomResultSet <TModel>
     {
         CurrentPage = results.CurrentPage,
         PageSize = results.PageSize,
         RecordCount = results.RecordCount,
         aaData = results.aaData.Select(c => new TModel().MapEntity(c)).ToList(),
         sEcho = results.sEcho
     });
 }
Exemplo n.º 2
0
        internal static ContentResult ContentResult(CustomResultSet <T> results)
        {
            var serializer = new JavaScriptSerializer
            {
                MaxJsonLength  = Int32.MaxValue,
                RecursionLimit = 100
            };

            return(new ContentResult
            {
                Content = serializer.Serialize(results),
                ContentType = "application/json",
            });
        }