Beispiel #1
0
        public async Task <ActionResult <IEnumerable <PongResponse> > > GetAll([FromServices] IPingPongStore pingPong)
        {
            var query = await pingPong.GetAsync();

            var result = query.ToArray();

            return(Ok(PongResponse.MapFrom(result)));
        }
Beispiel #2
0
        public async Task <ActionResult <PongResponse> > InsertSingle(string message, [FromServices] IPingPongStore pingPong)
        {
            var result = await pingPong.InsertAsync(new Ping(message));

            return(Ok(PongResponse.MapFrom(result)));
        }
Beispiel #3
0
        public async Task <PongEntity?> Get(string key, [FromServices] IPingPongStore pingPong)
        {
            var pong = await pingPong.GetSingleAsync(key);

            return(PongEntity.MapFrom(pong));
        }
Beispiel #4
0
        public async Task <IEnumerable <PongEntity> > Get([FromServices] IPingPongStore pingPong)
        {
            var pongs = await pingPong.GetAsync();

            return(PongEntity.MapFrom(pongs));
        }