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

36 lines
810 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>
{
public class Result : IZeroIdEntity, IAppAwareEntity, IZeroDbConventions
{
public string Id { get; set; }
public string AppId { 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,
AppId = x.AppId,
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);
}
}
}