Exemplo n.º 1
0
 public ToDosController(IToDoRepository toDoRepository, UserManager <ApplicationUser> userManager, IMapper mapper, DataContext dataContext)
 {
     this.mapper         = mapper;
     this.dataContext    = dataContext;
     this.toDoRepository = toDoRepository;
     this.userManager    = userManager;
 }
Exemplo n.º 2
0
 public ToDoService(IToDoRepository doRepository, IUserRepository userRepository,
                    IProjectRepository projectRepository)
 {
     _toDoRepository    = doRepository;
     _userRepository    = userRepository;
     _projectRepository = projectRepository;
 }
Exemplo n.º 3
0
        public ToDoController(IToDoRepository todoItems)
        {
            DBTest test = new DBTest();
            string ctn  = test.GetCarton();

            ToDoItems = todoItems;
        }
Exemplo n.º 4
0
 public ToDoController(
     IToDoRepository toDoRepository,
     IEventBus eventBus)
 {
     _toDoRepository = toDoRepository;
     _eventBus       = eventBus;
 }
Exemplo n.º 5
0
 public HomeController(IMapper mapper, IUnitOfWork unitOfWork, IToDoRepository repository, ToDoDbContext context)
 {
     this.unitOfWork = unitOfWork;
     this.repository = repository;
     this.context    = context;
     this.mapper     = mapper;
 }
        async Task ITask.PerformAsAsync(Actor actor)
        {
            IToDoRepository repo = actor.GetService <IToDoRepository>();

            repo.AddToDoItem(item);
            await repo.CommitAsync();
        }
Exemplo n.º 7
0
 public ToDoService(
     IToDoRepository toDoRepository
     , ICategoryRepository categoryRepository)
 {
     _toDoRepository     = toDoRepository;
     _categoryRepository = categoryRepository;
 }
Exemplo n.º 8
0
 public IToDoRepository GetToDoRepository()
 {
     if (toDoRepository == null)
     {
         toDoRepository = new ToDoViewRepository(context);
     }
     return(toDoRepository);
 }
Exemplo n.º 9
0
 public MainViewModel(IToDoRepository repository)
 {
     Messenger.Default.Register <EditTodoItemMessage>(this, OnEditTodoItemMessageReceived);
     SaveCategoryCommand = new RelayCommand(SaveCategory);
     SaveTodoItemCommand = new RelayCommand(SaveTodo);
     _repository         = repository;
     _categories         = _repository.GetCategories();
 }
Exemplo n.º 10
0
        public ToDoRepositoryTest()
        {
            _options = new DbContextOptionsBuilder <ToDoDbContext>()
                       .UseInMemoryDatabase(databaseName: "ToDoDb_UT")
                       .Options;
            var context = new ToDoDbContext(_options);

            _toDoRepository = new ToDoRepository(context);
        }
Exemplo n.º 11
0
 public ToDoAppService(IRepository <ToDo, Guid> repository, ToDoManager toDoManager, IProjectRepository projectRepository,
                       IRepository <AppUser, Guid> userRepository, IRepository <ToDoItem, Guid> toDoItemRepository, IToDoRepository toDoRepository) : base(repository)
 {
     _toDoManager        = toDoManager;
     _projectRepository  = projectRepository;
     _userRepository     = userRepository;
     _toDoItemRepository = toDoItemRepository;
     _toDoRepository     = toDoRepository;
 }
Exemplo n.º 12
0
 public ToDoService(
     ILoginService loginService,
     IToDoRepository todoRepository,
     IMapper mapper)
 {
     this.mapper         = mapper;
     this.todoRepository = todoRepository;
     this.loginService   = loginService;
 }
Exemplo n.º 13
0
 public ToDoController(
     IToDoRepository toDoRepository,
     IUnitOfWork unitOfWork,
     IMapper mapper)
 {
     this._toDoRepository = toDoRepository;
     this._mapper         = mapper;
     this._unitOfWork     = unitOfWork;
 }
