public ReadOnlyCollection <TResult> QueryAll <TResult>( WmiQueryBase wmiQuery, ManagementObjectSearcher searcher = null) where TResult : class, new() { ManagementObjectCollection source = this.QueryAll(wmiQuery.SelectQuery, searcher); return(new ReadOnlyCollection <TResult>(source != null ? (IList <TResult>)source.Cast <ManagementBaseObject>().Select <ManagementBaseObject, TResult>(new Func <ManagementBaseObject, TResult>(WmiService.Extract <TResult>)).ToList <TResult>() : (IList <TResult>)null)); }
public TResult QueryFirst <TResult>(WmiQueryBase wmiQuery) where TResult : class, new() { ManagementBaseObject managementBaseObject = QueryFirst(wmiQuery.SelectQuery); if (managementBaseObject != null) { return(Extract <TResult>(managementBaseObject)); } return(null); }
// Token: 0x06000111 RID: 273 RVA: 0x0000436C File Offset: 0x0000256C public TResult QueryFirst <TResult>(WmiQueryBase wmiQuery) where TResult : class, new() { ManagementBaseObject managementBaseObject = this.QueryFirst(wmiQuery.SelectQuery, null); if (managementBaseObject != null) { return(WmiService.Extract <TResult>(managementBaseObject)); } return(default(TResult)); }
public ReadOnlyCollection <TResult> QueryAll <TResult>(WmiQueryBase wmiQuery, ManagementObjectSearcher searcher = null) where TResult : class, new() { return(new ReadOnlyCollection <TResult>(QueryAll(wmiQuery.SelectQuery, searcher)?.Cast <ManagementBaseObject>().Select(Extract <TResult>).ToList())); }