コード例 #1
0
        public void DeleteHardwareIdentificationLevel1(string hardwareIdentificationLevel1Name)
        {
            EntityFramework.HardwareIdentificationLevel1 hardwareIdentificationLevel1 =
                databaseContext.HardwareIdentificationLevel1.Where(x => x.Name == hardwareIdentificationLevel1Name).FirstOrDefault();

            if (hardwareIdentificationLevel1 != null)
            {
                databaseContext.HardwareIdentificationLevel1.Remove(hardwareIdentificationLevel1);
                databaseContext.SaveChanges();
            }
        }
コード例 #2
0
        public void EditHardwareIdentificationLevelel1(string hardwareIdentificationLevel1Name, string oldHardwareIdentificationLevel1Name)
        {
            EntityFramework.HardwareIdentificationLevel1 hardwareIdentificationLevel1ToUpdate =
                databaseContext.HardwareIdentificationLevel1.Where(x => x.Name == oldHardwareIdentificationLevel1Name).FirstOrDefault();

            if (hardwareIdentificationLevel1ToUpdate != null)
            {
                hardwareIdentificationLevel1ToUpdate.Name = hardwareIdentificationLevel1Name;
            }

            databaseContext.SaveChanges();
        }