public async Task <IActionResult> Index(GetAuthorListDto input) { // < script src = "../Pages/Users/jquery.js" ></ script > // < script > // function BtnChaXun() { // console.log($('.WorkPlanTransfer').val()); // $.ajax({ // type: 'post', // url: '/Home/Default2', // data: // { // name: $('.WorkPlanTransfer').val() // } , // }).done(() => { // alert("添加成功"); // }) // .fail(() => { // console.log("失败了"); // }); // } //</ script > return(View(await _authorAppService.GetListAuthorAsync(input))); }
public async Task <List <CreateAuthorViewModel> > OnGetAsync(GetAuthorListDto input) { var data = await _authorAppService.GetListAuthorAsync(input); return(ObjectMapper.Map <List <AuthorDto>, List <CreateAuthorViewModel> >(data)); //Author = new CreateAuthorViewModel(); }
// public <AuthorDto> Author { get; private set; } public async Task OnGet(GetAuthorListDto input) { //Author = await _authorAppService.GetListAuthorAsync(input); Author = await _authorAppService.GetListAsync(input); //var data = "b8f5c1a9-e910-fb6c-5f10-39fa16dd492c"; //Author=await _authorAppService.GetAsync(Guid.Parse(data)); }
public async Task <PagedResultDto <AuthorDto> > GetListAsync(GetAuthorListDto input) { if (input.Sorting.IsNullOrWhiteSpace()) { input.Sorting = nameof(Author.Name); } var authors = await _authorRepository.GetListAsync(input.SkipCount, input.MaxResultCount, input.Sorting, input.Filter); var totalCount = input.Filter == null ? await _authorRepository.CountAsync() : await _authorRepository.CountAsync(a => a.Name == input.Filter); return(new PagedResultDto <AuthorDto>(totalCount, ObjectMapper.Map <List <Author>, List <AuthorDto> >(authors))); }
public Task <PagedResultDto <AuthorDto> > GetListAsync(GetAuthorListDto input) { return(_authorAppService.GetListAsync(input)); }
public async Task <IActionResult> Index(GetAuthorListDto input) { await _authorAppService.GetListAuthorAsync(input); return(View()); }