public override async Task GetAll(Empty request, IServerStreamWriter <Author> responseStream, ServerCallContext context) { var authors = await this.blogService.GetAllAuthorsAsync(); foreach (var author in authors) { await responseStream.WriteAsync(EntityToDtoMapper.MapAuthor(author)); Thread.Sleep(5000); } }
public override async Task <Author> AddAuthor(Author request, ServerCallContext context) { var author = await this.blogService.AddAuthorAsync(DtoToEntityMapper.MapAuthor(request)); return(EntityToDtoMapper.MapAuthor(author)); }
public override async Task <Author> GetAuthorById(Int32Value request, ServerCallContext context) { return(EntityToDtoMapper.MapAuthor(await this.blogService.GetAuthorByIdAsync(request.Value))); }