Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EF attributes that can only be changed from code
Message
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01569983
Message ID:
01570090
Views:
25
>>I have one MVC model which I use in both Edit and Add dialog which is the same view in my case. I don't know if I can still use the same view but different models depending on the Add vs. Edit - that may be an alternative solution.
>>
>>Also, the EF model is a property of my MVC model, e.g. I have Client Client property of MVC model.
>>
>
>In those scenarios I usually create 2 views, one for the one case, one for the other along with separate controller methods/actions (unless these are incredibly similar, then I may just handle it in the view and in the controller action). That usually means I also need a separate view model for each of them, each with their own attributes - I end up with 3 classes - one "common" view model class which contains all of the fields/attributes that are common to the other 2 (and that the other 2 will inherit from).

I think for me right now it will be too complex. I have two possible solutions for now:

1. Include these fields in my view

2. Before update set IsModified property of these columns to false as suggested in that other thread.

I'm going to chose one of these two solutions.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform