Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Entity Framework 101
Message
De
04/06/2014 15:28:45
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
04/06/2014 15:20:48
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows 8
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01601183
Message ID:
01601293
Vues:
29
>>Why not use an enum for the Status rather than magic strings?
>>
>>>I have a demo project that I've been working on that focuses on advanced Entity Framework concepts. Here's the URL: https://github.com/mikecole/MovieFanatic
>>>
>>>I just added an edit page that has has an example of how to populate a dropdown using Razor: https://github.com/mikecole/MovieFanatic/blob/master/MovieFanatic.Web/Controllers/MovieController.cs
>
>It looks like a related table to me. I would suggest adding the bind attribute and using TryUpdateModel if its MVC 5 (http://odetocode.com/blogs/scott/archive/2012/03/12/complete-guide-to-mass-assignment-in-asp-net-mvc.aspx).

That is an interesting concept. Not sure if it applies for my specific example, since there are no sensitive fields in my ViewModel. That's one of the advantage of using a ViewModel instead of your database entity: you can craft exactly what you want the View to be able to do.
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform