Skip to content

Instantly share code, notes, and snippets.

@Blind-Striker
Created September 6, 2017 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Blind-Striker/e31d7cb55be44f577d680ce53877e9fd to your computer and use it in GitHub Desktop.
Save Blind-Striker/e31d7cb55be44f577d680ce53877e9fd to your computer and use it in GitHub Desktop.
New out example for blog
public void UpdateUserBalance(int userId, string balance) // harici bir sistemden gelen string data
{
if (decimal.TryParse(balance, out decimal userBalance)) // decimal yerine var'da kullanabiliriz
{
Console.WriteLine($"{userId} id'li kullanıcının bakiyesi {userBalance}");
}
else
{
Console.WriteLine("Geçerisiz bir değer girildi");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment