Class ApiResponse<T>
- Namespace
- EchoHub.Core.DTOs
- Assembly
- EchoHub.Core.dll
public record ApiResponse<T> : IEquatable<ApiResponse<T>>
Type Parameters
T
- Inheritance
-
ApiResponse<T>
- Implements
-
- Inherited Members
-
Constructors
ApiResponse(ApiResponse<T>)
protected ApiResponse(ApiResponse<T> original)
Parameters
original ApiResponse<T>
ApiResponse(bool, string?, List<string>?, T?)
public ApiResponse(bool Success, string? Message = null, List<string>? Errors = null, T? Data = default)
Parameters
Success bool
Message string
Errors List<string>
Data T
Properties
Data
public T? Data { get; init; }
Property Value
- T
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
- Type
Errors
public List<string>? Errors { get; init; }
Property Value
- List<string>
Message
public string? Message { get; init; }
Property Value
- string
Success
public bool Success { get; init; }
Property Value
- bool
Methods
Deconstruct(out bool, out string?, out List<string>?, out T?)
public void Deconstruct(out bool Success, out string? Message, out List<string>? Errors, out T? Data)
Parameters
Success bool
Message string
Errors List<string>
Data T
Equals(ApiResponse<T>?)
public virtual bool Equals(ApiResponse<T>? other)
Parameters
other ApiResponse<T>
Returns
- bool
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj object
Returns
- bool
GetHashCode()
public override int GetHashCode()
Returns
- int
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builder StringBuilder
Returns
- bool
ToString()
public override string ToString()
Returns
- string
Operators
operator ==(ApiResponse<T>?, ApiResponse<T>?)
public static bool operator ==(ApiResponse<T>? left, ApiResponse<T>? right)
Parameters
left ApiResponse<T>
right ApiResponse<T>
Returns
- bool
operator !=(ApiResponse<T>?, ApiResponse<T>?)
public static bool operator !=(ApiResponse<T>? left, ApiResponse<T>? right)
Parameters
left ApiResponse<T>
right ApiResponse<T>
Returns
- bool