public BooksController() { BookModelContainer db = new BookModelContainer(); this.bookRepository = new BookRepository(db); this.authorRepository = new AuthorRepository(db); this.categoryRepository = new CategoryRepository(db); }
/// <summary> /// Preencho o repositório com as HQs novas /// </summary> public void Dump(IComicRepository comicRepository, IAuthorRepository authorRepository, IGenreRepository genreRepository, IPublisherRepository publisherRepository, ILogRepository logRepository) { //Se já processei nesse período, retorno DateTime lastSyncDate = logRepository.GetLastComicListUpdate(); if (lastSyncDate.AddHours(24) > DateTime.Now) return; //Espero terminar de processar while (_working) Thread.Sleep(10); //Busco todas as HQs do banco IList<Comic> repoList = comicRepository.Read(); //Comparo o que mudou foreach (ComicVisitor cacheComic in _cache) { if (repoList.Any(c => c.ComicName.ToUpper().Equals(cacheComic.ComicName.ToUpper()))) continue; //Se tem uma HQ nova, adiciono Comic dbComic = ComicVisitor.ToComic(cacheComic); comicRepository.Add(dbComic); cacheComic.ComicId = dbComic.ComicId; } comicRepository.Save(); logRepository.SetLastComicListUpdate(DateTime.Now); }
public HomeController(IIngredientRepository ingredientRepository, IRecipeRepository recipeRepository, IDietRepository dietRepository, IAuthorRepository authorRepository, ICommentRepository commentRepository) { _ingredientRepository = ingredientRepository; _recipeRepository = recipeRepository; _dietRepository = dietRepository; _authorRepository = authorRepository; _commentRepository = commentRepository; }
public BookOrchestration(IBookRepository bookRepository, IAuthorRepository authorRepository, IGenreRepository genreRepository) { _bookRepository = bookRepository; _authorRepository = authorRepository; _genreRepository = genreRepository; }
public AuthorControllerTests() { autoMapperConfiguration = new AutoMapperConfiguration(); autoMapperConfiguration.Configure(); fixture = new Fixture().Customize(new AutoFixtureCustomization()); mocks = new MockRepository(); authorRepositoryMock = mocks.DynamicMock<IAuthorRepository>(); controller = new AuthorController(authorRepositoryMock); }
public ComicController() { DbContext sharedContext = new Data.ComiczillaDb(); _repository = new ComicRepository(sharedContext); _authorRepository = new AuthorRepository(sharedContext); _genreRepository = new GenreRepository(sharedContext); _publisherRepository = new PublisherRepository(sharedContext); _chapterRepository = new ChapterRepository(sharedContext); _logRepository = new LogRepository(sharedContext); }
public ComicController(IComicRepository repository, IAuthorRepository authorRepository, IGenreRepository genreRepository, IPublisherRepository publisherRepository, IChapterRepository chapterRepository, ILogRepository logRepository) { _repository = repository; _authorRepository = authorRepository; _genreRepository = genreRepository; _publisherRepository = publisherRepository; _chapterRepository = chapterRepository; _logRepository = logRepository; }
public BooksController(IUnitOfWork<BooksContext> unitOfWork, IBooksRepository repo, ICategoryRepository categoryRepository, IBookBadgeRepository badgeRepo, IAuthorRepository authorRepo) { _categoryRepository = categoryRepository; _unitOfWork = unitOfWork; _repo = repo; _badgeRepo = badgeRepo; _authorRepo = authorRepo; }
public MealController(IMealRepository mealRepository, IIngredientRepository ingredientRepository, IQuantityTypeRepository quantityTypeRepository, IIngredientCategoryRepository ingredientCategoryRepository, IMealIngredientRepository mealIngredientRepository, IMealCategoryRepository categoryRepository, IRecipeRepository recipeRepository, IUserRepository userRepository, IAuthorRepository authorRepository, IIngredientQuantityRepository ingredientQuantityRepository) { _mealRepository = mealRepository; _ingredientRepository = ingredientRepository; _quantityTypeRepository = quantityTypeRepository; _ingredientCategoryRepository = ingredientCategoryRepository; _mealIngredientRepository = mealIngredientRepository; _categoryRepository = categoryRepository; _recipeRepository = recipeRepository; _userRepository = userRepository; _authorRepository = authorRepository; _ingredientQuantityRepository = ingredientQuantityRepository; }
public BookService(IBookRepository bookRepository, IAuthorRepository authorRepository) { if (bookRepository == null) { throw new ArgumentNullException(nameof(bookRepository)); } if (authorRepository == null) { throw new ArgumentNullException(nameof(authorRepository)); } _bookRepository = bookRepository; _authorRepository = authorRepository; }
public MealControllerTest() { MapperConfig.ConfigureMapper(); _mealRepository = new FakeMealRepository(); _ingredientRepository = new FakeIngredientRepository(); _quantityTypeRepository = new FakeQuantityTypeRepository(); _ingredientCategoryRepository = new FakeIngredientCategoryRepository(); _mealIngredientRepository = new FakeMealIngredientRepository(); _mealCategoryRepository = new FakeMealCategoryRepository(); _recipeRespository = new FakeRecipeRepository(); _userRepository = new FakeUserRepository(); _authorRepository = new FakeAuthorRepository(); _ingredientQuantityRepository = new FakeIngredientQuantityRepository(); _controller = new MealController(_mealRepository, _ingredientRepository, _quantityTypeRepository, _ingredientCategoryRepository, _mealIngredientRepository, _mealCategoryRepository, _recipeRespository, _userRepository, _authorRepository, _ingredientQuantityRepository); }
public AuthorController(IAuthorRepository authorRepository, IUnitOfWork<BooksContext> unitOfWork) { _authorRepository = authorRepository; _unitOfWork = unitOfWork; }
public AuthorListController() { _authorRepository = new AuthorRepository(); }
public AuthorViewModule(IAuthorRepository repository) : base("/authors") { //redirects Get["/"] = _ => Response.AsRedirect("~/homeWithStylishMaster"); //dynamic view with expando object Get["/all"] = _ => { var allAuthors = repository.GetAll(); dynamic model = new ExpandoObject(); model.HasAuthors = allAuthors.Any(); model.Authors = allAuthors; return View["authors/all", model]; }; //dynamic view with partials Get["/search"] = _ => { dynamic authorName = this.Request.Query.authorName; IList<Author> foundAuthors = null; if (authorName.HasValue && ((string)authorName).Trim() != "") { foundAuthors = repository.GetByAuthorName(authorName); } else { foundAuthors = repository.GetAll(); } dynamic model = new ExpandoObject(); model.HasAuthors = foundAuthors.Any(); model.Authors = foundAuthors; return View["authors/search", model]; }; //post data and bind model Get["/addAuthor"] = _ => { dynamic model = new ExpandoObject(); model.HasMessage = false; AddAuthorsToModel(model, repository.GetAll()); return View["authors/addAuthor", model]; }; Post["/addAuthor"] = _ => { Author postedAuthor = this.Bind<Author>(); Logger.Debug(string.Format("[{0}] postedAuthor was {1}", this.Request.Url, postedAuthor)); var newAuthorId = repository.Save(postedAuthor); dynamic model = new ExpandoObject(); if (newAuthorId == null) { model.HasMessage = true; model.Message = "Author was not saved"; model.MessageStyle = "color:red;"; } else { model.HasMessage = true; model.Message = "Author was saved with Id " + newAuthorId; model.MessageStyle = ""; } AddAuthorsToModel(model, repository.GetAll()); return View["authors/addAuthor", model]; }; }
public AuthorService(IMapper map, IAuthorValidator validator, IAuthorRepository repo) { mapper = map; authorValidator = validator; repository = repo; }
public AuthorService() { _authorRepozitory = new AuthorRepository(); }
public AuthorService(IAuthorRepository AuthorRepository) : base(AuthorRepository) { _AuthorRepository = AuthorRepository; }
public AuthorsController(IAuthorRepository author, ILoggerService logger, IMapper map) { this.authorRepository = author; this.loggerService = logger; this.mapper = map; }
public AuthorController(IAuthorRepository repo) { authorRepo = repo; }
public AuthorManager(IAuthorRepository authorRepository) { _authorRepository = authorRepository; }
public GetAllAuthorsQueryHandler(IAuthorRepository authorRepository) { this.authorRepository = authorRepository; }
public UpdateAuthorCommandHandler(IAuthorRepository authorRepo, ClaimsPrincipal user) { this._authorRepo = authorRepo; this._user = user; }
public LibraryUOW(IAuthorRepository authorRepository, IBookRepository bookRepository, ISerieRepository serieRepository) { this.authorRepository = authorRepository; this.bookRepository = bookRepository; this.serieRepository = serieRepository; }
public AuthorService(IAuthorRepository authorRepository, ILogService logService) { _authorRepository = authorRepository; _logService = logService; }
public AuthorDetailQueryHandler(IAuthorRepository authorRepo) { this._authorRepo = authorRepo; }
public AuthorsController(IAuthorRepository authorRepository, ILoggerService logger, IMapper mapper) { _authorRepository = authorRepository; _logger = logger; _mapper = mapper; }
public AuthorsController(IAuthorRepository repository) { _repository = repository; }
public LibraryService(IBookRepository bookRepository, IAuthorRepository authorRepository, IMagazineRepository magazineRepository) { _bookRepository = bookRepository; _authorRepository = authorRepository; _magazineRepository = magazineRepository; }
/// <summary> /// Overrides the default constructor. Uses dependency injection to instantiate repositories. /// </summary> public AuthorController(IAuthorRepository repository) { this.repository = repository; }
public AuthorController() { repository = new AuthorRepository(); }
public AuthorRepositoryTests() { repository = new AuthorRepository(UnitOfWork); fixture = new Fixture().Customize(new AutoFixtureCustomization()); }
public AuthorService(IAuthorRepository autorRepository) { _authorRepository = autorRepository; }
public BookManager(IBookRepository bookRepository, IAuthorRepository authorRepository, IBookAuthorRepository bookAuthorRepository) { _bookRepository = bookRepository; _authorRepository = authorRepository; _bookAuthorRepository = bookAuthorRepository; }
public AuthorValidator(IAuthorRepository repo, IAuthorValidationRules authorValidation) { repository = repo; authorValidationRules = authorValidation; }
public AuthorPagingQueryHandler(IAuthorRepository authorRepo) { this._authorRepo = authorRepo; }
public BookStoreDataSeedContributor(IRepository <Book, Guid> bookRepository, IAuthorRepository authorRepository, AuthorManager authorManager) { _bookRepository = bookRepository; _authorRepository = authorRepository; _authorManager = authorManager; }
public static IAuthorService GetAuthorService(IAuthorRepository repository, IAuthorValidation validation) { return new AuthorService(repository, validation); }
public AuthorService(IMapper mapper, IAuthorRepository authorRepository) { _mapper = mapper; _authorRepository = authorRepository; }
public BookDomainModel(IAuthorRepository authorRepository, IBookRepository bookRepository) { BookRepository = bookRepository; AuthorRepository = authorRepository; }
public AuthorDomain() { _authorRepository = new AuthorRepository(); }
public AuthorsController(IAuthorRepository _authorRepository) { authorRepository = _authorRepository; }
public AuthorService(IAuthorRepository authorRepository) { this.authorRepository = authorRepository; }
public AuthorAppService(IAuthorRepository authorRepository, AuthorManager authorManager) { _authorRepository = authorRepository; _authorManager = authorManager; }
public AuthorController(IAuthorRepository repository, ILogger <AuthorController> logger) { _repository = repository; _logger = logger; }
public AuthorsController(IAuthorRepository authorRepository) { _authorRepository = authorRepository; }
public AuthorsController(IBookRepository repository, IAuthorRepository authorRepository) { _bookRepository = repository; _authorRepository = authorRepository; }
public BloggingApplicationService(IAuthorRepository authorRepository, IPostRepository postRepository) { AuthorRepository = authorRepository; PostRepository = postRepository; }
public AuthorProvider(IAuthorRepository authorRepository) { _authorRepository = authorRepository; }
public AuthorController(IAuthorRepository repository) { _repository = repository; }
public ArticleService(IArticleRepository articleRepository, IAuthorRepository authorRepository, ITagRepository tagRepository) { _articleRepository = articleRepository; _authorRepository = authorRepository; _tagRepository = tagRepository; }
public AuthorController(IAuthorRepository authorRepository) { this.authorRepository = authorRepository; }
public AuthorService(IAuthorRepository authorRepository, IAuthorValidation authorValidation) { this.authorRepository = authorRepository; this.authorValidation = authorValidation; }
public AuthorService(IAuthorRepository authorRepository, IBookRepository bookRepository) { _authorRepository = authorRepository; _bookRepository = bookRepository; }
public AuthorDomainModel(IAuthorRepository authorRepository) { AuthorRepository = authorRepository; }
public AuthorController(IAuthorRepository authorRepository, IMapper mapper) { _authorRepository = authorRepository; _mapper = mapper; }
public BooksController(IBookRepository bookRepository, IAuthorRepository authorRepository) { _bookRepository = bookRepository; _authorRepository = authorRepository; }
public BookController(IBookRepository bookRepository, IAuthorRepository authorRepository) { _bookRepository = bookRepository; _authorRepository = authorRepository; }
public UnitOfWork(BookServiceContext context) { this.context = context; BooksRepository = new BookRepository(context); AuthorsRepository = new AuthorRepository(context); }
public IQueryable <Author> Authors([Service] IAuthorRepository authorRepository) => authorRepository.GetAuthors();