Ejemplo n.º 1
0
        public async Task <IActionResult> PrevalencePost([FromBody] Prevalence prevalance)
        {
            //TODO: Uncomment the next line to return response 204 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
            // return StatusCode(204);

            //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
            // return StatusCode(400);

            //TODO: Uncomment the next line to return response 500 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
            // return StatusCode(500, default(Error));


            if (ModelState.IsValid)
            {
                _context.Add(prevalance);
                await _context.SaveChangesAsync();

                Console.WriteLine("test checking");
                return(Ok(prevalance));
            }
            else
            {
                return(StatusCode(500, default(Error)));
            }
        }
Ejemplo n.º 2
0
 public InfermedicaCondition(string id, string name, List <string> categories, Prevalence prevalence, Acuteness acuteness, Severity severity, Sex sex, Dictionary <string, string> extras)
 {
     Id         = id;
     Name       = name;
     Categories = categories;
     Prevalence = prevalence;
     Acuteness  = acuteness;
     Severity   = severity;
     Sex        = sex;
     Extras     = extras;
 }