modelBuilder add only one variable with different varchar

Asked

Viewed 32 times

0

On my system, I have a small code that adds varchar to all variables added in the database

modelBuilder.Properties<string>()
.Configure(p => p.HasMaxLength(150));

only that I need only one variable to be swept(1000) someone could help me ?

  • This is Entityframework?

  • Configure this variable in the line below.

  • @Julioborges Yes is Entity

  • @jbueno can give me an example ?

  • @Leonardomacedo I will look for something here. I was to create an answer yesterday, but I got lost in the middle of so many open tabs.

  • @jbueno All right, I’m waiting for your answer, and thank you so much for your help!

Show 1 more comment

1 answer

2


I managed to resolve my doubt, I’ll be posting the code down here

public EventosAdversosConfig()
{
    Property(x => x.diaea1)
        .HasColumnType("varchar")
        .HasMaxLength(1000)
        .IsOptional();
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.