Refresh edmx from the database

Posted on

Question :

I did an update model from database on my edmx. Well, the field I had added to the table appears in the diagram, but in the cs of the non-entity, it continues with the old fields. What do I do, I add in my hand? This is 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 of the smallint type in the DB. I think this is missing:

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


Answer :

You have to generate the entities again … try to right click on the EDMX, there should be a menu called Run Custom Tool .

This menu item is used to run the tool to generate the entities, which in this case, if the Custom Tool property is as EntityModelCodeGenerator , will be EdmGen.exe .


Leave a Reply

Your email address will not be published. Required fields are marked *