/// <summary> /// Gets for vendor id. Inserts if no entity is found. /// </summary> /// <param name="vendorid"></param> /// <returns></returns> public VendorConfiguration GetForVendor(int vendorid) { var domainmodel = _vendorconfigurationrepository.TableNoTracking .Where(i => i.VendorId == vendorid) .SingleOrDefault(); if (domainmodel == null) { domainmodel = new VendorConfiguration() { VendorId = vendorid, ShippingCost = 0m }; _vendorconfigurationrepository.Insert(domainmodel); } return(domainmodel); }
private static void ScheduleJob(IScheduler scheduler, WorkflowJobConfig jobConfig, VendorConfiguration configuration) { var map = new JobDataMap(); map.SetLateDependencyBundle(configuration); var job = JobBuilder .Create(jobConfig.JobType) .SetJobData(map) .Build(); var trigger = TriggerBuilder.Create() .StartNow() .WithSimpleSchedule(schedule => schedule .WithIntervalInSeconds(60) .RepeatForever()) .Build(); scheduler.ScheduleJob(job, trigger); //job resolving is in Quartz\LifetimeScopeJobFactory.cs }
public void Update(VendorConfiguration vendorConfiguration) { _vendorconfigurationrepository.Update(vendorConfiguration); }