Exemplo n.º 1
0
        public async override Task <IHttpActionResult> Post([FromBody] ClientDto model)
        {
            if (!CheckUserRole())
            {
                return(Forbidden());
            }

            var result = await _service.CreateAsync(model);

            if (result.ClientId == null)
            {
                return(BadRequest());
            }

            await _mongoService.CreateDatabaseAsync();

            return(Ok(result));
        }