first commit
This commit is contained in:
21
MyNewProjectName.Contracts/Common/ServiceResponse.cs
Normal file
21
MyNewProjectName.Contracts/Common/ServiceResponse.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace MyNewProjectName.Contracts.Common
|
||||
{
|
||||
// Generic response model for all API endpoints
|
||||
public class ServiceResponse<T>
|
||||
{
|
||||
// Success status of the request
|
||||
public bool Success { get; set; } = true;
|
||||
|
||||
// Response message
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
// Response data
|
||||
public T? Data { get; set; }
|
||||
|
||||
// Error details if any
|
||||
public List<string>? Errors { get; set; }
|
||||
|
||||
// Field-specific validation errors for frontend form validation
|
||||
public Dictionary<string, List<string>>? FieldErrors { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user