>>aspnetApplication[] applications = new aspnetApplication[dc.aspnet_Applications.Count}];
>>
>>aspnetApplication[] applications = dc.aspnet_Applications.ToArray();Update: But there's something wrong there. Logically it would be
aspnet_Applications[] applications = dc.aspnet_Applications.ToArray();
public CentralSecurityResponse<aspnetApplication[]> GetAllApplications() { var response = new CentralSecurityResponse<aspnetApplication[]>(); try { using (var dc = new l2sCentralSecurityDataContext()) { List<aspnetApplication> apps = new List<aspnetApplication>(); foreach (var app in dc.aspnet_Applications) { aspnetApplication aspnetApp = new aspnetApplication { ApplicationId = app.ApplicationId, ApplicationName = app.ApplicationName, ConfigurationId = app.ConfigurationID, Description = app.Description }; apps.Add(aspnetApp); } response.Data = apps.ToArray(); ; return response; } } catch (Exception ex) { LogEvent.Invoke(new LogEventArgs(System.Diagnostics.EventLogEntryType.Error, ex.ToString(), "")); response.IsError = true; response.Error = ex; return response; } }