var file = Path.Combine(_hostingEnv.WebRootPath, "data", "sample.csv");
using (var streamReader = System.IO.File.OpenText(file))
{
    var dbContext = new SampleDbContext();
    while (!streamReader.EndOfStream)
    {
        var line = streamReader.ReadLine();
        var data = line.Split(new[] { ',' });
        var person = new Person() { Name = data[0], Email = data[1], Phone = data[2] };
        dbContext.Persons.Add(person);
    }

    dbContext.SaveChanges();
}
Advertisements