// Generated by @typespec/http-server-csharp
// <auto-generated />
#nullable enable

using System;using System.Net;using System.Threading.Tasks;using System.Text.Json;using System.Text.Json.Serialization;using Microsoft.AspNetCore.Mvc;using PetStore;

namespace PetStore.Controllers
{
[ApiController]
public partial class DogsController: ControllerBase
{

public DogsController(IDogs operations)
{
    DogsImpl = operations;
}
internal virtual IDogs DogsImpl { get;}

        ///<summary>
/// List all dogs
///</summary>
        [HttpGet]
        [Route("/dogs")]
        [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(Dog[]))]
        public virtual async Task<IActionResult> List()
        {
          var result = await DogsImpl.ListAsync();
          return Ok(result);
        }

        ///<summary>
/// Get a dog by ID
///</summary>
        [HttpGet]
        [Route("/dogs/{id}")]
        [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(Dog))]
        public virtual async Task<IActionResult> Read(long id)
        {
          var result = await DogsImpl.ReadAsync(id);
          return Ok(result);
        }

}
}
