Пример #1
0
        public Item ToItem()
        {
            var item = new Item
            {
                Payload = Payload
            };

            var ids = PartitionKey.Split('$');
            var productionTimeTicks = long.Parse(RowKey.Split('$')[0]);

            item.PrimaryId      = ids[0];
            item.SecondaryId    = ids[1];
            item.ProductionTime = new DateTimeOffset(productionTimeTicks, TimeSpan.Zero);

            return(item);
        }
Пример #2
0
        protected override void ReadValues(
            IDictionary <string, EntityProperty> properties,
            OperationContext operationContext)
        {
            var parts       = PartitionKey.Split('|');
            var group       = parts[0];
            var encodedName = parts[1];
            var nameBytes   = Convert.FromBase64String(encodedName);
            var name        = Encoding.UTF8.GetString(nameBytes);

            Value.CategoryGroup = (CategoryGroup)Enum.Parse(typeof(CategoryGroup), group);
            Value.CategoryName  = name;
            Value.ProfileId     = Guid.Parse(RowKey);

            base.ReadValues(properties, operationContext);
        }
Пример #3
0
 public string GetFeedName()
 {
     return(PartitionKey.Split(new[] { splitToken }, StringSplitOptions.None)[1]);
 }