ASPNetCore/TestAppRuna/API/MathController.cs

28 lines
595 B
C#
Raw Permalink Normal View History

2021-03-24 09:51:02 +00:00
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TestAppRuna.Services;
namespace TestAppRuna.API
{
[Route("api/[controller]")]
[ApiController]
public class MathController : ControllerBase
{
public IMathService MathSvc { get; }
public MathController(IMathService mathService)
{
MathSvc = mathService;
}
[HttpGet]
public int Get()
{
return MathSvc.Add(1, 2);
}
}
}