Exemple #1
0
        public async Task <ActionResult <IEnumerable <Author> > > GetAuthors()
        {
            var query  = new GetAllAuthorQuery();
            var result = await _mediator.Send(query);

            return(result.ToList());
        }
Exemple #2
0
        public async Task <IActionResult> GetAllAuthor()
        {
            var query  = new GetAllAuthorQuery();
            var result = await _mediator.Send(query);

            return(result != null?Success(result) : Error(new { info = "خطایی رخ داده است" }));
        }
        public async Task <IEnumerable <Author> > Handle(GetAllAuthorQuery request, CancellationToken cancellationToken)
        {
            string functionName = "GetAllAuthor:Get";

            Log.ForContext("Message", functionName)
            .ForContext("Error", "").Information(functionName);

            return(await _read.GetAllAuthor());
        }
 public async Task <IEnumerable <Author> > Handle(GetAllAuthorQuery request, CancellationToken cancellationToken)
 {
     Log.Information("GetAllAuthorQuery");
     return(await _query.GetAllAuthor());
 }