gpt4 book ai didi

c# - AddDays 在 MVC4 中不起作用?

转载 作者:太空宇宙 更新时间:2023-11-03 23:19:09 24 4
gpt4 key购买 nike

<分区>

嗨,AddDays 在 MVC4 中不起作用?

  public ActionResult customerid()
{
List<Customer> n = (from c in db.Customers where c.IsDeleted == false select c).ToList();

for (var i = 0; i < n.Count; i++)
{
var objCusCreatedDate=n[i].CreatedDate;

var objNextDate = objCusCreatedDate.AddDays(+120);

}
return View();
}

在此代码中,我在接近 AddDays 时遇到错误。请帮我解决这个问题。

Error 1 'System.Nullable' does not contain a definition for 'AddDays' and no extension method 'AddDays' accepting a first argument of type 'System.Nullable' could be found (are you missing a using directive or an assembly reference?)

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com