1
I have two tables: Vehicle and Images, where a vehicle can have n images. When performing an Inner Join I get the following result: Vehicles1-Addressimage Vehicles1-Addressimage Vehicles2-Addressimage Vehicles2-Addressimage Vehicles2-Addressimage I wonder if there is any way to get the results this way: V1-All Vehicle Images1 V2-All Vehicle Images 2
I am developing a project in Asp net mvc and would like to send this last result to my view. Is there anything I can do to get the data this way.
Are you using json? If you’re just creating an array to structure the way you want and send.
– Diego Lima
Could you post the part of the code where you retrieve the information from the bank and the part where it will display in the View? so it’s easier to understand what’s being done
– Barbetta
public Actionresult Index() { Return View(db.Veiculo.Tolist()); }
– markim
Put this information in the questions... but come on.. in your View she’s typified as Icollection Vehicle, right? you can do something like this
@foreach (var imagem in item.Imagens)
. in case would be inside foreach, ie for each vehicle line would pass a list of images of that vehicle– Barbetta