Skip to content

Commit

Permalink
Provide access to CloudTable
Browse files Browse the repository at this point in the history
Each table in the connection provides access to the underlying CloudTable of the Azure SDK, allowing
for "low level" operations.
  • Loading branch information
Mauricio Diaz Orlich committed Aug 20, 2014
1 parent e58cfe3 commit 3227038
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Madd0.AzureStorageDriver/DataContextTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ public class ");

#line default
#line hidden
this.Write(" }\r\n\r\n");
this.Write("\r\n public TableQuery<TElement> MakeTableQuery<TElement>()\r\n whe" +
"re TElement : ITableEntity\r\n {\r\n return new TableQuery<TElemen" +
"t>();\r\n }\r\n }\r\n\r\n");

#line 48 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 54 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"

foreach (var table in this.Tables)
{
Expand All @@ -123,14 +125,14 @@ public class ");
#line hidden
this.Write(" public class ");

#line 52 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 58 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(table.Name));

#line default
#line hidden
this.Write("Entity : TableEntity\r\n {\r\n ");

#line 54 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 60 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"

foreach (var column in table.Columns)
{
Expand All @@ -142,21 +144,21 @@ public class ");
#line hidden
this.Write(" public ");

#line 60 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 66 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(column.TypeName));

#line default
#line hidden
this.Write(" ");

#line 60 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 66 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(column.Name));

#line default
#line hidden
this.Write("\r\n {\r\n get;\r\n set;\r\n }\r\n ");

#line 65 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 71 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"

}
}
Expand All @@ -166,7 +168,7 @@ public class ");
#line hidden
this.Write(" }\r\n");

#line 70 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 76 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"

}

Expand All @@ -177,7 +179,7 @@ public class ");
return this.GenerationEnvironment.ToString();
}

#line 75 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"
#line 81 "C:\Projects\AzureStorageDriver\Madd0.AzureStorageDriver\DataContextTemplate.tt"

private readonly List<string> DefaultProperties = new List<string> { "PartitionKey", "RowKey", "Timestamp", "ETag" };

Expand Down
6 changes: 6 additions & 0 deletions Madd0.AzureStorageDriver/DataContextTemplate.tt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ foreach (var table in this.Tables)
<#
}
#>

public TableQuery<TElement> MakeTableQuery<TElement>()
where TElement : ITableEntity
{
return new TableQuery<TElement>();
}
}

<#
Expand Down
8 changes: 8 additions & 0 deletions Madd0.AzureStorageDriver/UserQuery/ExtendedTableQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,13 @@ public int? TakeCount
return _query.TakeCount;
}
}

public CloudTable CloudTable
{
get
{
return _table;
}
}
}
}

0 comments on commit 3227038

Please sign in to comment.