You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
688B

  1. namespace Campaign_Tracker.Server.Municipalities;
  2. public sealed record MunicipalityAddressSaveResult
  3. {
  4. public bool Saved { get; init; }
  5. public bool IsNotFound { get; init; }
  6. public string? Error { get; init; }
  7. public MunicipalityAddress? Address { get; init; }
  8. public static MunicipalityAddressSaveResult Success(MunicipalityAddress address) =>
  9. new() { Saved = true, Address = address };
  10. public static MunicipalityAddressSaveResult Failure(string error) =>
  11. new() { Error = error };
  12. public static MunicipalityAddressSaveResult NotFound(string addressId) =>
  13. new() { IsNotFound = true, Error = $"Address '{addressId}' not found." };
  14. }

Powered by TurnKey Linux.