以下代码中是否缺少某些内容,这会引发错误:
对象引用未设置为对象的实例。
//In bllProgress.cs file
namespace BussinessLogic
{
public class bllProgress
{
public List<Timeline> BTimeline { get; set; }
}
public class Timeline
{
public string DateTime { get; set; }
public string Heading { get; set; }
}
}
//In Controller.cs file
using BussinessLogic;
public PartialViewResult FireTimeline()
{
Timeline tl = new Timeline();
tl.DateTime = "Sign Date";
tl.Heading = "Aggrement";
bllProgress obj = new bllProgress();
obj.BTimeline.Add(tl); // <--------- This line gives an error.
return PartialView("_Timeline", obj);
}