aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL/Builders/RMLExtentionsCollectionBuilder.cs
blob: e1b91f216206fbac5fb1ef27d2f9634106b9137b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using System.Data.Entity;
using Tango.BL.Enumerations;

namespace Tango.BL.Builders
{
    public class RMLExtentionsCollectionBuilder : EntityCollectionBuilderBase<RmlsExtension, RMLExtentionsCollectionBuilder>
    {
        public RMLExtentionsCollectionBuilder(ObservablesContext context) : base(context)
        {
        }
       
        public virtual RMLExtentionsCollectionBuilder WithUsers()
        {
            return AddStep(2, () =>
            {
                foreach (var rmlExtention in Entities)
                {
                    new UsersCollectionBuilder(Context).Set(x => x.Guid == rmlExtention.UsersGuid).WithAddress().WithContacts().Build();
                }
            });
        }

        public virtual RMLExtentionsCollectionBuilder WithYarnProperties()
        {
            return AddStep(1, () =>
            {
                Context.YarnApplications.ToList();
                Context.YarnBrands.ToList();
                Context.YarnWhiteShades.ToList();
                Context.YarnFamilies.ToList();
                Context.YarnGlossLevels.ToList();
                Context.YarnGroups.ToList();
                Context.YarnIndustrysectors.ToList();
                Context.YarnManufacturers.ToList();
                Context.YarnSubFamilies.ToList();
                Context.YarnTexturings.ToList();
                Context.YarnTypes.ToList();
            });
        }
    }
}