Exemplo n.º 14
0
 public HouseholdController(IBillRepository billRepository, IShoppingRepository shoppingRepository, IPeopleRepository peopleRepository, IToDoRepository toDoRepository,
                            IHouseholdRepository householdRepository, IUserService userService, IInviteLinkService inviteLinkService)
 {
     _userService        = userService;
     _inviteLinkService  = inviteLinkService;
     _billRepository     = billRepository;
     _shoppingRepository = shoppingRepository;
     _peopleRepository   = peopleRepository;
     _toDoRepository     = toDoRepository;
     _houseRepository    = householdRepository;
 }
Exemplo n.º 15
0
 public MainViewModel()
 {
     DataList               = new List <ToDo>();
     SelectedToDo           = null;
     AddCommand             = new StandardCommand(Add);
     DeleteCommand          = new StandardCommand(Delete);
     UpdateCommand          = new StandardCommand(Update);
     _ToDoRepository        = RepositoryFactory.Create(ConfigurationManager.AppSettings["Repository"]);
     _ToDoCateoryRepository = _ToDoRepository as IToDoRepository <ToDoCategory>;
     SearchCommand          = new StandardCommand(Search);
     Suchwort               = "";
 }
Exemplo n.º 16
0
 public ToDoService(IEmployeeRepository employeeRepository, IToDoRepository toDoRepository, IToDoResultRepository toDoResultRepository,
                    IGroupRepository groupRepository, ICustomerRepository customerRepository, IUnitOfWork uow, IGroupService groupservice, ISimpleEmployeeRepository simpleEmployeeRepository)
 {
     _employeeRepository       = employeeRepository;
     _toDoRepository           = toDoRepository;
     _toDoResultRepository     = toDoResultRepository;
     _groupRepository          = groupRepository;
     _customerRepository       = customerRepository;
     _groupservice             = groupservice;
     _simpleEmployeeRepository = simpleEmployeeRepository;
     _uow = uow;
 }
Exemplo n.º 17
0
        public async Task AUserShouldSeeOnlyTheirTasks()
        {
            var contentRoot    = Path.Combine(Directory.GetCurrentDirectory(), "../../../../../src/WebSite");
            var webHostBuilder = new WebHostBuilder()
                                 .UseContentRoot(contentRoot)
                                 .UseEnvironment(EnvironmentName.Development)
                                 .ConfigureAppConfiguration((hostingContext, config) =>
            {
                var env = hostingContext.HostingEnvironment;

                config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);

                if (env.IsDevelopment())
                {
                    var appAssembly = Assembly.Load(new AssemblyName(env.ApplicationName));
                    if (appAssembly != null)
                    {
                        config.AddUserSecrets(appAssembly, optional: true);
                    }
                }
                config.AddEnvironmentVariables();
            })
                                 .UseStartup <TestStartup>();

            Server = new TestServer(webHostBuilder);

            IToDoRepository repo =
                Server.Host.Services.GetService(typeof(IToDoRepository)) as IToDoRepository;

            TestData.InitialToDos.ForEach(item => repo.AddToDoItem(item));
            await repo.CommitAsync();

            var client   = Server.CreateClient();
            var response = await client.GetAsync(Uris.Home);

            var content = await response.Content.ReadAsStringAsync();

            var parser   = new HtmlParser();
            var document = await parser.ParseAsync(content);

            var listItems = document.QuerySelectorAll($"{Html.Ul}#todolist>li");

            Assert.NotEmpty(listItems);
            var items = TestData.InitialToDos.Select(item => item.Title);

            foreach (var li in listItems)
            {
                Assert.Contains(li.InnerHtml, items);
            }
        }
Exemplo n.º 18
0
        public ImagesController(IToDoRepository repo, IMapper mapper,
                                IOptions <CloudinarySettings> cloudinaryConfig)
        {
            _cloudinaryConfig = cloudinaryConfig;
            _mapper           = mapper;
            _repo             = repo;

            Account acc = new Account(
                _cloudinaryConfig.Value.CloudName,
                _cloudinaryConfig.Value.ApiKey,
                _cloudinaryConfig.Value.ApiSecret
                );

            _cloudinary = new Cloudinary(acc);
        }
