public virtual IActionResult WearablePost([FromBody] Wearable name, [FromHeader][Required()] string Authorization)
        {
            if (!ModelState.IsValid)
            {
                var error = ModelState.SelectMany(x => x.Value.Errors).First();
                if (error.ErrorMessage != null && error.ErrorMessage != String.Empty)
                {
                    return(BadRequest(error.ErrorMessage));
                }
                else if (error.Exception?.Message != null)
                {
                    return(BadRequest("Faulty input"));
                }
                else
                {
                    return(BadRequest(ModelState));
                }
            }
            if (Authorization != settings.testToken)
            {
                return(BadRequest("Not allowed"));
            }
            long   newWearableID = 0;
            string errorMessage  = "";

            try
            {
                DatabaseInterface.DBWearable dBWearable = new DatabaseInterface.DBWearable();
                if (!dBWearable.AddWearable(name.PersonId, name.ThingId, ref errorMessage, ref newWearableID))
                {
                    return(BadRequest("Internal Server Error:" + errorMessage));
                }
            }
            catch (Exception e)
            {
                return(BadRequest("Internal Server Error:" + e.Message));
            }


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

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


            string exampleJson = null;

            exampleJson = "{\n  \"success\" : true,\n  \"newid\" : " + newWearableID.ToString() + "\n}";

            var example = exampleJson != null
            ? JsonConvert.DeserializeObject <GeneralPostResponse>(exampleJson)
            : default(GeneralPostResponse);

            //TODO: Change the data returned
            return(new ObjectResult(example));
        }
        public virtual IActionResult WearablesPersonIdGet([FromRoute][Required] string wbid, [FromHeader][Required()] string Authorization)
        {
            //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
            // return StatusCode(200, default(Wearable));

            //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
            // return StatusCode(0, default(ErrorResponse));
            if (!ModelState.IsValid)
            {
                var error = ModelState.SelectMany(x => x.Value.Errors).First();
                if (error.ErrorMessage != null && error.ErrorMessage != String.Empty)
                {
                    return(BadRequest(error.ErrorMessage));
                }
                else if (error.Exception?.Message != null)
                {
                    return(BadRequest("Faulty input"));
                }
                else
                {
                    return(BadRequest(ModelState));
                }
            }
            if (Authorization != settings.testToken)
            {
                return(BadRequest("Not allowed"));
            }
            List <COP.API.Models.Wearable> results = null;
            string errorMessage = "";

            try
            {
                DatabaseInterface.DBWearable dBWearable = new DatabaseInterface.DBWearable();
                if (!dBWearable.WearablesPersonIdGet(wbid, ref errorMessage, ref results))
                {
                    return(BadRequest("Internal Server Error:" + errorMessage));
                }
            }
            catch (Exception e)
            {
                return(BadRequest("Internal Server Error:" + e.Message));
            }


            //TODO: Change the data returned
            return(new ObjectResult(results[0].PersonId));
        }