Вот мой класс ViewModel, CompanyImageViewModel
Код: Выделить всё
public class CompanyImageViewModel
{
public int Id { get; set; }
public string CompanyHash { get; set; }
public string PoseId { get; set; }
public string TankCode { get; set; }
public string Site { get; set; }
public string TitleTag { get; set; }
public string AltTag { get; set; }
public string CaptionTag { get; set; }
public string Filename { get; set; }
public IFormFile ImageFile { get; set; }
}
Код: Выделить всё
@model List
Company Image Manager
⬅️Back to Company List
@for (int i = 0; i < Model.Count; i++)
{
var selectedImageFile = Model.Skip(i).Take(1).FirstOrDefault();
[img]@imageRoot\@selectedImageFile.Filename[/img]
@Html.TextBoxFor(r => r[i].ImageFile, new {@class="imageUpload"});
Image Title
}
Save
Подробнее здесь: https://stackoverflow.com/questions/785 ... -in-blazor
Мобильная версия