public IHttpActionResult GetActivityWidgets() { widgetManager = new WidgetManager(); int suplatformID = -1; if (Request.Properties.TryGetValue("SubPlatformID", out object _customObject)) { suplatformID = (int)_customObject; } List <Widget> widgets = widgetManager.GetWidgetsForActivities(suplatformID).ToList(); if (widgets == null) { return(NotFound()); } return(Ok(Mapper.Map(widgets.ToList(), new List <UserWidgetDTO>()))); }