diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/Tango.BL/Builders/EntityCollectionBuilderBase.cs | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/Builders/EntityCollectionBuilderBase.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Builders/EntityCollectionBuilderBase.cs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Builders/EntityCollectionBuilderBase.cs b/Software/Visual_Studio/Tango.BL/Builders/EntityCollectionBuilderBase.cs index d4d65c16d..a0cd24511 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/EntityCollectionBuilderBase.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/EntityCollectionBuilderBase.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; @@ -14,7 +13,6 @@ namespace Tango.BL.Builders private List<KeyValuePair<int, Action>> _steps; private List<KeyValuePair<int, Func<IQueryable<T>, IQueryable<T>>>> _querySteps; private bool _entity_set; - private Func<IQueryable<T>, IQueryable<T>> _appendQuery; protected IEnumerable<T> Entities { get; set; } @@ -40,11 +38,6 @@ namespace Tango.BL.Builders query = queryStep.Value(query); } - if (_appendQuery != null) - { - query = _appendQuery(query); - } - Entities = query.ToList(); }); @@ -65,11 +58,6 @@ namespace Tango.BL.Builders query = queryStep.Value(query); } - if (_appendQuery != null) - { - query = _appendQuery(query); - } - Entities = query.ToList(); }); @@ -83,12 +71,6 @@ namespace Tango.BL.Builders return query; } - public TBuilder Query(Func<IQueryable<T>, IQueryable<T>> query) - { - _appendQuery = query; - return this as TBuilder; - } - protected void CommitSteps() { foreach (var step in _steps.ToList().DistinctBy(x => x.Key).OrderBy(x => x.Key)) @@ -122,18 +104,6 @@ namespace Tango.BL.Builders return Entities.ToSynchronizedObservableCollection(); } - public List<T> BuildList() - { - if (!_entity_set) - { - throw new InvalidOperationException("Could not build entity. Entity was not set."); - } - - CommitSteps(); - - return Entities.ToList(); - } - public Task<SynchronizedObservableCollection<T>> BuildAsync() { return Task.Factory.StartNew<SynchronizedObservableCollection<T>>(() => @@ -141,13 +111,5 @@ namespace Tango.BL.Builders return Build(); }); } - - public Task<List<T>> BuildListAsync() - { - return Task.Factory.StartNew<List<T>>(() => - { - return BuildList(); - }); - } } } |
