Update edmx from the bank

Asked

Viewed 1,034 times

4

I did an update model from database on my edmx. Well, the field I had added in the table appears in the diagram, but in the entity’s Cs, it continues with the old fields. What do I do, add in hand? That’s my Cs

public partial class T_Script
    {
        public int IDScript { get; set; }
        public string Script { get; set; }
        public string NomeScript { get; set; }
        public string TituloScript { get; set; }
        public Nullable<short> Ativo { get; set; }
    }

The new field is missing, but it already exists in the diagram. The new field is smallint type in the BD. I think that’s missing:

public Nullable<int> TipoStatus { get; set; }

1 answer

3


  • Make sure there is no error in EDMX?

  • Like some property that once existed, but is no longer mapped... it is common when removing or renaming columns in the database.

  • Right click on the background of the EDMX view window, and click on the menu item Validate. Open the window that lists errors with title Error List (CTRL + W + E)... there will be the mistakes.

  • What are the warnings?

  • I recreated edmx and now it’s pk

  • The warnings were all css. I already solved them too

  • How do I finish? Miguel’s response helped me a lot in learning one more tool, but the grand finale came in recreating. I don’t see any problem in clicking on Miguel’s answer, but I want to do it the right way, because I’ve been penalized in this forum

  • Just mark Miguel’s response as the correct that is under the answer voting arrows.

  • To check what the problem is, if you still have in hand the old EDMX, before recreating it, use a DIFF tool, such as Winmerge, to know what differentiates an EDMX that works from another that does not work.

  • I just wanted to say @pnet, that the best solution to work with edmx is the one that @Miguelangelo gave you, because at most it has to be updated by changing in the bank, giving a refresh in edmx. Mess with that edmx on hand would not be recommended by error factor and not too trivial coding.

  • I already tried to touch the EDMX in the hand a few times... in all I froze... = D When I suggested to @pnet do a diff on the edmx files, it was actually just to detect what the possible problem would be. Like, if you have a mapping to a column that doesn’t exist it will be easy to identify this with the diff... but then it could go to the designer and try to remove the mapping, without editing the edmx in hand.

Show 6 more comments

Browser other questions tagged

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