Beispiel #1
0
        public IActionResult Color(long id, string color)
        {
            try
            {
                Note userToUpdate = _notesBL.Get(id);
                if (userToUpdate == null)
                {
                    return(NotFound("The User record couldn't be found."));
                }

                bool result = _notesBL.Color(userToUpdate, color);
                if (result == true)
                {
                    return(this.Ok(new { success = true, message = "Successfully Added Color" }));
                }
                else
                {
                    return(this.BadRequest(new { success = false, message = "Color Adding Failed" }));
                }
            }
            catch (Exception ex)
            {
                return(this.Ok(new { success = false, message = ex.Message }));
            }
        }