mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
19 lines
505 B
C#
19 lines
505 B
C#
namespace Core;
|
|
|
|
public class User
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Email { get; set; } = string.Empty;
|
|
public int Age { get; set; }
|
|
}
|
|
|
|
public class Result<T>
|
|
{
|
|
public bool Success { get; set; }
|
|
public T? Data { get; set; }
|
|
public string? ErrorMessage { get; set; }
|
|
|
|
public static Result<T> Ok(T data) => new() { Success = true, Data = data };
|
|
public static Result<T> Fail(string error) => new() { Success = false, ErrorMessage = error };
|
|
}
|