Commit 0e3b998
Changed files (1)
product
Gorilla.Commons.Infrastructure
Transactions
product/Gorilla.Commons.Infrastructure/Transactions/CurrentThread.cs
@@ -0,0 +1,14 @@
+using System.Threading;
+
+namespace Gorilla.Commons.Infrastructure.Transactions
+{
+ public class CurrentThread : IThread
+ {
+ public T provide_slot_for<T>() where T : class, new()
+ {
+ var slot = Thread.GetNamedDataSlot(GetType().FullName + typeof (T).FullName);
+ if (null == Thread.GetData(slot)) Thread.SetData(slot, new T());
+ return (T) Thread.GetData(slot);
+ }
+ }
+}
\ No newline at end of file