cofoundry-cms / cofoundry

Cofoundry is an extensible and flexible .NET Core CMS & application framework focusing on code first development
https://www.cofoundry.org
MIT License
836 stars 146 forks source link

Temp Data . #436

Closed SourabhDhiman77 closed 3 years ago

SourabhDhiman77 commented 3 years ago

Hello I have try to set Collection in TempData .Data is stored in TempData but I have face a issue my page is not working. 500 error display. This is my code private ICollection MapCategories(PagedQueryResult customEntityResult) { var categories = new List(customEntityResult.Items.Count()); try { foreach (var customEntity in customEntityResult.Items) { var model = (CategoryDataModel)customEntity.Model; var category = new CategorySummary(); category.CategoryId = customEntity.CustomEntityId; category.Title = customEntity.Title; category.ShortDescription = model.ShortDescription; category.UrlSlug = customEntity.UrlSlug;

                //category.FullPath = customEntity.PageUrls.FirstOrDefault();
                categories.Add(category);
                TempData["Data"] = categories;
            }
        }
        catch(Exception ex)
        {
            ex.InnerException.ToString();
        }

        return categories;
    }
}

Note-Without tempdata my page is working fine.

HeyJoel commented 3 years ago

What is the exception? It doesn't sound like anything to do with Cofoundry - TempData is an ASP.NET concept.

HeyJoel commented 3 years ago

Closing - inactive and poor description of issue.