Skip to main content

SampleClass Class

Namespace: CloudNimble.DotNetDocs.Tests.Shared
Assembly: CloudNimble.DotNetDocs.Tests.Shared.dll

📋 Definition

public class SampleClass

Class Hierarchy

📝 Summary

A simple example class that demonstrates basic property patterns for documentation scenarios. This class provides a minimal implementation useful for testing documentation generation.

🎯 Members

Name

Name
string
Gets or sets the name of the sample instance
public string Name { get; set; }
Access Modifier: public
Type: string
Getter: public
Setter: public
  • Default Value: null
  • Thread Safety: Not thread-safe
  • Nullability: Can be null

💡 Usage Examples

using CloudNimble.DotNetDocs.Tests.Shared;

// Create an instance
var sample = new SampleClass();

// Set the name property
sample.Name = "My Sample";

// Read the name property
Console.WriteLine($"Sample name: {sample.Name}");

🔧 Implementation Details

This class has minimal memory overhead with only one string property. The string reference adds 8 bytes on 64-bit systems plus the string content itself.
This class can be easily serialized to JSON or XML. All properties are public with both getters and setters.
// JSON serialization example
var json = JsonSerializer.Serialize(sample);
var deserialized = JsonSerializer.Deserialize`<SampleClass>`(json);
This class uses default reference equality. Two instances with the same Name value are not considered equal unless they reference the same object.

⚠️ Important Notes

This is a simple demonstration class. In production scenarios, consider adding validation, null checks, and proper encapsulation.
Use this class as a template for creating your own simple data transfer objects (DTOs) or model classes.

📚 See Also


Ready to explore more? Check out the BasicScenarios namespace for more complex examples.