public void Test_GetCustomerRepository() { IMyRepository _myRepository = IocManager.Instance.Resolve <IMyRepository>(); Customer customer = _myRepository.Get(2); Assert.IsNotNull(customer); Assert.AreEqual(customer.CustomerName, "CC"); }
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)); }
public ActionResult Index(int id) { var model = _repository.Get(id); return(View(model)); }