41 lines
1 KiB
C#
41 lines
1 KiB
C#
using System.Text.Json;
|
||
using Kurs.Platform.Localization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using Microsoft.Extensions.Logging;
|
||
using Volo.Abp;
|
||
using Volo.Abp.Application.Services;
|
||
|
||
namespace Kurs.Platform;
|
||
|
||
/* Inherit your application services from this class.
|
||
*/
|
||
public abstract class PlatformAppService : ApplicationService
|
||
{
|
||
protected PlatformAppService()
|
||
{
|
||
LocalizationResource = typeof(PlatformResource);
|
||
}
|
||
}
|
||
|
||
|
||
public class TestAppService : PlatformAppService
|
||
{
|
||
public dynamic GetTest()
|
||
{
|
||
Logger.LogWarning("{0} adet kayıt ok.", 3);
|
||
Logger.LogWarning(3 + " adet kayıt ok.");
|
||
throw new UserFriendlyException("Toplam 1000'i geçemez");
|
||
//throw new System.Exception("Toplam 1000'i geçemez");
|
||
|
||
return new OkObjectResult(new { Toplam = 2 });
|
||
}
|
||
|
||
[HttpPost]
|
||
public dynamic PostTest(dynamic input)
|
||
{
|
||
var input2 = (string)JsonSerializer.Serialize(input);
|
||
Logger.LogInformation(input2);
|
||
|
||
return new OkObjectResult(input);
|
||
}
|
||
}
|