I faced a problem. I can't figure out how to post collection with dependency. I'll show you a code then it maybe clearer what I'm trying to achieve.
I have ViewModel:
public class ProjectViewModel : BaseViewModel
{
public int Id { get; set; }
public string Customer { get; set; }
public string CustomerRepresentative { get; set; }
public string ProjectTitle { get; set; }
public string WWSNumber { get; set; }
public List<Los> Service { get; set; }
}
LosViewModel:
public class Los
{
public int LosNumber { get; set; }
public string Service { get; set; }
public List<Pos> Pos { get; set; }
}
Pos view model:
public class Pos
{
public int PosNumber { get; set; }
public string PosDescription { get; set; }
}
As you see first ViewModel has list. That meens that when user fills LosNumber and enters Service he can add to it PosNumber and PosDescription.
I can't find information how to post with Razor such model. All I have found is how to display such ModelViewm but not edit.
Maybe somebody had faced this kind of problem ? Any help ?