-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Description
Hello guys, i meet a problem to retrieve list of object from JS to c#
the initial call is done in c#
var results = await JsRuntime.InvokeAsync<IEnumerable<FileResultJs>>("openFiles", this.Multiselect, this.Filter);
class FileResultJs
{
public string Name { get; set; }
public string Data { get; set; }
}
i have a method "openFiles" in js wich return a promise, resolved by an array of object wich respect the structure of FileResultJs
var result = [];
//in a loop
result.push( {
Name: temporaryFileReader.file.name,
Data: temporaryFileReader.result.split(',')[1]
});
count++;
if (count == numberFiles) {
resolve(result);
}
When the promise is resolved with the array , i "go back" to the c#.
If in the js, my array had two elements, i retrieve well an ienumerable of 2 elements, but the two property are null (while they are correctly filled in the JS).
I don't know if what i try to do is possible, and if it's possible, what's the problem in my code ?
thanks for your help !
Metadata
Metadata
Assignees
Labels
No labels