public BookStoreMutation(IAuthorManager authorManager, IBookManager bookManager)
        {
            Field <AuthorType>(
                "addAuthor",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <AuthorInputType> > {
                Name = "author"
            }),
                resolve: context =>
            {
                var author = context.GetArgument <Author>("author");
                return(authorManager.Add(author));
            });

            Field <BookType>(
                "addBook",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <BookInputType> > {
                Name = "book"
            }),
                resolve: context =>
            {
                var book = context.GetArgument <Book>("book");
                return(bookManager.Add(book));
            });
        }
Ejemplo n.º 2
0
        private void SetAuthorTo(IAuthorManager authorManager, BookViewModel add)
        {
            IDConversionDao idcDao    = new IDConversionDao();
            AuthorDao       authorDao = new AuthorDao();
            var             idc       = idcDao.FindBy(new Dictionary <string, object>()
            {
                { "TableName", "Author" }, { "ForeignID", add.AuthorID }
            }, _dataOpUnit.CurrentConnection);

            if (idc.Count() == 1)
            {
                add.Author = authorDao.FindBy(new Dictionary <string, object>()
                {
                    { "ID", idc.Single().DomesticID }
                }, _dataOpUnit.CurrentConnection).SingleOrDefault().ToViewModel();
            }
            else
            {
                add.Author = authorDao.FindBy(new Dictionary <string, object>()
                {
                    { "ID", add.AuthorID }
                }, _dataOpUnit.CurrentConnection).SingleOrDefault().ToViewModel();
            }
            authorManager.ObserveAuthorCount();
        }
        public BookStoreQuery(IAuthorManager authorManager, IBookManager bookManager)
        {
            Field <ListGraphType <AuthorType> >(
                "all_authors",
                resolve: context => authorManager.GetAll());

            Field <AuthorType>(
                "author_by_id",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: context => authorManager.GetById(context.GetArgument <int>("id")));

            Field <AuthorType>(
                "get_error",
                resolve: context => authorManager.GetError());

            Field <ListGraphType <BookType> >(
                "all_books",
                resolve: contex => bookManager.GetAll());

            Field <BookType>(
                "book_by_id",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: context => bookManager.GetById(context.GetArgument <int>("id")));
        }
Ejemplo n.º 4
0
 public AuthorsController(IAuthorManager authorManager, UserManager <User> userManager,
                          IMapper mapper)
 {
     _authorManager = authorManager;
     _mapper        = mapper;
     _userManager   = userManager;
 }
Ejemplo n.º 5
0
 public AuthorAppService(
     IAuthorManager authorManager,
     IRepository <Author, long> authorsRepository)
 {
     _authorManager     = authorManager;
     _authorsRepository = authorsRepository;
 }
Ejemplo n.º 6
0
 public AuthorController(
     IAuthorManager authorManager,
     ILogger <AuthorController> logger)
 {
     this.authorManager = authorManager;
     this.logger        = logger;
 }
Ejemplo n.º 7
0
 public BookController(ISearchBookManager searchBookManager, IBookManager bookInfoManager, IAuthorManager authorManager, IBookAuthorManager bookauthorManager, IConsignmentManager consignmentManager)
 {
     this.searchBookManager = searchBookManager;
     this.bookInfoManager = bookInfoManager;
     this.authorManager = authorManager;
     this.bookauthorManager = bookauthorManager;
     this.consignmentManager = consignmentManager;
 }
 //.NET core dependency injection will inject my dependency
 public AuthorController(IAuthorManager authorManager,
                         IStringLocalizer <AuthorController> localizer,
                         IStringLocalizer <Shared> sharedLocalizer)
 {
     this.authorManager   = authorManager;
     this.localizer       = localizer;
     this.sharedLocalizer = sharedLocalizer;
 }
Ejemplo n.º 9
0
 public ThongKeNhuanButController(IAuthorManager authorManager, IThongKeNhuanButManager thongKeNhuanButManager, IAccountsManager accountsManager, ITypesManager typesManager, ITheLoai_HeSoManager theLoai_HeSoManager)
 {
     this._thongKeNhuanButManager = thongKeNhuanButManager;
     this._accountsManager        = accountsManager;
     this._typesManager           = typesManager;
     this._theLoai_HeSoManager    = theLoai_HeSoManager;
     this._authorManager          = authorManager;
 }
Ejemplo n.º 10
0
 public BookController(ISearchBookManager searchBookManager, IBookManager bookInfoManager, IAuthorManager authorManager, IBookAuthorManager bookauthorManager, IConsignmentManager consignmentManager)
 {
     this.searchBookManager  = searchBookManager;
     this.bookInfoManager    = bookInfoManager;
     this.authorManager      = authorManager;
     this.bookauthorManager  = bookauthorManager;
     this.consignmentManager = consignmentManager;
 }
Ejemplo n.º 11
0
 public VideosController(IVideoManager videoManager, IAuthorManager authorManager,
                         IGenreManager genreManager, UserManager <User> userManager, IMapper mapper)
 {
     _genreManager  = genreManager;
     _authorManager = authorManager;
     _videoManager  = videoManager;
     _mapper        = mapper;
     _userManager   = userManager;
 }
