asp.net mvc - Getting a value from a model within a model using razor in mvc -


I have a problem on how to model it out of a model and access it in a razor. I have a problem with this model in which there are varieties of models. How would I know about how to reach values ​​through type of razor through razor? It would appear like this, but obviously it does not work?

In this way I call this model in this view:

  @modelimimableable & lt; MyApp.Models Issues & gt;  

Public Sector Issues {Public Ent ID (Receive; Set;} Public String Title {get; Set;} Public IEnumerable & lt; MyApp.Models.Type & gt; Type {Get; This is my second model; Trying to use values ​​from:

  public partial class type {public id (get); set;} public string description {get; set;}}   

So I do something like that I try and look like this, but it does not work clearly. prefix @ html.DisplayNameFor (model = & gt; model.Type.Description ())

You can access this way:

  @ {foreach (Miscellaneous items in the model) {if item.Types.Count ()> gt; {foreach (var in innerItem) in item.ype}} {}}}}    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -