ClassWithMethods Class
Namespace : CloudNimble.DotNetDocs.Tests.Shared.BasicScenarios
Assembly : CloudNimble.DotNetDocs.Tests.Shared.dll
📋 Definition
public class ClassWithMethods
📝 Summary
Demonstrates various method patterns including synchronous, asynchronous, generic, and overloaded methods.
🎯 Members
Synchronous Methods
Async Methods
Generic Methods
SimpleMethod public void SimpleMethod ()
Basic void method without parameters. MethodWithParameters public string MethodWithParameters ( string input , int count )
Method with parameters and return value. MethodWithOptionalParameters public void MethodWithOptionalParameters ( string required , int optional = 10 )
Method demonstrating optional parameters. AsyncMethod public async Task AsyncMethodAsync ()
Asynchronous method returning Task. AsyncMethodWithResult public async Task ` < string > ` GetDataAsync ()
Asynchronous method returning Task<T>. AsyncMethodWithCancellation public async Task ProcessAsync ( CancellationToken cancellationToken )
Async method with cancellation support. GenericMethod public T GenericMethod < T >( T input )
Generic method with type parameter. ConstrainedGenericMethod public T Process < T >( T item ) where T : class , new ()
Generic method with type constraints.
💡 Usage Examples
Synchronous Usage
Async Usage
Generic Usage
var instance = new ClassWithMethods ();
instance . SimpleMethod ();
var result = instance . MethodWithParameters ( "test" , 5 );
instance . MethodWithOptionalParameters ( "required" );