public class SalesInvoiceDetailsViewModel
{
public int? salesInvDetailsId { get; set; }
public int? salesInvoiceId { get; set; }
public int? productId { get; set; }
public int? productWiseSpecificationId { get; set; }
public decimal? invoiceQty { get; set; }
public decimal? convertionQty { get; set; }
public decimal? CtnQty { get; set; }
public int? toUomId { get; set; }
public decimal? price { get; set; }
public decimal? vat { get; set; }
public decimal? ait { get; set; }
public decimal? discountAmount { get; set; }
public decimal? Total { get; set; }
public bool? isActive { get; set; }
public bool? isSelect { get; set; }
public int? barcodeId { get; set; }
public string serialNo { get; set; }
public int? salesOrderId { get; set; }
public int? SalOrderDetailId { get; set; }
public string attachmentPath { get; set; }
public string attachments { get; set; }
public IFormFile ImageFile { get; set; }
//public List ImageFile { get; set; } = new List();
}
Здесь у меня есть свойство ImageFile в SalesInvoiceDetailsViewModel.
Я отправляю запрос PostMan таким образом
Postman Параметр запроса
Но он не запускает мой контроллер. когда я удаляю общественный IFormFile ImageFile {get; набор; тогда все работает хорошо.
В таком случае, как я могу отправить IFormFile с помощью аннотации [FromForm]
[code]public class SalesInvoiceViewModel { public int? salesInvoiceId { get; set; } public string salesInvoiceNo { get; set; } public int? salesOrderId { get; set; } public string salesOrderNo { get; set; } public DateTime? salesInvoiceDate { get; set; } public DateTime? paymentDate { get; set; } public int? partyId { get; set; } public int? storeId { get; set; } public string mobileNo { get; set; } public string alternateMobileNo { get; set; } public string address { get; set; } public decimal? totalGross { get; set; } public decimal? totalVat { get; set; } public decimal? totalAit { get; set; } public decimal? shippingCost { get; set; } public decimal? totalDiscountAmount { get; set; } public decimal? grandTotal { get; set; } public string approvalStatus { get; set; } //0='Pending', 1='Approve', 2='Rejected/Cancelled', 3='Shipped', 4='Received', 5='OnHold', 6='Refund' public bool? isActive { get; set; } public bool? isSelect { get; set; } public string refNo { get; set; } public string remarks { get; set; } public int? transactionTypeId { get; set; } public string flyingCustomer { get; set; } public List lstMasterViewModel { get; set; } = new List(); public List lstDetailsViewModel { get; set; } = new List(); public List tcLstDetailsViewModel { get; set; } = new List(); } [/code] [code] public class SalesInvoiceDetailsViewModel { public int? salesInvDetailsId { get; set; } public int? salesInvoiceId { get; set; } public int? productId { get; set; } public int? productWiseSpecificationId { get; set; } public decimal? invoiceQty { get; set; } public decimal? convertionQty { get; set; } public decimal? CtnQty { get; set; } public int? toUomId { get; set; } public decimal? price { get; set; } public decimal? vat { get; set; } public decimal? ait { get; set; } public decimal? discountAmount { get; set; } public decimal? Total { get; set; } public bool? isActive { get; set; } public bool? isSelect { get; set; } public int? barcodeId { get; set; } public string serialNo { get; set; } public int? salesOrderId { get; set; } public int? SalOrderDetailId { get; set; } public string attachmentPath { get; set; } public string attachments { get; set; } public IFormFile ImageFile { get; set; } //public List ImageFile { get; set; } = new List();
} [/code] Здесь у меня есть свойство ImageFile в SalesInvoiceDetailsViewModel. Я отправляю запрос PostMan таким образом Postman Параметр запроса Но он не запускает мой контроллер. когда я удаляю общественный IFormFile ImageFile {get; набор; тогда все работает хорошо. В таком случае, как я могу отправить IFormFile с помощью аннотации [FromForm]
Я создаю конечную точку ASP.NET CORE Web API, которая должна получить массив сложных объектов через Multipart/Form-Data . Каждый объект включает в себя пары строк клавиш и дополнительную загрузку файла. Каждый Formitem должен иметь либо значение,...
Когда я привязываю ItemsSource ListBox к списку, механизм привязки удерживает элементы списка после того, как элемент управления исчез. Это приводит к тому, что все элементы списка остаются в памяти. Проблема исчезает при использовании...
У меня есть объект, для целей этого примера он довольно прост:
публичный класс DateEntry { общественная DateOnly Date {get; набор; } общественный ИНТ WeekNumber {получить; набор; } } Я получаю List из 42 экземпляров объекта DateEntry.