示例#1
0
        static void Main(string[] args)
        {
            IMyRepository repo = new MyRepository();
            IMyRepository proxyRepo = PolicyInjection.Wrap<IMyRepository>(repo);

            var allProducts = proxyRepo.GetAllProducts();
            foreach (var product in allProducts)
            {
                Console.WriteLine("Product: {0}", product.Name);
            }

            Console.WriteLine();
            var nexus4 = proxyRepo.GetProduct(3);
            Console.WriteLine("Product with Id=3: is {0}", nexus4.Name);

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
示例#2
0
 public AccountController()
 {
     _dbContext=new MyIdentityDbContext();
     _repository=new MyRepository<MyIdentityDbContext, MyUser, long>(_dbContext);
 }
示例#3
0
 public MyUserStore(MyRepository <MyIdentityDbContext, MyUser, long> userRepository)
 {
     _useRepository = userRepository;
 }
 public MyMessageHandler(MyRepository repository, Context context)
 {
     this.context    = context;
     this.repository = repository;
 }
示例#5
0
        // GET: Order/Details/5
        public ActionResult Details(int id)
        {
            MyRepository repository = new MyRepository();

            return(View(repository.GetOrder(id)));
        }
示例#6
0
        // GET: Order
        public ActionResult Index()
        {
            MyRepository repository = new MyRepository();

            return(View(repository.GetOrders()));
        }
示例#7
0
 public Envio_FinalizadoModel(MyRepository <Paquete> repository)
 {
     _repository = repository;
 }
示例#8
0
 public EditModel(MyRepository <Producto> repository, INotyfService notifyService, MyRepository <Negocio> negocioRepository, IAppLogger <EditModel> logger)
 {
     _repository        = repository;
     _notifyService     = notifyService;
     _negocioRepository = negocioRepository;
     _logger            = logger;
 }
示例#9
0
 public EditModel(MyRepository <ApplicationCore.Entities.Cliente> repository, INotyfService notyfService)
 {
     _repository   = repository;
     _notyfService = notyfService;
 }