public IEnumerable <ConferenceRoom> Handle(GetConferenceRoomsRequest message) { var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnection"].ConnectionString); var client = storageAccount.CreateCloudTableClient(); var table = client.GetTableReference("ConferenceRooms"); table.CreateIfNotExists(); var query = new TableQuery <Entities.ConferenceRoom>(); if (!string.IsNullOrEmpty(message.Location)) { query = query.Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, message.Location.ToLower())); } var results = table.ExecuteQuery(query); return(Mapper.Map <IEnumerable <ConferenceRoom> >(results)); }
public IEnumerable <ConferenceRoom> Get([FromUri] GetConferenceRoomsRequest request) { return(_mediator.Send(request)); }