public HttpResponseMessage Post(string sessionKey, Image image)
        {
            bool result = UserPersister.ValidateSessionKey(sessionKey);

            if (result == true)
            {
                var entityToAdd = new Image()
                {
                    Url = image.Url,
                    ArticleId = image.ArticleId
                };

                var createdEntity = this.repository.Add(entityToAdd);

                var imageModel = new ImageModel(createdEntity);

                var response = Request.CreateResponse<ImageModel>(HttpStatusCode.Created, imageModel);
                var resourceLink = Url.Link("DefaultApi", new { id = imageModel.Id });

                response.Headers.Location = new Uri(resourceLink);
                return response;
            }

            return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "The user is not valid");
        }
 public ImageModel Get(int id)
 {
     Image image = this.repository.Get(id);
     ImageModel imageModel = new ImageModel(image);
     return imageModel;
 }