/// <inheritdoc /> async Task <Floor> IRepository <int, Floor> .FindAsync(int identifier, CancellationToken cancellationToken) { IFloorRepository self = this; var request = new FloorRequest { ContinentId = self.ContinentId, Floor = identifier, Culture = self.Culture }; var response = await this.serviceClient.SendAsync <FloorDTO>(request, cancellationToken).ConfigureAwait(false); if (response.Content == null) { return(null); } var floor = this.floorConverter.Convert(response.Content, response); if (floor == null) { return(null); } floor.ContinentId = this.continentId; floor.FloorId = identifier; floor.Culture = response.Culture; return(floor); }
/// <inheritdoc /> Floor IRepository <int, Floor> .Find(int identifier) { IFloorRepository self = this; var request = new FloorRequest { ContinentId = self.ContinentId, Floor = identifier, Culture = self.Culture }; var response = this.serviceClient.Send <FloorDTO>(request); if (response.Content == null) { return(null); } var floor = this.floorConverter.Convert(response.Content, null); if (floor == null) { return(null); } floor.ContinentId = this.continentId; floor.FloorId = identifier; floor.Culture = request.Culture; return(floor); }
/// <inheritdoc /> Task <Floor> IRepository <int, Floor> .FindAsync(int identifier, CancellationToken cancellationToken) { IFloorRepository self = this; var request = new FloorRequest { ContinentId = self.ContinentId, Floor = identifier, Culture = self.Culture }; var responseTask = this.serviceClient.SendAsync <FloorDataContract>(request, cancellationToken); return(responseTask.ContinueWith(task => this.ConvertAsyncResponse(task, this.continentId, identifier, request.Culture), cancellationToken)); }