/// <summary>
        /// Returns the specified error from the database, or null
        /// if it does not exist.
        /// </summary>

        public override ErrorLogEntry GetError(string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            if (id.Length == 0)
            {
                throw new ArgumentException(null, "id");
            }

            var partitionKey = AzureHelper.EncodeAzureKey(ApplicationName);

            var elmahEntity = _cloudTable.CreateQuery <ElmahEntity>()
                              .Where(e => e.PartitionKey == partitionKey && e.RowKey == id)
                              .ToList()
                              .First();

            var error = ErrorXml.DecodeString(elmahEntity.AllXml);

            return(new ErrorLogEntry(this, id, error));
        }
Пример #2
0
 public ElmahEntity(string applicationName)
     : base(AzureHelper.EncodeAzureKey(applicationName), (DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks).ToString("d19"))
 {
 }