Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
        public int Save(DataContext dc, Domain.GreenhouseUser greenhouseUser)
        {
            dc = dc ?? Conn.GetContext();
            var dbGreenhouseUser = dc.GreenhouseUsers.Where(g => g.GreenhouseUserId == greenhouseUser.ID).SingleOrDefault();
            var isNew = false;
            if (dbGreenhouseUser == null)
            {
                dbGreenhouseUser = new GreenhouseUser();
                isNew = true;
            }

            dbGreenhouseUser.UserId = greenhouseUser.UserID;
            dbGreenhouseUser.GreenhouseId = greenhouseUser.GreenhouseID;

            if (isNew)
            {
                dc.GreenhouseUsers.InsertOnSubmit(dbGreenhouseUser);
            }
            dc.SubmitChanges();

            greenhouseUser.ID = dbGreenhouseUser.GreenhouseId;

            return greenhouseUser.ID;
        }
 partial void DeleteGreenhouseUser(GreenhouseUser instance);
 partial void UpdateGreenhouseUser(GreenhouseUser instance);
 partial void InsertGreenhouseUser(GreenhouseUser instance);
		private void detach_GreenhouseUsers(GreenhouseUser entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_GreenhouseUsers(GreenhouseUser entity)
		{
			this.SendPropertyChanging();
			entity.Greenhouse = this;
		}