Beispiel #1
0
        public override void ReadEntity(IDictionary <string, EntityProperty> properties, OperationContext operationContext)
        {
            base.ReadEntity(properties, operationContext);
            var split = RowKey.Split(':');

            CategoryId = split[0];
            Locale     = split[1];
        }
        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);
        }
Beispiel #3
0
        internal void ParseSiloAddressFromRowKey()
        {
            const string debugInfo = "ParseSiloAddressFromRowKey";

            try
            {
                var segments = RowKey.Split(SeparatorChars, 4);

                ClusterId  = segments[0];
                Address    = IPAddress.Parse(segments[1]);
                Port       = Int32.Parse(segments[2]);
                Generation = Int32.Parse(segments[3]);

                this.SiloAddress = SiloAddress.New(new IPEndPoint(Address, Port), Generation);
            }
            catch (Exception exc)
            {
                throw new FormatException("Error from " + debugInfo, exc);
            }
        }