예제 #1
0
            public ObjectToITableEntityConverter()
            {
                // JObject case should have been claimed by another converter.
                // So we can statically enforce an ITableEntity compatible contract
                var t = typeof(TElement);

                TableClient.VerifyContainsProperty(t, "RowKey");
                TableClient.VerifyContainsProperty(t, "PartitionKey");
            }
예제 #2
0
        public ITableArgumentBinding TryCreate(Type parameterType)
        {
            if (!parameterType.IsGenericType ||
                (parameterType.GetGenericTypeDefinition() != typeof(IAsyncCollector <>)))
            {
                return(null);
            }

            Type entityType = GetCollectorItemType(parameterType);

            if (!TableClient.ImplementsOrEqualsITableEntity(entityType))
            {
                TableClient.VerifyContainsProperty(entityType, "RowKey");
                TableClient.VerifyContainsProperty(entityType, "PartitionKey");
            }

            return(CreateBinding(entityType));
        }