//
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
namespace MUnique.OpenMU.Persistence.EntityFramework.Extensions.ModelBuilder;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using MUnique.OpenMU.Persistence.EntityFramework.Model;
///
/// Extensions for the item-related .
///
internal static class ItemExtensions
{
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Name).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.HasMany(storage => storage.RawItems).WithOne(item => item.RawItemStorage!);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Name).HasConversion(LocalizedStringConverter.Instance);
builder.HasMany(isg => isg.RawItems).WithOne(item => item.RawItemSetGroup!);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Ignore(d => d.BaseValueElement);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Name).HasConversion(LocalizedStringConverter.Instance);
builder.Property(p => p.Description).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Description).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Description).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Description).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Name).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Name).HasConversion(LocalizedStringConverter.Instance);
builder.Property(p => p.Description).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Name).HasConversion(LocalizedStringConverter.Instance);
}
///
/// Applies the settings for the entity.
///
/// The builder.
public static void Apply(this EntityTypeBuilder builder)
{
builder.Property(p => p.Description).HasConversion(LocalizedStringConverter.Instance);
}
}