Ejemplo n.º 12
0
        public AuthorController(IAuthorManager authorManager, IMapper mapper, IHttpClientFactory httpClientFactory)
        {
            Guard.Against <ArgumentNullException>(authorManager == null, nameof(authorManager));
            Guard.Against <ArgumentNullException>(mapper == null, nameof(mapper));
            Guard.Against <ArgumentNullException>(httpClientFactory == null, nameof(httpClientFactory));

            _authorManager     = authorManager;
            _mapper            = mapper;
            _httpClientFactory = httpClientFactory;
        }
Ejemplo n.º 13
0
        public BooksController(IBookCategoryManager iBookCategoryManager, IAuthorManager iAuthorManager,
                               ILanguageManager iLanguageManager,
                               IPublisherManager iPublisherManager, IBookManager iBookManager)
        {
            _iLanguageManager = iLanguageManager;

            _iBookCategoryManager = iBookCategoryManager;
            _iAuthorManager       = iAuthorManager;
            _iPublisherManager    = iPublisherManager;
            _iBookManager         = iBookManager;
        }
Ejemplo n.º 14
0
 public ItemController(IItemManager itemManager,
                       IBookManager bookInfoManager,
                       IMagazineManager magazineManager,
                       IDiskManager diskManager,
                       IAuthorManager authorManager,
                       IBookAuthorManager bookauthorManager,
                       IRecommendationManager recommendationManager)
 {
     this.itemManager           = itemManager;
     this.bookInfoManager       = bookInfoManager;
     this.diskManager           = diskManager;
     this.magazineManager       = magazineManager;
     this.authorManager         = authorManager;
     this.bookauthorManager     = bookauthorManager;
     this.recommendationManager = recommendationManager;
 }
Ejemplo n.º 15
0
 public ItemController(IItemManager itemManager,
                       IBookManager bookInfoManager,
                       IMagazineManager magazineManager,
                       IDiskManager diskManager,
                       IAuthorManager authorManager,
                       IBookAuthorManager bookauthorManager,
                       IRecommendationManager recommendationManager)
 {
     this.itemManager = itemManager;
     this.bookInfoManager = bookInfoManager;
     this.diskManager = diskManager;
     this.magazineManager = magazineManager;
     this.authorManager = authorManager;
     this.bookauthorManager = bookauthorManager;
     this.recommendationManager = recommendationManager;
 }
Ejemplo n.º 16
0
 public CommentsController(ICommentManager commentManager, IAuthorManager authorManager)
 {
     _commentManager = commentManager;
     _authorManager  = authorManager;
 }
Ejemplo n.º 17
0
 public AuthorsController(IAuthorManager iAuthorManager)
 {
     _iAuthorManager = iAuthorManager;
 }
Ejemplo n.º 18
0
 private void SetupTestEnv()
 {
     InsertSeedRecords();
     _testValidator = FakeAuthorValidator;
     _authorManager = new AuthorManager(AuthorRepository, _testValidator);
 }
Ejemplo n.º 19
0
 public AuthorAppService(IAuthorManager authorManager)
 {
     _authorManager = authorManager;
 }
Ejemplo n.º 20
0
 private void SetupTestEnv()
 {
     InsertSeedRecords();
     _validator = new AuthorValidator(AuthorRepository);
     _manager   = new AuthorManager(AuthorRepository, _validator);
 }
 public AuthorController(IAuthorManager manager)
 {
     authorManager = manager;
 }
Ejemplo n.º 22
0
 public AuthorController(IAuthorManager authorManager)
 {
     _authorManager = authorManager;
 }
Ejemplo n.º 23
0
 public AuthorAppService(IAuthorManager authorManager, IObjectMapper objectMapper)
 {
     _authorManager = authorManager;
     _objectMapper  = objectMapper;
 }
Ejemplo n.º 24
0
 public BookController(IBookManager serv, IAuthorManager authorServ)
 {
     bookService   = serv;
     authorService = authorServ;
 }
Ejemplo n.º 25
0
 public AuthorController(IAuthorManager serv)
 {
     authorService = serv;
 }
Ejemplo n.º 26
0
 public AuthorsController(IAuthorManager authorManager)
 {
     this.authorManager = authorManager;
 }
 public BooksController(IBookManager bookManager, IAuthorManager authorManager, IHubContext <BookHub> bookHub)
 {
     this.bookManager   = bookManager;
     this.authorManager = authorManager;
     this.bookHub       = bookHub;
 }
Ejemplo n.º 28
0
 public AuthorController()
 {
     authorManager = new SqlAuthorManager();
 }
 public AuthorListModel(IAuthorManager manager)
 {
     this.manager = manager;
 }
Ejemplo n.º 30
0
 public AuthorApiController(IAuthorManager authorManager)
 {
     this.authorManager = authorManager;
 }
Ejemplo n.º 31
0
 public AuthorController(FitnesDbContext context, IAuthorManager manager)
 {
     _manager = manager;
     _context = context;
 }
Ejemplo n.º 32
0
 public AuthorController(IAuthorManager authorManager, IMapper mapper)
 {
     _authorManager = authorManager;
     _mapper        = mapper;
 }
Ejemplo n.º 33
0
 public BlogManager(IBlogRepository repo)
 {
     this._repo              = repo;
     this._authorManager     = new AuthorManager(this._repo);
     this._post_time_Manager = new PostTimeManager();
 }