This is a migrated thread and some comments may be shown as answers.
CRUD with EF model first and MVC grid inline editing not possible except for simplest models?
1 Answer 35 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
vladan strigo
Top achievements
Rank 1
vladan strigo asked on 02 May 2011, 12:40 PM
To start of and say that this is the issue because of the circular references, I know what the issue is, and I know how to deal with it.  However, dealing with it in the proposed manner is not good enough.

So you have a model which has a relation...Say a Car, which has Tires, each Tire, belongs to a Car (one-to-many).

My goals are:
- To make a quick CRUD operation with inline edit within the grid and Ajax binding
- Not to repeat code in couple of places
- Do it quickly

So idea would be to just pass on a model to the grid, configure the grid with inline editing and it should work.

It doesn't because of the circular references issue (and I understand that). As my option is not to kill a relationship in the model on one side, my only other option is to introduce View Model into the story.

However, this idea only works correctly if my grid is read-only...if I want to make the grid also editable (inline), I also need validations and all other metadata which I have on my model also on my view model, so now I start leaking all over the place, copy pasting and stuff just to satisfy the norm.

I really hate being in this kind of loose-loose situation...I have all the functionality I need, grid supports ajax, inline editing, templates, all other neat stuff...only I cannot make the picture come together.


Are there any ideas or plans to help with this issue? I do believe I am not the only one who has it...and all because of circular references.



Kind regards,
Vladan Strigo

1 Answer, 1 is accepted

Sort by
0
vladan strigo
Top achievements
Rank 1
answered on 04 May 2011, 08:31 AM
Anyone? Please advise what to do?
Tags
Grid
Asked by
vladan strigo
Top achievements
Rank 1
Answers by
vladan strigo
Top achievements
Rank 1
Share this question
or