Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all, I am learning blazor with building a project. There i am stuck with one image upload functionality. I have two classes one for pure image file data and another for only display images (completely for UI purposes).I am stuck with the requirement whenever user selects multiple images ,the first list will trigger and should automatically reflect to the second list and bind to the table. I have been told something like below need to follow for this scenario but I am facing some difficulties to build the logic. Please anyone help me on this. I have to add remove and edit name functionality also. User can remove or edit image name before sending in to DB below is my table plan but how and where I have to create second list and connected together? i have done for file details how i can do for image using above get set mtd

Hint for me:

C#
List<browsedfiles>
{
get{return files}
set{Imagedata =new List<Media>(value)
files=value;
}

List<ImageforUI>Imagedata {get;set;}


What I have tried:

C#
private async Task OnFilesChanged(InputFileChangeEventArgs eventArgs){


      var files = new List<browsedfiles>(eventArgs.FileCount);

       files.AddRange(eventArgs.GetMultipleFiles(5).Select(file => new 
       browsedfiles(file)));

      }
Posted
Updated 9-Jan-23 8:12am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900