Пример #1
0
 public bool Equals(FAQCommandChannelEntry other)
 {
     if (this == other)
     {
         return(true);
     }
     if (this.HexColor != other.HexColor)
     {
         return(false);
     }
     if (this.Text != other.Text)
     {
         return(false);
     }
     if (this.IsEmbed != other.IsEmbed)
     {
         return(false);
     }
     if (this.Author != other.Author)
     {
         return(false);
     }
     if (this.AuthorAvatarUrl != other.AuthorAvatarUrl)
     {
         return(false);
     }
     if (this.ImageURL != other.ImageURL)
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
        // TODO should not be necessary, there is entity state detach, did not work for me
        public FAQCommandChannelEntry clone()
        {
            var clone = new FAQCommandChannelEntry();

            clone.Author          = Author;
            clone.AuthorAvatarUrl = AuthorAvatarUrl;
            clone.Position        = Position;
            clone.HexColor        = HexColor;
            clone.ImageURL        = ImageURL;
            clone.IsEmbed         = IsEmbed;
            clone.Text            = Text;
            // I think setting the changed date to now is fine, because we use the cloning, when we use an entry from an already existing channel
            // that means in the process of a creating an entry, and with that we basically say 'this is right'
            clone.ChangedDate = DateTime.Now;
            return(clone);
        }