Exemplo n.º 19
0
        public ToDoService(IUserDataRepository repository, IToDoRepository toDoRepository)
        {
            var mapperConfig = new MapperConfiguration((configuration) => {
                configuration.AddProfile(new UserDataProfile());
                configuration.AddProfile(new ToDoModelProfile());
            });

            _mapper = new Mapper(mapperConfig);


            _userDataRepository = repository;
            _toDoRepository     = toDoRepository;

            _toDosData = GetDefaultTDos();
        }
Exemplo n.º 20
0
 public ToDoService(IToDoRepository repo, IMapper mapper)
 {
     _repo   = repo;
     _mapper = mapper;
 }
Exemplo n.º 21
0
 public ToDoApiController(IToDoRepository repository, IToDoService service)
 {
     _repository = repository;
     _service    = service;
 }
Exemplo n.º 22
0
 public HomeController(IToDoRepository toDoRepository)
 {
     _toDoRepository = toDoRepository;
 }
 public TaskController(IToDoRepository repository)
     : base(repository)
 {
 }
Exemplo n.º 24
0
 public ToDoController()
 {
     _repo = ToDoRepositoryLocator.Get();
 }
Exemplo n.º 25
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="repository">ToDo repository.</param>
 /// <param name="mediator">Mediator for publishing events.</param>
 public DeleteToDoCommandHandler(IToDoRepository repository, IMediator mediator)
 {
     _repository = Check.NotNull(repository, nameof(repository));
     _mediator   = Check.NotNull(mediator, nameof(mediator));
 }
Exemplo n.º 26
0
 public ToDoService(IToDoRepository toDoRepository)
 {
     _toDoRepository = toDoRepository;
 }
Exemplo n.º 27
0
 public ToDoItems2Controller(IToDoRepository toDoRepository)
 {
     _toDoRepository = toDoRepository;
 }
Exemplo n.º 28
0
 public HomeController(IToDoRepository toDoRepo)
 {
     this.toDoRepository = toDoRepo;
 }
Exemplo n.º 29
0
 public MembersController()
 {
     this.memberRepository = new ToDoRepository(new MemberDbContext());
 }
 public TodoResource(IToDoRepository repo)
 {
     _repo = repo;
 }
 public TodoResource(IToDoRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 32
0
 public ToDoItemsController(IToDoRepository toDoRepository)
 {
     _toDoRepository = toDoRepository;
 }
Exemplo n.º 33
0
 /// <summary>
 /// Constructor which accepts the repository as a parameter which is a dependency.
 /// This dependency is configured in the UnityConfig file inside RegisterTypes function
 /// This is inside ServiceLocation folder
 /// </summary>
 /// <param name="repository"></param>
 public ToDoBL(IToDoRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 34
0
 public HomeController(IToDoRepository todoRepo, ILogger<HomeController> logger , IUserService userService)
 {
     _todoRepo = todoRepo;
     _logger = logger;
     _userService = userService;
 }
Exemplo n.º 35
0
 public ItemController(IItemRepository itemRepository, IToDoRepository toDoRepository)
 {
     this.itemRepository = itemRepository;
     this.toDoRepository = toDoRepository;
 }
Exemplo n.º 36
0
 public TodoController(IToDoRepository toDoRepository)
 {
     _toDoRepository = toDoRepository;
 }
Exemplo n.º 37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToDoService"/> class.
 /// </summary>
 /// <param name="repository">
 /// The repository.
 /// </param>
 /// <param name="unitOfWork">
 /// The unit of work.
 /// </param>
 public ToDoService(IToDoRepository repository, IUnitOfWork unitOfWork)
 {
     this.toDoRepository = repository;
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 38
0
 public ToDoServices(IToDoRepository toDoRepository, IUserRepository userRepository, UserServices userServices)
 {
     _toDoRepository = toDoRepository;
     _userRepository = userRepository;
     _userServices = userServices;
 }
Exemplo n.º 39
0
 public ToDoController(IToDoRepository repository)
 {
     this.repository = repository;
 }
 public ToDoBaseController(IToDoRepository todoRepository)
 {
     this.repository = todoRepository;
 }
Exemplo n.º 41
0
 public ToDoesController(IToDoRepository toDoRepository)
 {
     _currentToDoRepository = toDoRepository;
 }
 public TodosController(IToDoRepository repository, IMappingEngine mapper)
 {
     _repository = repository;
     _mapper = mapper;
 }