У меня есть цикл в моем виде бритвы, который создает несколько моделей просмотра.Я мог бы сохранить результаты в виде списка.
Просмотр бритвы
@foreach (var servOffer in Model.FilterServices.SelectedServicesNames)
{
<h4>@servOffer</h4>
<div class="form-group">
@Html.LabelFor(model => model.CustomerServices.ServiceRatePerNight, htmlAttributes: new { @class = "SerivcesRegistrationLabel control-label col-md-2" } )
<div class="SerivcesRegistrationInput col-md-10">
@Html.EditorFor(model => model.CustomerServices.ServiceRatePerNight, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.CustomerServices.ServiceRatePerNight, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.CustomerServices.SpacesAvailableEachDay, htmlAttributes: new { @class = "SerivcesRegistrationLabel control-label col-md-2" })
<div class="SerivcesRegistrationInput col-md-10">
@Html.EditorFor(model => model.CustomerServices.SpacesAvailableEachDay, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.CustomerServices.SpacesAvailableEachDay, "", new { @class = "text-danger" })
</div>
</div>
}
Просмотр модели
public class ServiceProvider
{
public CustomerProfile Customer { get; set; }
public IEnumerable<CustomerProfile> CustomerProfiles { get; set; }
public CustomerServices CustomerServices { get; set; }
public IEnumerable<CustomerServices> CustomerServicesList { get; set; }
public List<CustomerServices> ProviderServicesList { get; set; }
public FilterServicesViewModel FilterServices { get; set; }
public CustomerRating Rating { get; set; }
public IEnumerable<CustomerRating> CustomerRating { get; set; }
}
Контроллер
public ActionResult CustomerServices(ServiceProvider data, string prevBtn, string nextBtn)
{
}
Данныене заполнен несколькими службами клиентов, но последний в цикле.Как я могу добавить данные я