# Class MessageDto | EchoHub Documentation

# Class MessageDto

Namespace
  EchoHub.Core.DTOs

Assembly
  EchoHub.Core.dll

    public record MessageDto : IEquatable<MessageDto>

Inheritance
  object
  MessageDto

Implements
  IEquatable<MessageDto>

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.Equals(object, object)
  object.ReferenceEquals(object, object)

## Constructors

### MessageDto(MessageDto)

    protected MessageDto(MessageDto original)

#### Parameters

`original` MessageDto

### MessageDto(Guid, string, string, string?, string, MessageType, string?, string?, DateTimeOffset)

    public MessageDto(Guid Id, string Content, string SenderUsername, string? SenderNicknameColor, string ChannelName, MessageType Type, string? AttachmentUrl, string? AttachmentFileName, DateTimeOffset SentAt)

#### Parameters

`Id` Guid
`Content` string
`SenderUsername` string
`SenderNicknameColor` string
`ChannelName` string
`Type` MessageType
`AttachmentUrl` string
`AttachmentFileName` string
`SentAt` DateTimeOffset

## Properties

### AttachmentFileName

    public string? AttachmentFileName { get; init; }

#### Property Value

string

### AttachmentUrl

    public string? AttachmentUrl { get; init; }

#### Property Value

string

### ChannelName

    public string ChannelName { get; init; }

#### Property Value

string

### Content

    public string Content { get; init; }

#### Property Value

string

### EqualityContract

    protected virtual Type EqualityContract { get; }

#### Property Value

Type

### Id

    public Guid Id { get; init; }

#### Property Value

Guid

### SenderNicknameColor

    public string? SenderNicknameColor { get; init; }

#### Property Value

string

### SenderUsername

    public string SenderUsername { get; init; }

#### Property Value

string

### SentAt

    public DateTimeOffset SentAt { get; init; }

#### Property Value

DateTimeOffset

### Type

    public MessageType Type { get; init; }

#### Property Value

MessageType

## Methods

### Deconstruct(out Guid, out string, out string, out string?, out string, out MessageType, out string?, out string?, out DateTimeOffset)

    public void Deconstruct(out Guid Id, out string Content, out string SenderUsername, out string? SenderNicknameColor, out string ChannelName, out MessageType Type, out string? AttachmentUrl, out string? AttachmentFileName, out DateTimeOffset SentAt)

#### Parameters

`Id` Guid
`Content` string
`SenderUsername` string
`SenderNicknameColor` string
`ChannelName` string
`Type` MessageType
`AttachmentUrl` string
`AttachmentFileName` string
`SentAt` DateTimeOffset

### Equals(MessageDto?)

    public virtual bool Equals(MessageDto? other)

#### Parameters

`other` MessageDto

#### Returns

bool

### Equals(object?)

    public override bool Equals(object? obj)

#### Parameters

`obj` object

#### Returns

bool

### GetHashCode()

    public override int GetHashCode()

#### Returns

int

### PrintMembers(StringBuilder)

    protected virtual bool PrintMembers(StringBuilder builder)

#### Parameters

`builder` StringBuilder

#### Returns

bool

### ToString()

    public override string ToString()

#### Returns

string

## Operators

### operator ==(MessageDto?, MessageDto?)

    public static bool operator ==(MessageDto? left, MessageDto? right)

#### Parameters

`left` MessageDto
`right` MessageDto

#### Returns

bool

### operator !=(MessageDto?, MessageDto?)

    public static bool operator !=(MessageDto? left, MessageDto? right)

#### Parameters

`left` MessageDto
`right` MessageDto

#### Returns

bool