Пример #1
0
        public void AddPictureForTheKitten(string kittenName, Pictures picture)
        {
            var kitten = _dbContext.Pets.FirstOrDefault(i => i.Name == kittenName);

            if(kitten != null)
                kitten.Pictures.Add(picture);
        }
Пример #2
0
        public int RemovePicture(Pictures picture)
        {
            if (picture != null)
            {
                _picturesRepository.Delete(picture.ID);
                _picturesRepository.Save();

                var smallKittenPath = _picturesLinksConstructor.GetSmallKittenImageFileName(picture.Image);

                RemoveFile(Server.MapPath(picture.Image));
                RemoveFile(Server.MapPath(smallKittenPath));
            }

            return picture.ID;
        }
Пример #3
0
 public void Update(Pictures pet)
 {
     throw new System.NotImplementedException();
 }
Пример #4
0
 public void Insert(Pictures picture)
 {
     _dbContext.Pictures.Add(picture);
 }