public Employee(string firstName, string lastName, int age, string company)
{
FirstName = firstName;
LastName = lastName;
Age = age;
Company = company;
}
Employee employee = new Employee() { LastName = "Lamarche", FirstName = "Patrice" };
List<Employee> employees = new List<Employee>()
new Employee(){LastName="Lamarche"},
new Employee(){LastName="Laut"}
};
class Employee
public Employee()
{ }
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public string Company { get; set; }
var employees = new List<Employee>()
foreach (var employee in employees)
Console.WriteLine(employee.LastName);
var fullEmployee =
new
LastName = employee.LastName,
employee.FirstName,
FullName = employee.LastName + " " + employee.FirstName
public static class ExtensionMethods
public static string FirstLetterInUpperCase(this string word)
return word.Substring(0, 1).ToUpper() + word.Substring(1);
static void Main(string[] args)
string word = "bonjour";
Console.WriteLine(word.FirstLetterInUpperCase());
namespace System.Runtime.CompilerServices
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class| AttributeTargets.Assembly)]
public sealed class ExtensionAttribute : Attribute