Esempio n. 1
0
        public async Task <IHttpActionResult> RevealProgram(RevealProgramBindingModel revealRequest)
        {
            ClaimsPrincipal principal = this.User as ClaimsPrincipal;

            if (null == principal)
            {
                return(StatusCode(System.Net.HttpStatusCode.Unauthorized));
            }

            string caller = principal.Identities.First().GetUserId();

            bool response = await Task.Run(() =>
            {
                return(MarketManager.RevealProgramFor(caller, revealRequest.ProgramName));
            });

            if (response)
            {
                return(StatusCode(System.Net.HttpStatusCode.Created));
            }
            else
            {
                return(StatusCode(System.Net.HttpStatusCode.InternalServerError));
            }
        }