예제 #1
0
        public void Test_GetCustomerRepository()
        {
            IMyRepository _myRepository = IocManager.Instance.Resolve <IMyRepository>();
            Customer      customer      = _myRepository.Get(2);

            Assert.IsNotNull(customer);
            Assert.AreEqual(customer.CustomerName, "CC");
        }
예제 #2
0
 public string DoSomething(string what)
 {
     return($"{_MyRepository.Get(what)} and then the business layer returned it.");
 }
 public SomeModel Get(int id)
 {
     // you could do additional things in the service method
     // like validating the arguments, call data access methods, ...
     return(_repository.Get(id));
 }
예제 #4
0
    public ActionResult Index(int id)
    {
        var model = _repository.Get(id);

        return(View(model));
    }