Update to latest packages and show examples
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using GerstITS.Data.EntityFramework;
|
||||
using GerstITS.Examples.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace GerstITS.Examples.Data.Mappings;
|
||||
|
||||
internal sealed class CustomerNoteEntityMapping : EntityMappingBase<CustomerNoteEntity>
|
||||
{
|
||||
#region Properties
|
||||
|
||||
protected override string TableName => "CustomerNotes";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void AddKeyMapping(EntityTypeBuilder<CustomerNoteEntity> entity)
|
||||
{
|
||||
entity.HasKey(i => i.Id);
|
||||
}
|
||||
|
||||
protected override void AddPropertyMappings(EntityTypeBuilder<CustomerNoteEntity> entity)
|
||||
{
|
||||
entity.Property(i => i.Text).HasMaxLength(2000).IsRequired();
|
||||
|
||||
entity.Property(i => i.CreatedBy).HasMaxLength(100);
|
||||
entity.Property(i => i.HistorySet).HasMaxLength(50);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user