blob: eb7e7ff39ee36ced5d76d8390853e830c6e9556d [file] [log] [blame]
Constantin Ziesche08215502020-09-21 19:08:32 +02001/*******************************************************************************
2* Copyright (c) 2020 Robert Bosch GmbH
3* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
4*
5* This program and the accompanying materials are made available under the
6* terms of the Eclipse Public License 2.0 which is available at
7* http://www.eclipse.org/legal/epl-2.0
8*
9* SPDX-License-Identifier: EPL-2.0
10*******************************************************************************/
11using BaSyx.Models.Core.AssetAdministrationShell.Identification;
12using System;
13using System.Collections.Generic;
14using System.Linq;
15using System.Linq.Expressions;
16
17namespace BaSyx.Models.Core.Common
18{
19 public class QueryableElementContainer<TElement> : ElementContainer<TElement>, IQueryableElementContainer<TElement> where TElement : IReferable, IModelElement
20 {
21 private readonly IQueryable<TElement> _queryable;
22 public QueryableElementContainer(IReferable parent, IEnumerable<TElement> list) : base(parent, list)
23 {
24 _queryable = list.AsQueryable();
25 }
26
27 public Type ElementType => _queryable.ElementType;
28
29 public Expression Expression => _queryable.Expression;
30
31 public IQueryProvider Provider => _queryable.Provider;
32
33 IEnumerator<TElement> IEnumerable<TElement>.GetEnumerator()
34 {
35 return _queryable.GetEnumerator();
36 }
37 }
38}