【发布时间】:2015-09-17 16:44:30
【问题描述】:
我需要将 Dapper.NET 动态查询与 MS Charts 绑定。
那么问题来了,我该怎么做呢?
public class HomeController : Controller
{
private readonly ChartModel _model;
public HomeController(ChartModel model)
{
_model = model;
}
public ActionResult Index()
{
ViewModel.Message = "Welcome to ASP.NET MVC!";
return View();
}
public ChartResult GetChart()
{
var data = _model.GetChartData();
var chart = new Chart(400, 200, ChartTheme.Blue)
.AddTitle("Price enquiries")
.DataBindTable(???, "XXX");
return new ChartResult(chart, "png");
}
public ActionResult About()
{
return View();
}
}
这是我使用的代码。
【问题讨论】:
-
“所以请对我裸露” - 听起来相当……亲密?
-
谢谢,下次我也会尝试听起来很浪漫:) 哈哈
标签: c# asp.net-mvc-3 dapper