Some other func

This commit is contained in:
2025-01-06 08:58:17 +01:00
parent 8bbcbfab09
commit a80870b5c3
9 changed files with 118 additions and 19 deletions
@@ -0,0 +1,39 @@
using System.Text.Json.Serialization;
namespace WorkFlowCheck.BL.DTO
{
public class ApiResponseBaseDTO
{
public bool IsSuccess { get; set; }
public IEnumerable<string> Errors { get; set; }
public bool HandleError { get; set; }
public string Error
{
get
{
if (Errors == null || Errors.Count() == 0) return string.Empty;
return string.Join(';', Errors);
}
}
}
public class ApiResponseDTO : ApiResponseBaseDTO
{
public object Data { get; set; }
}
public interface IApiResponseDTO<out T>
{
}
public class ApiResponseDTO<T> : ApiResponseBaseDTO, IApiResponseDTO<T>
{
public T Data { get; set; }
}
public class ApiResponseListDTO<T> : ApiResponseBaseDTO
{
public T[] Data { get; set; }
public int Total { get; set; }
}
}
-10
View File
@@ -1,10 +0,0 @@
using System.Text.Json.Serialization;
namespace WorkFlowCheck.BL.DTO
{
[JsonSerializable(typeof(ResponseDTO))]
public class ResponseDTO
{
public string Message { get; set; } = null!;
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace WorkFlowCheck.BL.DTO
{
public class UserDTO
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public string Email { get; set; } = null!;
}
}