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(); }
public void Add(Photo photo) { _context.Photos.Add(photo); _context.SaveChanges(); }
public void Like(Like like) { _context.Likes.Add(like); _context.SaveChanges(); }
public int Complete() { return(_context.SaveChanges()); }