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();
        }
示例#3
0
        public void Add(Photo photo)
        {
            _context.Photos.Add(photo);

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

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