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; }
Make sure there is no error in EDMX?
– Miguel Angelo
Like some property that once existed, but is no longer mapped... it is common when removing or renaming columns in the database.
– Miguel Angelo
Right click on the background of the EDMX view window, and click on the menu item
Validate
. Open the window that lists errors with titleError List
(CTRL
+W
+E
)... there will be the mistakes.– Miguel Angelo
What are the warnings?
– Miguel Angelo
I recreated edmx and now it’s pk
– pnet
The warnings were all css. I already solved them too
– pnet
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
– pnet
Just mark Miguel’s response as the correct that is under the answer voting arrows.
– Tafarel Chicotti
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.
– Miguel Angelo
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.– user6026
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.
– Miguel Angelo