public SchemaProperty(LogDeserializeContext context) { Name = context.br.ReadString(); Type = context.br.ReadString(); IsRequired = context.br.ReadBoolean(); }
public Page(LogDeserializeContext context) { Uuid = context.br.ReadGuid(); Title = context.br.ReadNullableString(); Body = context.br.ReadNullableString(); BodyPlainText = context.br.ReadNullableString(); BodyHtml = context.br.ReadNullableString(); }
internal static void Deserialize(ILogDescriptor descriptor, LogDeserializeContext context) { descriptor.Version = context.br.ReadUInt64(); // Version descriptor.PreviousHash = context.br.ReadVarBuffer(); // PreviousHash descriptor.HashRoot = context.br.ReadVarBuffer(); // HashRoot descriptor.Timestamp = context.br.ReadUInt128(); // Timestamp descriptor.Nonce = context.br.ReadVarBuffer(); // Nonce }
protected Privilege(LogDeserializeContext context) { Subject = context.br.ReadVarBuffer(); Type = context.br.ReadString(); Value = context.br.ReadString(); Authority = context.br.ReadVarBuffer(); Signature = context.br.ReadVarBuffer(); }
public MediaEntry(LogDeserializeContext context) { Uuid = context.br.ReadGuid(); Type = context.br.ReadString(); Name = context.br.ReadString(); Length = context.br.ReadUInt64(); Data = context.br.ReadVarBuffer(); }
private IEnumerable <MediaEntry> Get(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); using var tx = env.Value.BeginTransaction(TransactionBeginFlags.ReadOnly); using var db = tx.OpenDatabase(configuration: Config); using var cursor = tx.CreateCursor(db); var results = new List <MediaEntry>(); var key = _mediaKeyBuilder.GetAllKey(); if (cursor.SetRange(key) != MDBResultCode.Success) { return(NoEntries); } var current = cursor.GetCurrent(); while (current.resultCode == MDBResultCode.Success && !cancellationToken.IsCancellationRequested) { unsafe { var value = current.value.AsSpan(); fixed(byte *buf = &value.GetPinnableReference()) { var ms = new UnmanagedMemoryStream(buf, value.Length); var br = new BinaryReader(ms); var context = new LogDeserializeContext(br, _typeProvider); var entry = new MediaEntry(context); results.Add(entry); } var next = cursor.Next(); if (next == MDBResultCode.Success) { current = cursor.GetCurrent(); } else { break; } } } return(results); }
internal LogObject(LogDeserializeContext context) { Index = context.br.ReadInt32(); // Index Type = context.br.ReadNullableUInt64(); // Type Version = context.br.ReadUInt64(); // Version Timestamp = context.br.ReadUInt128(); // Timestamp Hash = context.br.ReadVarBuffer(); // Hash if (!context.br.ReadBoolean() || !Type.HasValue) { return; } var type = context.typeProvider.Get(Type.Value); if (type != null) { Data = context.typeProvider.Deserialize(type, context); } }
public Namespace(LogDeserializeContext context) { Value = context.br.ReadString(); }
// ReSharper disable once UnusedMember.Global (needed for deserialization) public RevokeRole(LogDeserializeContext context) : base(context) { }
// ReSharper disable once UnusedMember.Global (needed for deserialization) public GrantRole(LogDeserializeContext context) : base(context) { }
public User(LogDeserializeContext context) { Uuid = context.br.ReadGuid(); Name = context.br.ReadNullableString(); EmailAddress = context.br.ReadNullableString(); }