using GerstITS.Examples.Api.Versioning;
using GerstITS.Examples.Logic.Example;
using GerstITS.Validation;
using GerstITS.Web.Api;
using GerstITS.Web.Api.FluentApi;
using Microsoft.AspNetCore.Mvc;
namespace GerstITS.Examples.Api.Controllers._1._1
{
///
/// Is responsible to get employee organization assignment examples.
///
[ApiController,
ApiVersion(Versions._1_1),
Route(ApplicationEnvironment.WebApi.ControllerRouteTemplate)]
public class ExampleController : FluentApiControllerBase
{
#region Fields
private readonly IExampleProvider _provider;
#endregion
#region Constructors
public ExampleController(IExampleProvider provider,
IValidator validator)
: base(validator)
{
_provider = provider;
}
#endregion
#region Methods
///
/// Gets a employee organization assignment by specified id.
///
/// Id of the employee organization assignment.
/// Returns an employee organization assignment
[HttpGet,
Route("{id}")]
public IActionResult Get(int id)
{
return Api().Use(id)
.Get(_provider.GetById_v1_1);
}
#endregion
}
}