public static TableResourceContainer GetUtilityRowResourceContainer(string accountName, string tableName) { System.Data.Services.Providers.ResourceType resourceType = new System.Data.Services.Providers.ResourceType(typeof(UtilityRow), ResourceTypeKind.EntityType, null, accountName, tableName, false) { CanReflectOnInstanceType = false, IsOpenType = true }; ResourceProperty utilityRowResourceProperty = new UtilityRowResourceProperty("PartitionKey", ResourcePropertyKind.Primitive | ResourcePropertyKind.Key, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(string))) { CanReflectOnInstanceTypeProperty = false }; resourceType.AddProperty(utilityRowResourceProperty); ResourceProperty resourceProperty = new UtilityRowResourceProperty("RowKey", ResourcePropertyKind.Primitive | ResourcePropertyKind.Key, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(string))) { CanReflectOnInstanceTypeProperty = false }; resourceType.AddProperty(resourceProperty); ResourceProperty utilityRowResourceProperty1 = new UtilityRowResourceProperty("Timestamp", ResourcePropertyKind.Primitive | ResourcePropertyKind.ETag, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(DateTime))) { CanReflectOnInstanceTypeProperty = false }; resourceType.AddProperty(utilityRowResourceProperty1); TableResourceContainer tableResourceContainer = new TableResourceContainer(tableName, resourceType); tableResourceContainer.SetReadOnly(); return(tableResourceContainer); }
static TableResourceContainer() { UtilityTableResourceProperty utilityTableResourceProperty = new UtilityTableResourceProperty("TableName", ResourcePropertyKind.Primitive | ResourcePropertyKind.Key, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(string))) { CanReflectOnInstanceTypeProperty = false }; TableResourceContainer.TableNameProperty = utilityTableResourceProperty; UtilityTableResourceProperty utilityTableResourceProperty1 = new UtilityTableResourceProperty("RequestedIOPS", ResourcePropertyKind.Primitive, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(int))) { CanReflectOnInstanceTypeProperty = false }; TableResourceContainer.RequestedIOPSProperty = utilityTableResourceProperty1; UtilityTableResourceProperty utilityTableResourceProperty2 = new UtilityTableResourceProperty("ProvisionedIOPS", ResourcePropertyKind.Primitive, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(int))) { CanReflectOnInstanceTypeProperty = false }; TableResourceContainer.ProvisionedIOPSProperty = utilityTableResourceProperty2; UtilityTableResourceProperty utilityTableResourceProperty3 = new UtilityTableResourceProperty("TableStatus", ResourcePropertyKind.Primitive, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(string))) { CanReflectOnInstanceTypeProperty = false }; TableResourceContainer.TableStatusProperty = utilityTableResourceProperty3; UtilityRowResourceProperty utilityRowResourceProperty = new UtilityRowResourceProperty("PartitionKey", ResourcePropertyKind.Primitive | ResourcePropertyKind.Key, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(string))) { CanReflectOnInstanceTypeProperty = false }; TableResourceContainer.PKProperty = utilityRowResourceProperty; UtilityRowResourceProperty utilityRowResourceProperty1 = new UtilityRowResourceProperty("RowKey", ResourcePropertyKind.Primitive | ResourcePropertyKind.Key, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(string))) { CanReflectOnInstanceTypeProperty = false }; TableResourceContainer.RKProperty = utilityRowResourceProperty1; UtilityRowResourceProperty utilityRowResourceProperty2 = new UtilityRowResourceProperty("Timestamp", ResourcePropertyKind.Primitive | ResourcePropertyKind.ETag, System.Data.Services.Providers.ResourceType.GetPrimitiveResourceType(typeof(DateTime))) { CanReflectOnInstanceTypeProperty = false }; TableResourceContainer.TSProperty = utilityRowResourceProperty2; }