Esempio n. 1
0
        public int CreatePlaylist(string name, string description, int userId)
        {
            var newPlaylist = new Playlist
            {
                Name        = name,
                Description = description,
                UserId      = userId
            };

            db.Playlist.Add(newPlaylist);
            db.SaveChanges();
            return(newPlaylist.PlaylistId);
        }
Esempio n. 2
0
        public bool AddNewUser(string email, string password, string name)
        {
            var newUser = new Profile()
            {
                Email    = email,
                Name     = name,
                Password = password
            };

            db.Profile.Add(newUser);

            var result = db.SaveChanges();

            if (result > 0)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public int CreateAlbum(string name, string description, int userId)
        {
            var newAlbum = new PhotoAlbum
            {
                Name        = name,
                Description = description,
                UserId      = userId
            };

            db.PhotoAlbum.Add(newAlbum);
            db.SaveChanges();
            return(newAlbum.AlbumId);
        }