Click here to Skip to main content
15,885,365 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: How to know which Id belongs to which object? Pin
Richard Deeming31-Mar-20 1:10
mveRichard Deeming31-Mar-20 1:10 
GeneralRe: How to know which Id belongs to which object? Pin
simpledeveloper1-Apr-20 10:35
simpledeveloper1-Apr-20 10:35 
GeneralRe: How to know which Id belongs to which object? Pin
Richard Deeming1-Apr-20 13:05
mveRichard Deeming1-Apr-20 13:05 
GeneralRe: How to know which Id belongs to which object? Pin
simpledeveloper2-Apr-20 6:30
simpledeveloper2-Apr-20 6:30 
QuestionAn expression tree lambda may not contain a null propagating operator Pin
simpledeveloper27-Mar-20 21:38
simpledeveloper27-Mar-20 21:38 
AnswerRe: An expression tree lambda may not contain a null propagating operator Pin
Richard MacCutchan27-Mar-20 23:48
mveRichard MacCutchan27-Mar-20 23:48 
AnswerRe: An expression tree lambda may not contain a null propagating operator Pin
Bohdan Stupak28-Mar-20 4:38
professionalBohdan Stupak28-Mar-20 4:38 
QuestionColumn length change using Entity Framework Code First Pin
simpledeveloper17-Mar-20 13:59
simpledeveloper17-Mar-20 13:59 
Hi I am trying to alter a column to fit max length - I changed the entity property and ran Add migration - it did well in the first then in committing it on Git or over written by the remote branch or something its last when I was merging it in master branch then onwards it started giving me issues - my property that I changed is as follows:

[StringLength(7999)]
    public string EventComment { get; set; }


When I am creating - its creating the migration script as below:

public partial class AlterColumnLemgthEventComment : DbMigration
    {
            public override void Up()
            {
            }
            
            public override void Down()
            {
            }
    }

I tried in the following ways to workaround for it
Even though I made it EventComment 1000 in Database then deleted my migration file - then ran the add migration now the file is created in the above way - not able to do anything - now its not let me login to the application as the database is failing - any help please - later its failing if I make the EventComment length max in Database and ran the application - still its failing validation errors. Any help please - just get away from validating any more from Code First, its painful to care things this much. Any help please.

When I make the Database field as Max and Entity property also as 7999 - still it is giving me the following exception in the application - just not able to decide
The field EventComment must be a string with a maximum length of 1000.


I am getting the following error while trying to run the add migration
The Designer Code for this migration file includes a snapshot of your current Code First model. This snapshot is used to calculate the changes to your model when you scaffold the next migration. 
If you make additional changes to your model that you want to include in this migration, then you can re-scaffold it by running 'Add-Migration AlterColumnLemgthEventComment' again.

Any help please?

modified 17-Mar-20 20:27pm.

AnswerRe: Column length change using Entity Framework Code First Pin
Gerry Schmitz17-Mar-20 16:22
mveGerry Schmitz17-Mar-20 16:22 
GeneralRe: Column length change using Entity Framework Code First Pin
simpledeveloper18-Mar-20 3:28
simpledeveloper18-Mar-20 3:28 
AnswerRe: Column length change using Entity Framework Code First Pin
Richard Deeming17-Mar-20 23:52
mveRichard Deeming17-Mar-20 23:52 
GeneralRe: Column length change using Entity Framework Code First Pin
simpledeveloper18-Mar-20 3:14
simpledeveloper18-Mar-20 3:14 
GeneralRe: Column length change using Entity Framework Code First Pin
Richard Deeming18-Mar-20 3:55
mveRichard Deeming18-Mar-20 3:55 
GeneralRe: Column length change using Entity Framework Code First Pin
simpledeveloper18-Mar-20 8:43
simpledeveloper18-Mar-20 8:43 
GeneralRe: Column length change using Entity Framework Code First Pin
Richard Deeming18-Mar-20 8:48
mveRichard Deeming18-Mar-20 8:48 
GeneralRe: Column length change using Entity Framework Code First Pin
simpledeveloper19-Mar-20 5:54
simpledeveloper19-Mar-20 5:54 
Questionc# forms (holy crap i'm not ready for this) Pin
Uranium-23513-Mar-20 23:51
Uranium-23513-Mar-20 23:51 
AnswerRe: c# forms (holy crap i'm not ready for this) Pin
Richard MacCutchan14-Mar-20 1:07
mveRichard MacCutchan14-Mar-20 1:07 
GeneralRe: c# forms (holy crap i'm not ready for this) Pin
Uranium-23514-Mar-20 4:37
Uranium-23514-Mar-20 4:37 
GeneralRe: c# forms (holy crap i'm not ready for this) Pin
Dave Kreskowiak14-Mar-20 4:58
mveDave Kreskowiak14-Mar-20 4:58 
GeneralRe: c# forms (holy crap i'm not ready for this) Pin
Uranium-23514-Mar-20 5:35
Uranium-23514-Mar-20 5:35 
GeneralRe: c# forms (holy crap i'm not ready for this) Pin
Dave Kreskowiak14-Mar-20 6:30
mveDave Kreskowiak14-Mar-20 6:30 
GeneralRe: c# forms (holy crap i'm not ready for this) Pin
Richard MacCutchan14-Mar-20 6:11
mveRichard MacCutchan14-Mar-20 6:11 
GeneralRe: c# forms (holy crap i'm not ready for this) Pin
Uranium-23514-Mar-20 6:51
Uranium-23514-Mar-20 6:51 
GeneralRe: c# forms (holy crap i'm not ready for this) Pin
Richard MacCutchan14-Mar-20 7:02
mveRichard MacCutchan14-Mar-20 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.