Last active
May 3, 2017 16:50
-
-
Save klimisa/12920e9b276cb7226605e580cb6105e3 to your computer and use it in GitHub Desktop.
Value Object Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Eope.Model.Aegises | |
{ | |
public class AegisType | |
{ | |
private readonly List<AegisType> _aegisTypes = new List<AegisType> | |
{ | |
new AegisType("Συνέδριο"), | |
new AegisType("Σεμινάριο"), | |
new AegisType("Συνάντηση Φαρμακευτική"), | |
new AegisType("Πρόγραμμα"), | |
new AegisType("Κλινικό Φροντιστήριο"), | |
new AegisType("Εκπαιδευτικό Σεμινάριο"), | |
new AegisType("Δράση Συλλόγου"), | |
new AegisType("Επιστημονική Ημερίδα"), | |
new AegisType("Επιστημονική Εκδήλωση"), | |
new AegisType("Επιστημονική Διημερίδα"), | |
new AegisType("Επιστημονική Εκδήλωση-workshop"), | |
new AegisType("Επιστημονική Εκδήλωση-τύπου Β'"), | |
new AegisType("Διεπιστημονική Ημερίδα"), | |
new AegisType("Διεθνές Συνέδριο"), | |
new AegisType("Επιστημονική Συνάντηση"), | |
new AegisType("Medical Oncology and Hematology Board Review Course"), | |
new AegisType("Έρευνα ΟΝΕΟ") | |
}; | |
public AegisType(string name) | |
{ | |
if (name == null) | |
throw new ArgumentNullException("name"); | |
Name = name; | |
} | |
public string Name { get; } | |
public IEnumerable<AegisType> Values() | |
{ | |
return _aegisTypes; | |
} | |
public override bool Equals(object obj) | |
{ | |
var aegisType = obj as AegisType; | |
if (aegisType == null) | |
return false; | |
return aegisType.Name == Name; | |
} | |
public override int GetHashCode() | |
{ | |
return Name.GetHashCode(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment