Ejemplo n.º 1
0
        public async Task <IActionResult> Post([FromBody] UserRoundCompletedsDto data)
        {
            SuccessDto res = new SuccessDto();

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            res.Success = await _roundServices.CreateRounds(data);

            if (res.Success == true)
            {
                return(Ok(res));
            }
            return(BadRequest(res));
        }
Ejemplo n.º 2
0
        private static HttpResponseMessage CreateSuccessResponse()
        {
            const string jsonContentType = "application/json";

            var dto = new SuccessDto
            {
                TestField = "Test!"
            };
            var stringContent = JsonConvert.SerializeObject(dto);

            return(new HttpResponseMessage
            {
                Content = new StringContent(stringContent, Encoding.UTF8, jsonContentType),
                StatusCode = HttpStatusCode.OK
            });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create user and save its details by App,
        /// sign it and assign User role to him/her.
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <SuccessDto> RegisterByApp(RegisterAppUserDto model)
        {
            SuccessDto obj = new SuccessDto();

            try
            {
                if (!string.IsNullOrEmpty(model.Name) && !string.IsNullOrEmpty(model.EmailID))
                {
                    obj.Success = await _sendEmailService.SendingEmailAsync(model.Name, model.EmailID);
                }
                return(obj);
            }
            catch (Exception)
            {
                obj.Success = false;
                return(obj);
            }
        }