public int Age { get; set; }
public string Email { get; set; }
public string VatNumber { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string GetFullName()
return $"{FirstName} {LastName}";
public bool FindByLastName(string lastname)
static void Main(string[] args)
var customers = new Customer[5] {
var length = NameNum(customers);
var newCustomers = new Customer[5];
for (var i = 0; i < customers.Length; i++)
if (customers[i].LastName.Equals(NameNum(customers)))
newCustomers[j] = customers[i];
Console.WriteLine(newCustomers[j].GetFullName());
Array.Resize<Customer>(ref newCustomers, j);
public static string NameNum(Customer[] arr)
foreach (var customer in arr)
if (customer.FindByLastName("55"))
return customer.LastName;