Pemvedr.Common.Projections.RavenDb 0.2.20240629.1

Pemvedr.Common.Projections.RavenDb

Structure

Name Description
\Log\ Classes which can be used to configure RavenDb as logtarget
GenericProjectionRepository an implementation of a repository to store projections to a ravendb documentstore

Examples

Create a projection

public class Projection : IProjection<Projection, Guid>
{
    public Projection(Guid id, ETag etag)
    {
        Id = id;
        ETag = etag;
    }
    public Guid Id { get; }

    public ETag ETag { get; }

    public Projection WithETag(ETag etag) => new Projection(Id, etag);
}

Create a Repository for the projection

public interface IProjectionRepository : IGenericMoldingRepository<Projection, Guid>
{
    Task<IReadOnlyCollection<...>> OtherMethods(...);
}

public class ProjectionRepository : GenericProjectionRepository<Projection>, IProjectionRepository
{
    public ProjectionRepository(DatabaseSessionProvider sessionProvider, ILog log) : base(sessionProvider, log) {}

    public Task<IReadOnlyCollection<...>>>> OtherMethods(...)
		=> Query(model => model.Cargo...);
}

Create a Repository for entities which expire (Deleted after a specified date/time)

public class ProjectionRepository : GenericProjectionRepository<Projection>, IProjectionRepository
{
    public ProjectionRepository(DatabaseSessionProvider sessionProvider, ILog log, ITimeProvider timeProvider) : base(sessionProvider, log, AdvancedOptions<Projection>.Empty.WithExpiration(projection => timeProvider.Get().AddDays(10))) {}
}
  • For the SessionProvider see Pemvedr.Common.RavenDb
  • For ILog see Pemvedr.Common.Logging

Development hints

none

See also

No packages depend on Pemvedr.Common.Projections.RavenDb.

.NET 8.0

Version Downloads Last updated
0.2.20241101.1 7 11/01/2024
0.2.20241031.2 5 10/31/2024
0.2.20241031.1 6 10/31/2024
0.2.20241030.1 6 10/30/2024
0.2.20240903.1 6 09/02/2024
0.2.20240629.1 5 06/29/2024
0.2.20240602.1 5 06/02/2024
0.2.20240401.1 5 04/01/2024
0.2.20240122.2 6 01/22/2024
0.2.20220916.4 10 09/16/2022
0.2.20220429.1 7 05/15/2022
0.2.20220327.1 6 05/15/2022
0.2.20201217.1 7 05/15/2022
0.2.20201211.1 6 05/15/2022
0.2.20201209.1 6 05/15/2022
0.2.20201207.1 5 05/15/2022
0.2.20201206.1 5 05/15/2022
0.2.20201105.3 5 05/15/2022
0.2.20201103.14 5 05/15/2022
0.1.19257.1 4 05/15/2022
0.1.19254.3 5 05/15/2022
0.1.19252.2 5 05/15/2022
0.1.19251.1 6 05/15/2022
0.1.19247.1 5 05/15/2022
0.1.19246.2 5 05/15/2022
0.1.19183.4 5 05/15/2022
0.1.19171.3 5 05/15/2022
0.1.19157.8 6 05/15/2022
0.1.19157.5 5 05/15/2022