Files
Examples/GerstITS.Examples.Api/Controllers/1.1/ExampleController.cs
2021-06-15 10:59:47 +02:00

53 lines
1.4 KiB
C#

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
{
/// <summary>
/// Is responsible to get employee organization assignment examples.
/// </summary>
[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
/// <summary>
/// Gets a employee organization assignment by specified id.
/// </summary>
/// <param name="id">Id of the employee organization assignment.</param>
/// <returns>Returns an employee organization assignment</returns>
[HttpGet,
Route("{id}")]
public IActionResult Get(int id)
{
return Api().Use(id)
.Get(_provider.GetById_v1_1);
}
#endregion
}
}