1: using System;
2:
3: namespace SpringSeries.Core.ExpressionLanguage
4: {
5: public class Student
6: {
7: private string _lastName;
8: private string _firstName;
9: private DateTime _dateOdBirth = DateTime.MinValue;
10:
11: public string LastName
12: {
13: get { return _lastName; }
14: set { _lastName = value; }
15: }
16:
17: public DateTime DateOdBirth
18: {
19: get { return _dateOdBirth; }
20: set { _dateOdBirth = value; }
21: }
22:
23: public string FirstName
24: {
25: get { return _firstName; }
26: set { _firstName = value; }
27: }
28:
29: public int Age
30: {
31: get
32: {
33: return (DateTime.Now.Year - _dateOdBirth.Year);
34: }
35: }
36:
37: public Student(string firstName, string lastName, DateTime dateOdBirth)
38: {
39: _firstName = firstName;
40: _lastName = lastName;
41: _dateOdBirth = dateOdBirth;
42: }
43:
44: public override string ToString()
45: {
46: return String.Format("Nome: {0} Cognome: {1} Età: {2}");
47: }
48: }
49: }