diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-20 13:27:36 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-20 13:27:36 +0200 |
| commit | c272cdaaa43f7bf2fefcb36bbfe49624fc4a5ff1 (patch) | |
| tree | bcc9ccd584d7cc706f6453e7a906fa3f1485ef53 /Software/Visual_Studio/Tango.BL/Builders | |
| parent | fa8459be63d8f76059d1e71ab86c01e0a13851b5 (diff) | |
| download | Tango-c272cdaaa43f7bf2fefcb36bbfe49624fc4a5ff1.tar.gz Tango-c272cdaaa43f7bf2fefcb36bbfe49624fc4a5ff1.zip | |
Added job runs logger to machine studio.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/Builders')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs | 8 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Builders/JobRunsBuilder.cs | 31 |
2 files changed, 39 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs index a0a88f4a7..d8d58d69b 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/JobBuilder.cs @@ -77,5 +77,13 @@ namespace Tango.BL.Builders new UserBuilder(Context).Set(Entity.UserGuid).Build(); }); } + + public virtual JobBuilder WithJobRuns() + { + return AddStep(6, () => + { + Context.JobRuns.Where(x => x.JobGuid == Entity.Guid).OrderBy(x => x.StartDate).ToList(); + }); + } } } diff --git a/Software/Visual_Studio/Tango.BL/Builders/JobRunsBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/JobRunsBuilder.cs new file mode 100644 index 000000000..0a02c6a23 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Builders/JobRunsBuilder.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using System.Data.Entity; + +namespace Tango.BL.Builders +{ + public class JobRunsBuilder : EntityBuilderBase<JobRun, JobRunsBuilder> + { + public JobRunsBuilder(ObservablesContext context) : base(context) + { + + } + + protected override IQueryable<JobRun> OnSetQuery(IQueryable<JobRun> query) + { + return query.Include(x => x.Job); + } + + public virtual JobRunsBuilder WithJobEvents() + { + return AddStep(2, () => + { + Context.MachinesEvents.Where(x => x.MachineGuid == Entity.Job.MachineGuid && x.DateTime >= Entity.StartDate && x.DateTime <= Entity.EndDate).OrderBy(x => x.DateTime).ToList(); + }); + } + } +} |
