public ControllerBase() { RolForContext = DependencyResolver.Current.GetService <RolForContext>(); AuthenticationService = DependencyResolver.Current.GetService <IAuthenticationService>(); ContainersRepository = new ContainersRepository(RolForContext); MessagesRepository = new MessagesRepository(RolForContext); NewsRepository = new NewsRepository(RolForContext); UsersRepository = new UsersRepository(RolForContext); }
public BaseViewPage() { var rolForContext = DependencyResolver.Current.GetService <RolForContext>(); ContainersRepository = new ContainersRepository(rolForContext); MessagesRepository = new MessagesRepository(rolForContext); NewsRepository = new NewsRepository(rolForContext); UsersRepository = new UsersRepository(rolForContext); }
private Container ValidateAndGetContainer(int containerId) { var container = ContainersRepository.Get(containerId); if (!ContainersRepository.IsLeaf(containerId)) { throw new Exception($"Контейнер с id = {containerId} не может содержать сообщений," + " т.к. является родителем для других контейнеров."); } return(container); }
public ActionResult Show(int containerId) { var container = ContainersRepository.Get(containerId); if (ContainersRepository.IsLeaf(containerId)) { return(RedirectToAction("Show", "Messages", new { containerId })); } ViewBag.Parent = container; ViewBag.Children = ContainersRepository.GetChildren(containerId); return(View("Containers")); }
public Part2() { containersRepository = new ContainersRepository(); containersCombinations = new ContainersCombinations(); }
public ContainersControllerTest() { _service = new ContainersRepository(); _controller = new ContainersController(_service); }