Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
        /// <summary>
        /// Save a Preset
        /// </summary>
        /// <param name="dc">DataContext</param>
        /// <param name="preset"></param>
        /// <returns>returns the id of the saved preset</returns>
        public int Save(DataContext dc, Domain.Preset preset)
        {
            dc = dc ?? Conn.GetContext();
            var dbPreset = dc.Presets.Where(p => p.PresetID == preset.ID).SingleOrDefault();
            var isNew = false;
            if (dbPreset == null)
            {
                dbPreset = new Preset();
                isNew = true;
            }

            dbPreset.Name = preset.Name;
            dbPreset.UserID = preset.UserID;
            dbPreset.IdealTemperature = preset.IdealTemperature;
            dbPreset.TemperatureThreshold = preset.TemperatureThreshold;
            dbPreset.IdealLightIntensity = preset.IdealLightIntensity;
            dbPreset.LightIntensityThreshold = preset.LightIntensityThreshold;
            dbPreset.IdealHumidity = preset.IdealHumidity;
            dbPreset.HumidityThreshold = preset.HumidityThreshold;
            dbPreset.IdealWaterLevel = preset.IdealWaterLevel;
            dbPreset.WaterLevelThreshold = preset.WaterLevelThreshold;
            dbPreset.IsGlobal = preset.IsGlobal;
            dbPreset.DateUpdated = DateTime.Now;

            if (isNew)
            {
                dbPreset.DateCreated = DateTime.Now;
                dc.Presets.InsertOnSubmit(dbPreset);
            }
            dc.SubmitChanges();
            return dbPreset.PresetID;
        }
 partial void DeletePreset(Preset instance);
 partial void UpdatePreset(Preset instance);
 partial void InsertPreset(Preset instance);
		private void detach_Presets(Preset entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_Presets(Preset entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}