private void CreateTrack(int playlistID, Track track) { var insertXr = @"INSERT INTO dbo.xrPlaylistTrack VALUES(PlaylistId,TrackId) VALUES (@playlistId,@trackId)"; _database.Execute(insertXr, new { playlistId = playlistID, trackId = track.Id }); }
public int CreateTrack(Track track) { var insertTrack = @"INSERT INTO dbo.Track VALUES(Name,Length,Number) VALUES (@name,@length,@number); SELECT CAST(SCOPE_IDENTITY() as int;"; return _database.ExecuteScalar<int>(insertTrack, new { name = track.Name, length = track.Length, number = track.Number }); }
private void CreateTrack(int albumId, Track track) { var trackId = _trackRepos.CreateTrack(track); var insertXr = @"INSERT INTO dbo.xrAlbumTrack VALUES(AlbumId,TrackId) VALUES (@albumId,@trackId)"; _database.Execute(insertXr, new { albumId = albumId, trackId=trackId }); }
public TrackViewModel(Track track) { TrackName = track.Name; TrackNumber = track.Number; TrackLength = track.Length; }