public void UpdatePartData(PartCatalog part, string partId) { var partToUpdate = _partCatalogContext.Find(partId); if (partToUpdate != null) { _logger.Info("Found record Id " + partToUpdate.Id + " in Table " + tableNameUsedByLogger); partToUpdate.PartName = part.PartName; partToUpdate.PartCategoryId = part.PartCategoryId; _partCatalogContext.Commit(); _logger.Info("Updated record Id " + partToUpdate.Id + " in Table " + tableNameUsedByLogger); } }
private void Register(StyleCopCore core) { this.registrationLifetimes.Next( lifetime => { Dictionary <SourceAnalyzer, List <StyleCopRule> > analyzerRulesDictionary = StyleCopRule.GetRules(core); // Not the best way of doing this, but better than reflection. Create a "fake" parts catalogue // that contains parts representing the attributes that we would specify if we were doing this // "properly" and not dynamically based on the rules loaded by StyleCop and any addins (this is // compounded by allowing addins to be different per-solution, thanks to the settings subsystem). // Adding the catalogue to the global parts catalogue causes ReSharper to automatically evaluate // it, and automatically remove it when the lifetime is terminated. IPartsCatalogue catalogue = this.CreateFakeCatalogue(analyzerRulesDictionary); PartCatalog catalog = catalogue.WrapLegacy(); this.partsCatalogueSet.Catalogs.Add(lifetime, catalog, null); }); }
public void PostNewPartToDB(PartCatalog part) { _partCatalogContext.Insert(part); _partCatalogContext.Commit(); _logger.Info("Inserted record Id " + part.Id + " into Table " + tableNameUsedByLogger); }