/// <summary>Returns a new instance with the Author property set to the specified value.</summary> public Message WithAuthor(Contact value) { if (value == this.Author) { return this; } return this.With(author: Optional.For(value)); }
/// <summary>Removes the specified element from the Cc collection.</summary> public Message RemoveCc(Contact value) { return this.With(cc: this.Cc.Remove(value)); }
/// <summary>Removes the specified element from the To collection.</summary> public Message RemoveTo(Contact value) { return this.With(to: this.To.Remove(value)); }
/// <summary>Adds the specified element from the To collection.</summary> public Message AddTo(Contact value) { return this.With(to: this.To.Add(value)); }
/// <summary>Removes the specified element from the Bcc collection.</summary> public Message RemoveBcc(Contact value) { return this.With(bcc: this.Bcc.Remove(value)); }
/// <summary>Adds the specified element from the Cc collection.</summary> public Message AddCc(Contact value) { return this.With(cc: this.Cc.Add(value)); }
/// <summary>Adds the specified element from the Bcc collection.</summary> public Message AddBcc(Contact value) { return this.With(bcc: this.Bcc.Add(value)); }
/// <summary>Initializes a new instance of the Message class.</summary> protected Message( System.UInt32 identity, Contact author, System.Collections.Immutable.ImmutableList<Contact> to, System.Collections.Immutable.ImmutableList<Contact> cc, System.Collections.Immutable.ImmutableList<Contact> bcc, System.String subject, System.String body, ImmutableObjectGraph.Optional<bool> skipValidation = default(ImmutableObjectGraph.Optional<bool>)) { this.identity = identity; this.author = author; this.to = to; this.cc = cc; this.bcc = bcc; this.subject = subject; this.body = body; if (!skipValidation.Value) { this.Validate(); } }
public Contact ToImmutable() { return this.immutable = this.immutable.With( ImmutableObjectGraph.Optional.For(this.Name), ImmutableObjectGraph.Optional.For(this.Email)); }
internal Builder(Contact immutable) { this.immutable = immutable; this.name = immutable.Name; this.email = immutable.Email; }