TriaSoftware.Util.Framework 1.2.2

Biblioteca contendo geração de arquivos, gráficos e outras funcionalidades.

Install-Package TriaSoftware.Util.Framework -Version 1.2.2
dotnet add package TriaSoftware.Util.Framework --version 1.2.2
<PackageReference Include="TriaSoftware.Util.Framework" Version="1.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TriaSoftware.Util.Framework --version 1.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TriaSoftware.Util.Framework, 1.2.2"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

1 - Adicionar a injeção de dependência na classe Startup.cs

    public void RegisterServices(IServiceCollection services)
    {
        services.AddScoped<IExportFile, ExportFileService>();
    }

2 - Na controller:

    private IExportFile _serviceExportFile;

    public MinhaController(IExportFile serviceExportFile)
    {
        _serviceExportFile = serviceExportFile;
    }

3 - Usando o método EXCEL:

    public IActionResult MinhaAction()
    {
         var result = _serviceExportFile.GenerateExcel(MinhaLista);
         return File(result, "application/ms-excel", $"MeuArquivo.xlsx");
    }

4 - Usando o método CSV:

    public IActionResult MinhaAction()
    {
        var result = _serviceExportFile.GenerateCSV(";", MinhaLista);
        return File(result, "text/csv", $"MeuArquivo.csv");
    }

5 - Usando o método PDF:

    public IActionResult MinhaAction()
    {
        var result = _serviceExportFile.GeneratePDF(MeuHTML);
        return File(result, "application/pdf", $"MeuArquivo.pdf");
    }

1 - Adicionar a injeção de dependência na classe Startup.cs

    public void RegisterServices(IServiceCollection services)
    {
        services.AddScoped<IExportFile, ExportFileService>();
    }

2 - Na controller:

    private IExportFile _serviceExportFile;

    public MinhaController(IExportFile serviceExportFile)
    {
        _serviceExportFile = serviceExportFile;
    }

3 - Usando o método EXCEL:

    public IActionResult MinhaAction()
    {
         var result = _serviceExportFile.GenerateExcel(MinhaLista);
         return File(result, "application/ms-excel", $"MeuArquivo.xlsx");
    }

4 - Usando o método CSV:

    public IActionResult MinhaAction()
    {
        var result = _serviceExportFile.GenerateCSV(";", MinhaLista);
        return File(result, "text/csv", $"MeuArquivo.csv");
    }

5 - Usando o método PDF:

    public IActionResult MinhaAction()
    {
        var result = _serviceExportFile.GeneratePDF(MeuHTML);
        return File(result, "application/pdf", $"MeuArquivo.pdf");
    }

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.2 216 7/26/2019
1.2.1 169 7/26/2019
1.2.0 175 7/24/2019
1.1.0 156 7/23/2019
1.0.0 1,386 7/22/2019