Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

MessageTemplateBuilder.cs

using FluentMigrator.Builders.Create.Table;
using Nop.Core.Domain.Messages;

namespace Nop.Data.Mapping.Builders.Messages;

/// 
/// Represents a message template entity builder
/// 
public partial class MessageTemplateBuilder : NopEntityBuilder
{
    #region Methods

    /// 
    /// Apply entity configuration
    /// 
    /// Create table expression builder
    public override void MapEntity(CreateTableExpressionBuilder table)
    {
        table
            .WithColumn(nameof(MessageTemplate.Name)).AsString(200).NotNullable()
            .WithColumn(nameof(MessageTemplate.BccEmailAddresses)).AsString(200).Nullable()
            .WithColumn(nameof(MessageTemplate.Subject)).AsString(1000).Nullable()
            //don't create an ForeignKey for the EmailAccount table, because this field may by zero
            .WithColumn(nameof(MessageTemplate.EmailAccountId)).AsInt32();
    }

    #endregion
}