none
Changes in the Model RRS feed

  • Question

  • Hi,

    I started to build an MVC project.

    After I created a Model (Class + Dbcontext), I added Migrations, and started adding Data to the table in SQL.

    Now, I want to add another column in the table. I added a property in the class, but it didn't change anything.

    Please help, I'm new in this, and I don't know what to do.

    Thank you.

    :-) 

    • Moved by Jiayi Li Friday, August 14, 2015 5:43 AM
    Thursday, August 13, 2015 1:10 PM

Answers

  • Hi RaRaGo,

    You could refer to this MSDN articles: https://msdn.microsoft.com/en-gb/data/jj591621.aspx

    which will tell you how to use migration in ef.

    1. Tools –> Library Package Manager –> Package Manager Console

            Run the Install-Package EntityFramework command

    2. Run the Enable-Migrations command in Package Manager Console

    3. Run the Add-Migration migrationname command in Package Manager Console

    4. Run the Update-Database command in Package Manager Console

    If you have any other concern regarding this issue, please feel free to let me know.

    Best regards,
    Youjun Tang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 17, 2015 8:59 AM

All replies

  • Hi RaRaGo,

    This forum is about Visual Studio IDE, as your issue is related to ADO.NET Entity Framework and LINQ to Entities, I help you move this case to ADO.NET Entity Framework and LINQ to Entities forum for better assist.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Friday, August 14, 2015 5:43 AM
  • Hi RaRaGo,

    You could refer to this MSDN articles: https://msdn.microsoft.com/en-gb/data/jj591621.aspx

    which will tell you how to use migration in ef.

    1. Tools –> Library Package Manager –> Package Manager Console

            Run the Install-Package EntityFramework command

    2. Run the Enable-Migrations command in Package Manager Console

    3. Run the Add-Migration migrationname command in Package Manager Console

    4. Run the Update-Database command in Package Manager Console

    If you have any other concern regarding this issue, please feel free to let me know.

    Best regards,
    Youjun Tang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 17, 2015 8:59 AM