public TranspondersWorkflow(IVantageContext context, ITransponderCodeConverter transponderCodeConverter) { this.context = context; this.transponderCodeConverter = transponderCodeConverter; context.ProxyCreationEnabled = false; context.LazyLoadingEnabled = false; }
private static async Task ImportPeopleAsync(IVantageContext context, ICollection <Person> people) { var identifiers = people.Select(p => p.Id); var existingPeople = await(from p in context.Persons.Include(p => p.Licenses) where identifiers.Contains(p.Id) select p).ToListAsync(); foreach (var item in from np in people join ep in existingPeople on np.Id equals ep.Id into g from ep in g.DefaultIfEmpty() select new { New = np, Existing = ep }) { if (item.Existing == null) { context.Persons.Add(item.New); } else { Mapper.Map(item.New, item.Existing); foreach (var license in from nl in item.New.Licenses join el in item.Existing.Licenses on new { nl.IssuerId, nl.Discipline, nl.Key } equals new { el.IssuerId, el.Discipline, el.Key } into g from el in g.DefaultIfEmpty() select new { New = nl, Existing = el }) { if (license.Existing == null) { context.PersonLicenses.Add(license.New); } else { Mapper.Map(license.New, license.Existing); } } } } await context.SaveChangesAsync(); }
private static async Task ImportReportTemplateAsync(IVantageContext context, Competition competition) { if (competition.ReportTemplate != null) { var reportTemplate = await context.ReportTemplates .FirstOrDefaultAsync(t => t.LicenseIssuerId == competition.LicenseIssuerId && t.Name == competition.ReportTemplate.Name); if (reportTemplate == null) { context.ReportTemplates.Add(competition.ReportTemplate); } else { competition.ReportTemplate = reportTemplate; } } }
public VenuesWorkflow(IVantageContext context) { this.context = context; }
public LicensesWorkflow(IVantageContext context, IDisciplineCalculatorManager calculatorManager, IEventRecorder recorder) { this.context = context; this.calculatorManager = calculatorManager; this.recorder = recorder; }
public PeopleWorkflow(IVantageContext context) { this.context = context; }
public ReportTemplatesWorkflow(IVantageContext context) { this.context = context; }
public PersonCategoriesWorkflow(IVantageContext context) { this.context = context; }
public UserSecurityWorkflow(IVantageContext context) { this.context = context; }
public ClubsWorkflow(IVantageContext context) { this.context = context; }