public void SavePeriodicElement(Contract.PeriodicElement periodicElement)
        {
            Database.Models.PeriodicElement dbPeriodicElement = NetCoreAngularDbContext.PeriodicElements.FirstOrDefault(x => x.ID == periodicElement.ID);

            if (dbPeriodicElement == null)
            {
                NetCoreAngularDbContext.PeriodicElements.Add(dbPeriodicElement = new Database.Models.PeriodicElement()
                {
                    ID = periodicElement.ID
                });
            }

            Mapper.Map(periodicElement, dbPeriodicElement);

            foreach (Contract.Isotope isotope in periodicElement.Isotopes)
            {
                Database.Models.Isotope dbIsotope = NetCoreAngularDbContext.Isotopes.FirstOrDefault(x => x.ID == isotope.ID);

                if (dbIsotope == null)
                {
                    NetCoreAngularDbContext.Isotopes.Add(dbIsotope = new Database.Models.Isotope()
                    {
                        ID = isotope.ID
                    });
                }

                Mapper.Map(isotope, dbIsotope);
            }

            NetCoreAngularDbContext.SaveChanges();
        }
        public Contract.PeriodicElement DetailPeriodicElementByID(Guid periodicElementID)
        {
            Contract.PeriodicElement resourcePeriodicElement = NetCoreAngularDbContext.PeriodicElements.FirstOrDefault(x => x.ID == periodicElementID).DeepCopyTo <Contract.PeriodicElement>();
            resourcePeriodicElement.Isotopes = NetCoreAngularDbContext.Isotopes.Where(x => x.PeriodicElementID == periodicElementID).ToArray().DeepCopyTo <Contract.Isotope[]>();

            return(resourcePeriodicElement);
        }