public List <string> Get() { return(new List <string> { $"Username: {_securityContext.GetCurrentUserName()}", $"Email: {_securityContext.GetCurrentEmail()}" }); }
public async Task <IEnumerable <ListOfBlogResponse> > Handle(ListOfBlogRequest request) { var blogs = await _blogRepo.ListAsync(); var responses = blogs .Where(x => x.OwnerEmail == _securityContext.GetCurrentEmail()) .Select(x => new ListOfBlogResponse( x.Id, x.Title, x.Description, x.Image, x.Theme )); return(responses); }
public async Task <PaginatedItem <ListOutBlogByOwnerResponse> > Handle(ListOutBlogByOwnerRequest request) { var criterion = new Criterion(1, int.MaxValue, _pagingOption.Value); Expression <Func <BlogContext.Core.Domain.Blog, ListOutBlogByOwnerResponse> > selector = b => new ListOutBlogByOwnerResponse(b.Id, b.Title, b.Description, b.ImageFilePath, (int)b.Theme); Expression <Func <BlogContext.Core.Domain.Blog, bool> > ownerEmailFilter = x => x.OwnerEmail == _securityContext.GetCurrentEmail(); return(await _blogRepo.FindAllAsync(criterion, selector, ownerEmailFilter)); }