Guest User

Untitled

a guest
Feb 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using StructureMap;
  2. using StructureMap.Configuration.DSL;
  3. using StructureMap.Configuration;
  4. using StructureMap.Pipeline;
  5.  
  6.  
  7. namespace SupplierManual.Data.config
  8. {
  9.     public class DataRegistry : Registry
  10.     {
  11.         protected override void configure()
  12.         {
  13.             ForRequestedType<IRepository>()
  14.                .TheDefaultIsConcreteType<Repository>();
  15.         }
  16.  
  17.     }
  18.  
  19.     public class DBServiceRegistry : Registry
  20.     {
  21.         protected override void configure()
  22.         {
  23.             ForRequestedType<DBDataContext>()
  24.              .TheDefaultIs(() => new DBDataContext())
  25.                .CacheBy(InstanceScope.Hybrid);
  26.         }
  27.     }
  28. }
Add Comment
Please, Sign In to add comment