C# 使用Nodatime';在ravendb中创建索引;s本地日期
我希望有人能帮助我。 我将Ravendb与NodeTime捆绑包一起使用,到目前为止,我并没有遇到任何问题,直到我想在索引创建期间使用一些NodeTime方法 产品:C# 使用Nodatime';在ravendb中创建索引;s本地日期,c#,ravendb,ravendb-studio,C#,Ravendb,Ravendb Studio,我希望有人能帮助我。 我将Ravendb与NodeTime捆绑包一起使用,到目前为止,我并没有遇到任何问题,直到我想在索引创建期间使用一些NodeTime方法 产品: public class Product { public string Id { get; set; } public LocalDate ReleasedDate { get; set; } // and more properties... } 我的索引创建(AbstractMultiMapInde
public class Product {
public string Id { get; set; }
public LocalDate ReleasedDate { get; set; }
// and more properties...
}
我的索引创建(AbstractMultiMapIndexCreationTask):
AddMap(产品=>
从产品到产品
让dateTimeUTc=DateTimeZone.Utc.AtStartOfDay(product.ReleasedDate)
让timeTicks=dateTimeUTc.ToInstant().Ticks
让hash=$“{product.Id}{timeTicks}”
选择新索引中心
{
散列=散列,
用法=0
});
随着索引的生成,记号就在那里,除了ravendb中的每个索引记录都有一个索引错误之外,没有什么错误:
与'NodaTime.DateTimeZone.AtStartOfDay(NodaTime.LocalDate)'匹配的最佳重载方法具有一些无效参数
有人知道为什么吗
AddMap<Product>(Product =>
from product in products
let dateTimeUTc = DateTimeZone.Utc.AtStartOfDay(product.ReleasedDate)
let timeTicks = dateTimeUTc.ToInstant().Ticks
let hash = $"{product.Id}|{timeTicks}"
select new IndexEntry
{
Hash = hash,
Usage = 0
});