C# Class Sample.UserRepository

Show file Open project: Hallmanac/AzureCloudTable Class Usage Examples

Public Properties

Property Type Description
UserContext CloudTableContext

Public Methods

Method Description
GetAllUsers ( ) : List
GetAllVersions ( User givenUser ) : IEnumerable
GetUsersByFirstName ( string firstName ) : IEnumerable
GetUsersByTypeOfUser ( string userType ) : List
GetUsersThatLiveInFlorida ( ) : List
Save ( User user ) : void
UserRepository ( ) : System.Collections.Generic

Private Methods

Method Description
InitPartitionSchemas ( ) : void

The partition schemas are how your domain object gets sorted/categorized/grouped inside Azure Table storage. You create them in your client code and then "add" them to the CloudTableContext class that you're using to interact with the Table (in this case _userContext). Remember, these are just schema definitions for one particular PartitionKey. There is a DefaultSchema that get set on the CloudTableContext class automatically (in this case _userContext) which sets the PartitionKey to be the name of the object Type and the RowKey based on the Id property of the object provided during intialization.

Method Details

GetAllUsers() public method

public GetAllUsers ( ) : List
return List

GetAllVersions() public method

public GetAllVersions ( User givenUser ) : IEnumerable
givenUser User
return IEnumerable

GetUsersByFirstName() public method

public GetUsersByFirstName ( string firstName ) : IEnumerable
firstName string
return IEnumerable

GetUsersByTypeOfUser() public method

public GetUsersByTypeOfUser ( string userType ) : List
userType string
return List

GetUsersThatLiveInFlorida() public method

public GetUsersThatLiveInFlorida ( ) : List
return List

Save() public method

public Save ( User user ) : void
user User
return void

UserRepository() public method

public UserRepository ( ) : System.Collections.Generic
return System.Collections.Generic

Property Details

UserContext public property

public CloudTableContext UserContext
return CloudTableContext