使用Nodatime的LocalDate在ravendb中创建索引

时间:2017-02-09 07:19:01

标签: c# ravendb ravendb-studio

我希望有人可以帮助我。 我正在使用Ravendb和Nodatime捆绑包,到目前为止,我没有遇到任何问题,直到我想在索引创建过程中使用一些nodatime方法。

产品:

public class Product {
    public string Id { get; set; }
    public LocalDate ReleasedDate { get; set; }
    // and more properties...
}

我的索引创建(AbstractMultiMapIndexCreationTask):

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
            });

随着索引的生成,滴答在那里,除了我在ravendb中为每个索引记录得到一个索引错误之外没有错:

The best overloaded method match for 'NodaTime.DateTimeZone.AtStartOfDay(NodaTime.LocalDate)' has some invalid arguments

有人知道为什么会这样吗?

0 个答案:

没有答案