コード例 #1
0
            public object FromEntry(DynamoDBEntry entry)
            {
                Primitive primitive = entry.AsPrimitive();
                string    text      = primitive.AsString();
                Status    status    = (Status)Enum.Parse(typeof(Status), text);

                return(status);
            }
コード例 #2
0
 /// <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()));
 }
コード例 #3
0
 /// <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()));
 }
コード例 #4
0
 public object FromEntry(DynamoDBEntry entry)
 {
     return(TimeSpan.Parse(entry.AsPrimitive().AsString()));
 }