예제 #1
0
        public async Task <IActionResult> GetProfile()
        {
            var identity = User.Identity.Name;
            var result   = await context.GetProfile(identity);

            try
            {
                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(BadRequest(new ErrorMessage(ex.Message)));
            }
        }
        public IHttpActionResult GetProfile()
        {
            var identity = User.Identity.Name;
            var result   = context.GetProfile(identity);

            try
            {
                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.NotModified, ex.Message));
            }
        }