20 lines
433 B
C#
20 lines
433 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.Text.Json;
|
|
|
|
namespace NeDvachAPI.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class List2Controller : ControllerBase
|
|
{
|
|
[HttpGet(Name = "GetPosts")]
|
|
public string Get()
|
|
{
|
|
Post[] posts = DBchat.DbList();
|
|
string postsJson = JsonSerializer.Serialize(posts);
|
|
return postsJson ;
|
|
|
|
}
|
|
}
|
|
}
|