Skip to content

Instantly share code, notes, and snippets.

@renatogroffe
Created November 21, 2024 12:07
Show Gist options
  • Save renatogroffe/f03f35ea8e7f43c898400d7f107c3deb to your computer and use it in GitHub Desktop.
Save renatogroffe/f03f35ea8e7f43c898400d7f107c3deb to your computer and use it in GitHub Desktop.
namespace ConsoleAppFieldKeyword.Models;
public class Temperatura
{
public double Fahrenheit
{
get;
set
{
if (value < -459.67)
throw new ArgumentOutOfRangeException(
$"Valor de temperatura em Fahrenheit invalido: {value}");
field = value;
}
}
public double Celsius
{
get => (Fahrenheit - 32) * 5 / 9;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment