sozsoft-platform/api/src/Sozsoft.Platform.Application/PlatformAppService.cs
Sedat Öztürk bea5aabffa Seeder güncellemeleri
LogWarning, LogError, LogError
2026-05-26 12:29:46 +03:00

42 lines
1.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 Sozsoft.Platform.Localization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.Application.Services;
namespace Sozsoft.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("Sending test message. {Count}", 3);
Logger.LogWarning("Sending test message. {Count} adet kayıt ok.", 3);
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);
}
}