Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

toolbar problem #7813


User avatar
0
wcdagency created

hello

Create Entity: It works no problem. Regenerate Entity: Sometimes I need add-remove entity, but I could not be able to add. it gives error. Load Entity From Database: Sometimes I prepare database table and I would like to generate class codes from it. it gives error.


8 Answer(s)
  • User Avatar
    0
    yekalkan created

    I could help you if you can more explain the situations which you get errors and also show those errors.

    Regenerate Entity: Sometimes I need add-remove entity, but I could not be able to add. it gives error.

    Did you mean add/remove property?

  • User Avatar
    0
    wcdagency created

    Sometimes for example, I created table with

    table name: abc Id int NameVal string

    and lets say it gave error : nameVal could not be duplicate,

    error message is not important. because what ever the error message is, it could not be repaired.

    If I want to create another table table name :def Id int NameValue: string

    the same error for first one is still displayed, code creates views ,controllers, scripts but database table is not created. Due to this situation, I lost a lot of time. Now, I recloned a clean copy of project , then I will move the codes from non working one to newly cloned one. I still could not get support from you.

  • User Avatar
    0
    yekalkan created

    There should be something wrong with your database and migrations, that causes error when "update-database" command is run. This is also why same error is displayed when you create another entity (because it tries to run "update-database" again).

    I can't test or reproduce this problem using the information you gave, and it doesn't seems to be related with our tool.

    If you like, you can send your project or a sample project with same issue to [email protected] as email. I'll check it out.

  • User Avatar
    0
    wcdagency created

    I realized that, when I try to remove an entity , I face that problem. I think I make something wrong. So my question is , les say, I want to completely remove table abc from database and everything in code , thus, what should be the process of it? is there some command for it?

  • User Avatar
    0
    yekalkan created

    There is no command or option for that.

  • User Avatar
    0
    wcdagency created

    hello,

    so what is the appropriate way of it?

  • User Avatar
    0
    yekalkan created

    Search for your entity's name in the solution. Then delete the related files and codes.

    See https://docs.aspnetzero.com/en/common/latest/Development-Guide-Rad-Tool#generated-files

    It can be helpful. There is list of generated files and modified files.

  • User Avatar
    0
    wcdagency created

    hello.

    I fixed problem.

    1. I had to clear all migration files
    2. I had to create two migration file one after other then update db Add-migration migrationismi

    update-database migrationismi