using System;
namespace Quadarax.Foundation.Core.Object.Dynamic
{
///
/// Defines the interface for dynamic objects that support runtime property management.
///
///
/// This interface provides a contract for objects that can have their properties
/// dynamically added, accessed, and modified at runtime.
///
public interface IDyna : ICloneable
{
///
/// Gets the value of a property as a specified type.
///
/// The type to convert the property value to.
/// The name of the property to get the value from.
/// The value of the property cast to the specified type, or null if the property value is null.
/// Thrown when the property does not exist.
TValue? GetValue(string propertyName);
///
/// Sets the value of a property.
///
/// The type of the value being set.
/// The name of the property to set.
/// The value to set the property to.
/// Thrown when the property does not exist.
void SetValue(string propertyName, TValue? value);
///
/// Clears all property values, setting them to null.
///
void Clear();
///
/// Copies all property values from this instance to a target instance.
///
/// The target instance to copy values to.
///
/// This method only copies values for properties that exist in both instances.
/// It does not create new properties in the target instance.
///
void CopyTo(IDyna target);
}
}