public async Task <AllRecordsResponseModel> GetRecordsAsync() { IEnumerable <Record> records = await _context.GetAsync(); if (records == null) { return(new AllRecordsResponseModel() { Records = new List <RecordResponseModel>() }); } return(new AllRecordsResponseModel { Records = records.Select( r => new RecordResponseModel { Artist = r.Artist, Song = r.Song, Timestamp = r.Timestamp.DateTime }) }); }