Orc.DynamicObjects is a .NET library that provides dynamic object support built on top of Catel. It enables creation of objects whose members are not known at compile time, while still benefiting from Catel's property change notification, validation, and serialisation infrastructure.
The library exposes two primary base classes:
DynamicModelBase— Extends Catel'sModelBasewithIDynamicMetaObjectProvidersupport. Dynamic properties are registered at runtime and fully participate in Catel's property system.DynamicObservableObject— Extends Catel'sObservableObjectwith a lightweight dictionary-backed dynamic property store andINotifyPropertyChangedintegration.
These rules are non-negotiable. Violating them causes broken builds, crashes, or downstream breakage.
Files matching *.generated.cs are auto-generated.
- NEVER manually edit these files
This project maintains a stable public API. Breaking changes break downstream consumers.
| Allowed | Never |
|---|---|
| Add new overloads | Modify existing signatures |
| Add new methods | Remove public APIs |
| Add new classes | Change return types |
Building alone is NOT sufficient. Run tests before claiming completion (see Commands).
Direct commits to protected branches are a policy violation.
| Repository | Protected Branches |
|---|---|
| Orc.DynamicObjects | master |
| Orc.DynamicObjects | develop |
Required workflow:
- Create a feature branch FIRST — Use naming convention:
feature/issue-NNNN-description - Make all commits on the feature branch — Never commit directly to protected branches
- Submit a Pull Request — Changes must be reviewed by a human before merging
# CORRECT — Always create a feature branch first
git checkout -b feature/issue-1234-fix-description
# NEVER DO THIS — Policy violation
git checkout develop && git commit # FORBIDDEN
# NEVER DO THIS — Policy violation
git checkout master && git commit # FORBIDDENSingle source of truth for all commands:
| Task | Command |
|---|---|
| Build | dotnet cake --target=build |
| Test | dotnet cake --target=test |
| Build and test | dotnet cake --target=buildandtest |
src/Orc.DynamicObjects # Main library (net8.0, net9.0, net10.0)
src/Orc.DynamicObjects.Tests # NUnit test project
src/Orc.DynamicObjects.Example # Example / sample project
deployment/ # Build and deployment scripts (Cake)
| Type | Description |
|---|---|
DynamicModelBase |
Catel ModelBase + IDynamicMetaObjectProvider |
DynamicModelBaseMetaObject |
DynamicMetaObject binder for DynamicModelBase |
DynamicObservableObject |
Catel ObservableObject + dictionary-backed dynamic properties |
DynamicObservableObjectMetaObject |
DynamicMetaObject binder for DynamicObservableObject |
| Directory / Pattern | Editable? | Notes |
|---|---|---|
*.generated.cs |
No | Auto-generated — leave as-is |
deployment/ |
No | Build / deployment scripts |
src/Orc.DynamicObjects/ |
Yes | Main library source |
src/Orc.DynamicObjects.Tests/ |
Yes | Tests |
| Anti-Pattern | Why |
|---|---|
| Modifying public method signatures | ABI breaking |
Manual edits to *.generated.cs |
Overwritten on regenerate |
| Using default parameters in public APIs | ABI breaking |
| Skipping failing tests | Unacceptable — tests must pass |
dotnet cake --target=testNON-NEGOTIABLE: Tests must PASS before claiming completion.
- Do NOT skip failing tests
- Do NOT claim completion if tests fail
- Do NOT use
SkipExceptionto work around failures
- Use NUnit to write tests
- Create a
Factsclass for a feature (e.g.DynamicModelBaseFacts) - Nest inner
[TestFixture]classes per scenario - Combine Pascal / Snake case for test methods (e.g.
CorrectlyReturns_TheRightValue)
public class DynamicModelBaseFacts
{
public class DynamicModel : DynamicModelBase { }
[TestFixture]
public class The_GetValue_Properties
{
[TestCase]
public void ReturnsDynamicPropertyValue()
{
dynamic model = new DynamicModel();
model.SomeProperty = "test";
Assert.That((string)model.SomeProperty, Is.EqualTo("test"));
}
}
}Philosophy: Tests FAIL when wrong, never skip (except missing hardware).
- Establish baseline — What's the known-good state?
- One change at a time — Verify each change before proceeding
- Track changes in a table — Log what you changed and the result
- Platform differences are signals — If X works and Y fails, the difference IS the answer
- Revert if worse — Don't pile fixes on top of failures
| Topic | Document |
|---|---|
| Contributing guidelines | CONTRIBUTING.md |
| Catel (base framework) | https://github.com/catel/catel |
| Documentation portal | http://opensource.wildgums.com |