public void Attach(List <int> attachments, int albumId)
 {
     foreach (var photoId in attachments)
     {
         var photoAlbum = new AlbumPhoto();
         photoAlbum.AlbumId = albumId;
         photoAlbum.PhotoId = photoId;
         _context.AlbumPhotos.Add(photoAlbum);
     }
     _context.SaveChanges();
 }
        public void AddComment(Comment comment)
        {
            _context.Comments.Add(comment);

            _context.SaveChanges();
        }
Example #3
0
        public void Add(Photo photo)
        {
            _context.Photos.Add(photo);

            _context.SaveChanges();
        }
Example #4
0
        public void Like(Like like)
        {
            _context.Likes.Add(like);

            _context.SaveChanges();
        }
Example #5
0
 public int Complete()
 {
     return(_context.SaveChanges());
 }