休息后请求以动态执行存储过程

时间:2019-03-22 18:57:35

标签: rest stored-procedures http-post

我有一个要求,我必须创建rest终结点,该终结点以dto以下的形式接受请求。端点将使用AsOfDate作为参数执行存储过程(报表源)。 现在,我要根据请求Dto执行40种不同的存储过程。我想将结果(包括存储过程中的列标题)发送回另一个应用程序,然后使这些报告结果可供下载。 我正在寻找有关如何编写GetReport()的帮助,该报告将调用db并执行带参数的存储过程,并将结果作为json发送。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BAService.Dtos
{
    class BARequestDTO: IBARequestDto
    {
        public int ReportID { get; set; }
        public string ReportName { get; set; }
        public DateTime? AsOfDate { get; set; }
        public string ReportSource { get; set; }
    }
}


    [HttpPost]
    [Route("BAReportRequest")]
    public ActionResult BAReportRequest(BARequestDTO dataDictionaryDto)
    {
        try
        {
            var test = _bIReportRepositoryBA.GetReport(dataDictionaryDto);
        }
        catch (Exception ex)
        {
            _LogService.Error(string.Format("Unable to save data dictionary"), ex);

        }
        return test;
    }

0 个答案:

没有答案