示例#1
0
        public virtual object Clone(Dictionary <object, object> clonedObjects, bool includePrimaryKey)
        {
            DashboardUserNote cloned = new DashboardUserNote();

            clonedObjects.Add(this, cloned);
            if (includePrimaryKey)
            {
                cloned._id = this._id;
            }
            cloned._userName = this._userName;
            cloned._noteId   = this._noteId;
            cloned._seenDt   = this._seenDt;
            if (DashboardNote != null)
            {
                if (!clonedObjects.ContainsKey(DashboardNote))
                {
                    cloned.DashboardNote = (DashboardNote)DashboardNote.Clone(clonedObjects, includePrimaryKey);
                }
                else
                {
                    cloned.DashboardNote = (DashboardNote)clonedObjects[DashboardNote];
                }
            }


            return(cloned);
        }
示例#2
0
        public virtual bool Equals(object other, List <object> checked_objects)
        {
            if (checked_objects.Contains(this))
            {
                return(true);
            }

            checked_objects.Add(this);

            DashboardUserNote casted_other = other as DashboardUserNote;

            if (casted_other == null)
            {
                checked_objects.Remove(this);
                return(false);
            }

            if (!Typing.IsEquals(this.Id, casted_other.Id))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.UserName, casted_other.UserName))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.NoteId, casted_other.NoteId))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.SeenDt, casted_other.SeenDt))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (this.DashboardNote != null)
            {
                if (!this.DashboardNote.Equals(casted_other.DashboardNote, checked_objects))
                {
                    checked_objects.Remove(this);
                    return(false);
                }
            }
            else
            if (casted_other.DashboardNote != null)
            {
                checked_objects.Remove(this);
                return(false);
            }
            checked_objects.Remove(this);

            return(true);
        }