Add open port on centos 7

RHEL and CentOS 7 use firewall-cmd instead of iptables. You should use that kind of command:

# add ssh port as permanent opened port
firewall-cmd --zone=public --add-port=22/tcp --permanent

Then, you can reload rules to be sure that everything is ok

firewall-cmd --reload

This is better than using iptable-save, espacially if you plan to use lxc or docker containers. Launching docker services will add some rules that iptable-save command will prompt. If you save the result, you will have a lot of rules that should NOT be saved. Because docker containers can change them ip addresses at next reboot.

Firewall-cmd with permanent option is better for that.

Check “man firewall-cmd” or check the official firewalld docs to see options. There are a lot of options to check zones, configuration, how it works… man page is really complete.

I strongly recommand to not use iptables-service since Centos 7

Read CSV File in Aspnet Core

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

.net Core – Mysql

MySql Connector NET for .NET Core 1.0

https://docs.efproject.net/en/latest/intro.html