common useful C# methods