using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Configurations; public class SharedScriptConfiguration : IEntityTypeConfiguration { /// Configures the EF Core mapping for the entity. /// Entity type builder used to apply the configuration. public void Configure(EntityTypeBuilder builder) { builder.HasKey(s => s.Id); builder.Property(s => s.Name) .IsRequired() .HasMaxLength(200); builder.Property(s => s.Code) .IsRequired(); builder.Property(s => s.ParameterDefinitions) .HasMaxLength(4000); builder.Property(s => s.ReturnDefinition) .HasMaxLength(4000); builder.HasIndex(s => s.Name).IsUnique(); } }