public IHttpActionResult GetImageById(int id) { COMimage img = BLLimage.GetImageById(id); if (img == null) { return(BadRequest("image does not exist")); } return(Ok(img)); }
public IHttpActionResult PostImage([FromBody] COMimage img) { COMimage im = BLLimage.GetImageById(img.ImageID); if (im != null) { return(BadRequest("image already exist")); } BLLimage.AddImage(img, Form1.categoriesCounter, Form1.voicesCounter); return(Ok()); }