Пример #1
0
        public async Task <IActionResult> GetMyProfile()
        {
            try
            {
                var query = new GetProfileDetailByEmailQuery()
                {
                    Email = _currentUserService.Email
                };

                var result = await _mediator.Send(query);

                return(base.Ok(result));
            }
            catch (NotFoundException)
            {
                return(base.NotFound());
            }
        }
Пример #2
0
        public async Task <IActionResult> GetByEmail([FromQuery] string email)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(email))
                {
                    return(base.BadRequest());
                }

                var query = new GetProfileDetailByEmailQuery()
                {
                    Email = email
                };

                var result = await _mediator.Send(query);

                return(base.Ok(result));
            }
            catch (NotFoundException)
            {
                return(base.NotFound());
            }
        }