public override string WriteOneLine() { return(entity.Id.ToString() + ";" + entity.Name + ";" + EncryptionDecryption.EncriptPassword(entity.Password.ToString()) + ";" + entity.Address); }
private void ExportCustomers(IEnumerable <Customer> listAllCustomers) { foreach (Customer customer in listAllCustomers) { customer.Password = EncryptionDecryption.EncriptPassword(customer.Password); dbContext.Set <Customer>().Add(customer); } }
public override Customer ConvertOneLine(string line) { splitLine = line.Split(';'); entity = new Customer(); entity.Id = int.Parse(splitLine[0]); entity.Name = splitLine[1]; entity.Password = EncryptionDecryption.DecryptPassword(splitLine[2]); entity.Address = splitLine[3]; return(entity); }
public List <Customer> CustomersList() { List <Customer> allCustomers = new List <Customer>(); foreach (Customer customer in dbContext.Customer) { customer.Password = EncryptionDecryption.DecryptPassword(customer.Password); allCustomers.Add(customer); } return(allCustomers); }