예제 #1
0
        public static Molecule InsertMolecule(this dcFertilizer dc, string moleculeSymbol, IEnumerable<Molecule> c)
        {
            Molecule mol = new Molecule
            {
                Symbol = moleculeSymbol
            };
            mol.ElementMolecules.AddRange(dc.GetElementMoleculeBySymbol(moleculeSymbol));
            mol.FigureAtomicWeight();

            //TODO:Verify that the Molecule is valid(this takes a bit of chemistry to do.
            dc.Molecules.InsertOnSubmit(mol);

            dc.SubmitChanges();
            return mol;
        }