Skip to content

Make generate-proxy support IRemoteStreamContent. #8581

@maliming

Description

@maliming

IRemoteStreamContent may be a parameter or in the DTO of the parameter. It can only be the return type.

Task<IRemoteStreamContent> GetFileAsync(); A blob stream will be returned.

Task UploadFileAsync(IRemoteStreamContent file);
var formdata = new FormData();
formdata.append("file", fileInput.files[0], "logo.png");

var requestOptions = {
  method: 'POST',
  body: formdata
};
Task UploadFileAsync(UploadFileDto input);
fetch("https://localhost:44328/UploadFileAsync", requestOptions)

var formdata = new FormData();
formdata.append("input.FileName ", "logo.png");
formdata.append("input.FileContent ", fileInput.files[0], "logo.png");

var requestOptions = {
  method: 'POST',
  body: formdata
};

fetch("https://localhost:44328/UploadFileAsync", requestOptions)
public interface IFileAppService : IApplicationService
{
    Task<IRemoteStreamContent> GetFileAsync();

    Task UploadFileAsync(IRemoteStreamContent file);

    Task UploadFileAsync(UploadFileDto input);

    Task UploadFilesAsync(UploadFilesDto input);

    Task UploadFile2Async(UploadFile2Dto input);
}

public class UploadFileDto
{
    public string FileName { get; set; }

    public IRemoteStreamContent FileContent { get; set; }
}

public class UploadFilesDto
{
    //Or List<IRemoteStreamContent>
    public IEnumerable<IRemoteStreamContent> Files { get; set; }
}

public class UploadFile2Dto
{
    public UploadFileChild2Dto Child { get; set; }
}

public class UploadFileChild2Dto
{
    //Or IEnumerable<IRemoteStreamContent>
    public IRemoteStreamContent FileContent { get; set; }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions