public async Task Delete(string id) { SongViewHistory songViewHistory = this.context.SongViewHistories.Find(id); this.context.SongViewHistories.Remove(songViewHistory); await this.context.SaveChangesAsync(); }
public async Task Create(string songId, string userId) { SongViewHistory songViewHistory = new SongViewHistory(); songViewHistory.UserId = userId; songViewHistory.SongId = songId; await this.context.SongViewHistories.AddAsync(songViewHistory); await this.context.SaveChangesAsync(); }