public object FromEntry(DynamoDBEntry entry) { Primitive primitive = entry.AsPrimitive(); string text = primitive.AsString(); Status status = (Status)Enum.Parse(typeof(Status), text); return(status); }
/// <summary> /// Asynchronously gets an audit event from its primary key /// </summary> /// <typeparam name="T">The audit event type</typeparam> /// <param name="hashKey">The primary key Hash portion</param> /// <param name="rangeKey">The primary key Range portion, if any. Otherwise NULL.</param> public async Task <T> GetEventAsync <T>(DynamoDBEntry hashKey, DynamoDBEntry rangeKey) where T : AuditEvent { return(await GetEventAsync <T>(hashKey?.AsPrimitive(), rangeKey?.AsPrimitive())); }
/// <summary> /// Gets an audit event from its primary key /// </summary> /// <typeparam name="T">The audit event type</typeparam> /// <param name="hashKey">The primary key Hash portion</param> /// <param name="rangeKey">The primary key Range portion, if any. Otherwise NULL.</param> public T GetEvent <T>(DynamoDBEntry hashKey, DynamoDBEntry rangeKey) where T : AuditEvent { return(GetEvent <T>(hashKey?.AsPrimitive(), rangeKey?.AsPrimitive())); }
public object FromEntry(DynamoDBEntry entry) { return(TimeSpan.Parse(entry.AsPrimitive().AsString())); }