Task
Implement the core thread-safe context logic using MarshalByRefObject + ILogicalThreadAffinative pattern.
Deliverables
- Create
src/PowerCSharp.Sitecore/PowerCSharp.Sitecore.csproj
- Target frameworks:
net48, net6.0, net8.0
- Implement
SitecoreThreadSafeContext:
- Implements
ISitecoreThreadSafeContext
- Implements
ILogicalThreadAffinative
- Marked as
[Serializable]
- Stores context in CallContext (net48) or AsyncLocal (net6/8)
- Implement
SitecoreContextService:
- Extends
MarshalByRefObject
- Static
Context property for access
- Uses
CallContext.GetData/SetData for context propagation
- Implement
ReflectionSitecoreContextProvider:
- Uses reflection to access Sitecore.Context at runtime
- Caches PropertyInfo for performance
- Gracefully handles missing Sitecore assembly
- Add
Database property only (v1.0.0 scope)
- Add README.md
- Add package to PowerCSharp.sln
- Configure CI/CD
Acceptance Criteria
- Context propagates across thread boundaries
- Reflection-based Sitecore access works at runtime
- Graceful failure when Sitecore unavailable
- No compile-time Sitecore.Kernel dependency
- Unit tests pass for all target frameworks
Task
Implement the core thread-safe context logic using MarshalByRefObject + ILogicalThreadAffinative pattern.
Deliverables
src/PowerCSharp.Sitecore/PowerCSharp.Sitecore.csprojnet48,net6.0,net8.0SitecoreThreadSafeContext:ISitecoreThreadSafeContextILogicalThreadAffinative[Serializable]SitecoreContextService:MarshalByRefObjectContextproperty for accessCallContext.GetData/SetDatafor context propagationReflectionSitecoreContextProvider:Databaseproperty only (v1.0.0 scope)Acceptance Criteria