Files
mixtape/zero.Core/Database/Indexes/Pages_AsHistory.cs
T

33 lines
725 B
C#
Raw Normal View History

2020-08-31 16:01:18 +02:00
using Raven.Client.Documents.Indexes;
using System;
using System.Collections.Generic;
using System.Linq;
using zero.Core.Entities;
namespace zero.Core.Database.Indexes
{
public class Pages_AsHistory : AbstractIndexCreationTask<IPage, Pages_AsHistory.Result>
{
2020-11-14 12:34:26 +01:00
public class Result : IZeroIdEntity, IZeroDbConventions
2020-08-31 16:01:18 +02:00
{
public string Id { get; set; }
2020-09-17 13:25:09 +02:00
public DateTimeOffset LastModified { get; set; }
2020-08-31 16:01:18 +02:00
}
public Pages_AsHistory()
{
Map = items => items
.Select(x => new Result()
{
Id = x.Id,
2020-09-17 13:25:09 +02:00
LastModified = x.LastModifiedDate
2020-08-31 16:01:18 +02:00
});
StoreAllFields(FieldStorage.Yes);
//Index(x => x.ChannelId, FieldIndexing.Exact);
}
}
}