using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using newtelligence.DasBlog.Runtime;
using Microsoft.Samples.ServiceHosting.StorageClient;
namespace newtelligence.DasBlog.Runtime.Azure{
public class EventDataEntity : TableStorageEntity
{
/// <summary>
///
/// </summary>
/// <remarks>Empty constructor required for Azure Data Services.</remarks>
public EventDataEntity()
: base()
{
//...
}
public EventDataEntity(EventDataItem eventData)
: base()
{
this.EventTimeUtc = eventData.EventTimeUtc;
this.HtmlMessage = eventData.HtmlMessage;
this.EventCode = eventData.EventCode;
// change this?
this.PartitionKey = eventData.EventTimeUtc.ToLongDateString();
this.RowKey = eventData.EventTimeUtc.ToString("HH:mm:ss.ffff");
}
public EventDataItem GetEventDataItem()
{
return new EventDataItem()
{
HtmlMessage = this.HtmlMessage,
EventCode = this.EventCode,
EventTimeLocalTime = this.EventTimeUtc,
};
}
public DateTime EventTimeUtc { get; set; }
public string HtmlMessage { get; set; }
public int EventCode { get; set; }
}
}
|