Exemple #1
0
 // GET: Books/Create
 public IActionResult Create()
 {
     ViewData["AuthorId"]       = new SelectList(_iAuthorManager.GetAll(), "Id", "Name");
     ViewData["BookCategoryId"] = new SelectList(_iBookCategoryManager.GetAll(), "Id", "Name");
     ViewData["LanguageId"]     = new SelectList(_iLanguageManager.GetAll(), "Id", "Name");
     ViewData["PublisherId"]    = new SelectList(_iPublisherManager.GetAll(), "Id", "Name");
     return(View());
 }
        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")));
        }
        public async Task <ViewResult> ShowAuthors()
        {
            var entitys = await _manager.GetAll();

            return(View(entitys));
        }
Exemple #4
0
        // GET: Authors
        public IActionResult Index()
        {
            var author = _iAuthorManager.GetAll().ToList();

            return(View(author));
        }
        public ActionResult Index()
        {
            var authors = authorManager.GetAll();

            return(View(authors));
        }
 public IEnumerable <Author> Get()
 {
     return(_authorManager.GetAll());
 }