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); }
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); }
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); }