erp-platform/api/src/Kurs.Platform.Application/PlatformAppService.cs
Sedat ÖZTÜRK e1a9562b22 init project
2025-05-06 09:45:49 +03:00

41 lines
1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}