private void InsertDVD(Profiler.DVD profile) { _currentDVDEntity = new Entity.tDVD() { DVDId = profile.ID, CaseSlipCover = profile.CaseSlipCoverSpecified ? profile.CaseSlipCover : (bool?)null, CollectionNumber = profile.CollectionNumber, DistTrait = profile.Edition, EasterEggs = profile.EasterEggs, LastEdited = profile.LastEditedSpecified ? profile.LastEdited : (DateTime?)null, Notes = profile.Notes, OriginalTitle = profile.OriginalTitle, Overview = profile.Overview, ProductionYear = profile.ProductionYear != 0 ? profile.ProductionYear : (int?)null, Rating = profile.Rating, Released = profile.ReleasedSpecified ? profile.Released : (DateTime?)null, RunningTime = profile.RunningTime != 0 ? profile.RunningTime : (int?)null, SortTitle = profile.SortTitle, SRPDenomination = profile.SRP?.Value != 0 ? profile.SRP.DenominationType : null, SRPValue = profile.SRP?.Value != 0 ? (decimal)profile.SRP.Value : (decimal?)null, tCaseType = !string.IsNullOrEmpty(profile.CaseType) ? _baseData.CaseType[profile.CaseType] : null, tCollectionType = _baseData.CollectionType[profile.CollectionType], Title = profile.Title, UPC = profile.UPC, WishPriority = profile.WishPriority, }; _context.tDVD.Add(_currentDVDEntity); IncreaseCurrent(); }
internal void Insert(IEnumerable <Profiler.DVD> profiles) { if (profiles == null) { return; } var valid = profiles.Where(IsNotNull).Where(dvd => !string.IsNullOrEmpty(dvd.ID)).ToList(); _maxProgress = valid.Count; ReportStart(); var counter = 0; foreach (var profile in valid) { Insert(profile); if (((++counter) % 100) == 0) { _context.ChangeTracker.DetectChanges(); _context.SaveChanges(); } } _context.ChangeTracker.DetectChanges(); _context.SaveChanges(); _currentDVDEntity = null; foreach (var profile in valid) { InsertBoxSetChildren(profile); } _context.ChangeTracker.DetectChanges(); _context.SaveChanges(); ReportFinish(); }
public EnhancedNotesInserter(Entity.CollectionEntities context, Entity.tDVD currentDVDEntity, Profiler.PluginData pluginData) { _context = context; _currentDVDEntity = currentDVDEntity; _pluginData = pluginData; }
public DigitalDownloadInfoInserter(Entity.CollectionEntities context, Entity.tDVD currentDVDEntity, Profiler.PluginData pluginData) { _context = context; _currentDVDEntity = currentDVDEntity; _pluginData = pluginData; }