public bool CreateSpecifications(Specification specificationModel, int recordID) { try { CatalogDatabaseDataContext context = new WorkLinqToSql.CatalogDatabaseDataContext(); WorkLinqToSql.Specification specification = new WorkLinqToSql.Specification(); WorkLinqToSql.MachineSpecification machinespecification = new MachineSpecification(); specification.Name = specificationModel.Name; specification.Value = specificationModel.Value; machinespecification.MachineID = recordID; machinespecification.Specification = specification; context.Specifications.InsertOnSubmit(specification); context.MachineSpecifications.InsertOnSubmit(machinespecification); context.Specifications.Context.SubmitChanges(); context.MachineSpecifications.Context.SubmitChanges(); } catch { return(false); } return(true); }
public static IExpectProducer ForMachine() => MachineSpecification.Initialize();