Exemplo n.º 1
0
        public int KittenPictureChangeOrder(int id, int newOrder)
        {
            _picturesRepository.SetNewOrderForPicture(id, newOrder);
            _picturesRepository.Save();

            return(newOrder);
        }
Exemplo n.º 2
0
        public images PostToDb(images im)
        {
            if (im == null)
            {
                throw new ArgumentNullException("null");
            }

            images image = new images {
                imageName = im.imageName, userId = im.userId
            };

            r.AddPicture(image);
            r.Save();
            return(image);
        }
        public PictureVO GetOrSavePicture(string url, string quality)
        {
            if (url == null)
            {
                return(null);
            }

            var picture = _repository.GetAll().FirstOrDefault(c => c.Url.Equals(url));

            if (picture != null)
            {
                return(picture);
            }

            if (quality == null)
            {
                quality = "SD";
            }

            picture = new PictureVO
            {
                Url     = url,
                Quality = quality
            };
            _repository.Save(picture);

            return(picture);
        }