Webiant Logo Webiant Logo
  1. No results found.

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

NewsItemBuilder.cs

using FluentMigrator.Builders.Create.Table;
using Nop.Core.Domain.Localization;
using Nop.Core.Domain.News;
using Nop.Data.Extensions;

namespace Nop.Data.Mapping.Builders.News;

/// 
/// Represents a news item entity builder
/// 
public partial class NewsItemBuilder : NopEntityBuilder
{
    #region Methods

    /// 
    /// Apply entity configuration
    /// 
    /// Create table expression builder
    public override void MapEntity(CreateTableExpressionBuilder table)
    {
        table
            .WithColumn(nameof(NewsItem.Title)).AsString(int.MaxValue).NotNullable()
            .WithColumn(nameof(NewsItem.Short)).AsString(int.MaxValue).NotNullable()
            .WithColumn(nameof(NewsItem.Full)).AsString(int.MaxValue).NotNullable()
            .WithColumn(nameof(NewsItem.MetaKeywords)).AsString(400).Nullable()
            .WithColumn(nameof(NewsItem.MetaTitle)).AsString(400).Nullable()
            .WithColumn(nameof(NewsItem.LanguageId)).AsInt32().ForeignKey();
    }

    #endregion
}