Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many confuse about asp.net core 2 #2260

Closed
sunn789 opened this issue Oct 27, 2017 · 2 comments
Closed

many confuse about asp.net core 2 #2260

sunn789 opened this issue Oct 27, 2017 · 2 comments

Comments

@sunn789
Copy link

sunn789 commented Oct 27, 2017

first of all I install vs 15.4 ent and i had the same problem in 15.3 and work with MVC core 2 for create my web projects.
If i create relation in Class as a code first for create database and make relations, in controllers it's not good, it is the same as this:

ViewData["CustomerTypeId"] = new SelectList(_customerTypeRepository.GetAll(), "Id", "Id");
ViewData["CityId"] = new SelectList(_cityRepository.GetAll(), "Id", "Id);

in MVC 5 it was

ViewData["CustomerTypeId"] = new SelectList(_customerTypeRepository.GetAll(), "Id", "Name");
ViewData["CityId"] = new SelectList(_cityRepository.GetAll(), "Id", "Name");

and the same in Index view on scaffold

        <th>
            @Html.DisplayNameFor(model => model.City)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CustomerType)
        </th>

in MVC 5 it was

      <th>
            @Html.DisplayNameFor(model => model.City.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CustomerType.Name)
        </th>

also in EF if I add migration and update-database with any relation and FK it's work nice and if I add new relation in my code first class, and want update-database got arrore that : I have problem in parent_table and child-table_id problem if i remove database and remove migration and add init migration and update_database it work nice .
thanks

@kshyju
Copy link

kshyju commented Nov 21, 2017

What you mean by "in controllers it's not good, " What is your actual issue/question. Sorry ! I am having a hard time understanding your post.

@Eilon
Copy link
Member

Eilon commented Jan 9, 2018

Closing because there is not enough information to reproduce this problem.

@Eilon Eilon closed this as completed Jan 9, 2018
natemcmaster pushed a commit that referenced this issue Nov 14, 2018
Prevents UvWriteReq leaks in LibuvOutputConsumerTests
ryanbrandenburg pushed a commit that referenced this issue Nov 27, 2018
Embed version in the JavaScript client (#2229)
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants