1. malweka
  2. GoliathData

Commits

malweka  committed 1f5facf

class template modification to implement IEquatable and Equals override

  • Participants
  • Parent commits 07503ff
  • Branches default

Comments (0)

Files changed (6)

File src/Goliath.Data.Console/Generated/Animal.cs

View file
-///////////////////////////////////////////////////////////////////
-//	
-//	Auto generated -  Class Template 1.1.0
-//
-///////////////////////////////////////////////////////////////////
-using System;
-using System.Collections.Generic;
-
-namespace WebZoo.Data
-{
-	public partial class Animal : WebZoo.Data.BaseEntityInt
-	{
-		#region Primary Key
-
-
-		#endregion
-
-		#region properties
-
-		public virtual string Name { get; set; }
-		public virtual double Age { get; set; }
-		public virtual string Location { get; set; }
-		public virtual DateTime ReceivedOn { get; set; }
-		public virtual int ZooId { get; set; }
-
-		#endregion
-
-		#region relations
-
-		public virtual WebZoo.Data.Zoo Zoo { get; set; }		
-		public virtual IList<WebZoo.Data.Employee> EmployeesOnAnimalsHandler_AnimalId { get; set; }
-
-		#endregion
-	}
-
-	#region metadata
-
-	public static partial class PropertyNames
-	{
-		/// <summary>
-		/// Properties names for <see cref="WebZoo.Data.Animal"/>
-		/// </summary>
-		public static class Animal
-		{
-			public const string Id = "Id";
-			public const string Name = "Name";
-			public const string Age = "Age";
-			public const string Location = "Location";
-			public const string ReceivedOn = "ReceivedOn";
-			public const string ZooId = "ZooId";
-			public const string Zoo = "Zoo";
-			public const string EmployeesOnAnimalsHandler_AnimalId = "EmployeesOnAnimalsHandler_AnimalId";
-		}
-	}
-
-	#endregion
-}
-
+///////////////////////////////////////////////////////////////////
+//	
+//	Auto generated -  Class Template 1.2.0
+//
+///////////////////////////////////////////////////////////////////
+using System;
+using System.Collections.Generic;
+
+namespace WebZoo.Data
+{
+	public partial class Animal : WebZoo.Data.BaseEntityInt, IEquatable<Animal>
+	{
+		#region Primary Key
+
+
+		#endregion
+
+		#region properties
+
+		public virtual string Name { get; set; }
+		public virtual double Age { get; set; }
+		public virtual string Location { get; set; }
+		public virtual DateTime ReceivedOn { get; set; }
+		public virtual int ZooId { get; set; }
+
+		#endregion
+
+		#region relations
+
+		public virtual WebZoo.Data.Zoo Zoo { get; set; }		
+		public virtual IList<WebZoo.Data.Employee> EmployeesOnAnimalsHandler_AnimalId { get; set; }
+
+		#endregion
+		
+		#region Equatable
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="Animal"/> is equal to this instance.
+        /// </summary>
+        /// <param name="other">The <see cref="Animal"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="Animal"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public bool Equals(Animal other)
+		{
+			if(other == null)
+				return false;
+			
+			return other.Id.Equals(Id);
+		}
+		
+		/// <summary>
+        /// Returns a hash code for this instance.
+        /// </summary>
+        /// <returns>
+        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
+        /// </returns>
+		public override int GetHashCode()
+        {
+        	return Id.GetHashCode();
+        }
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
+        /// </summary>
+        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public override bool Equals(object obj)
+        {
+            if (obj is Animal)
+                return Equals((Animal)obj);
+		
+            return base.Equals(obj);
+		}
+		#endregion
+		
+	}
+
+	#region metadata
+
+	public static partial class PropertyNames
+	{
+		/// <summary>
+		/// Properties names for <see cref="WebZoo.Data.Animal"/>
+		/// </summary>
+		public static class Animal
+		{
+			public const string Id = "Id";
+			public const string Name = "Name";
+			public const string Age = "Age";
+			public const string Location = "Location";
+			public const string ReceivedOn = "ReceivedOn";
+			public const string ZooId = "ZooId";
+			public const string Zoo = "Zoo";
+			public const string EmployeesOnAnimalsHandler_AnimalId = "EmployeesOnAnimalsHandler_AnimalId";
+		}
+	}
+
+	#endregion
+}
+

File src/Goliath.Data.Console/Generated/Employee.cs

View file
-///////////////////////////////////////////////////////////////////
-//	
-//	Auto generated -  Class Template 1.1.0
-//
-///////////////////////////////////////////////////////////////////
-using System;
-using System.Collections.Generic;
-
-namespace WebZoo.Data
-{
-	public partial class Employee : WebZoo.Data.BaseEntityInt
-	{
-		#region Primary Key
-
-
-		#endregion
-
-		#region properties
-
-		public virtual string FirstName { get; set; }
-		public virtual string LastName { get; set; }
-		public virtual string EmailAddress { get; set; }
-		public virtual string Telephone { get; set; }
-		public virtual string Title { get; set; }
-		public virtual DateTime HiredOn { get; set; }
-		public virtual int? AssignedToZooId { get; set; }
-
-		#endregion
-
-		#region relations
-
-		public virtual WebZoo.Data.Zoo AssignedToZoo { get; set; }		
-		public virtual IList<WebZoo.Data.Animal> AnimalsOnAnimalsHandler_EmployeeId { get; set; }
-
-		#endregion
-	}
-
-	#region metadata
-
-	public static partial class PropertyNames
-	{
-		/// <summary>
-		/// Properties names for <see cref="WebZoo.Data.Employee"/>
-		/// </summary>
-		public static class Employee
-		{
-			public const string Id = "Id";
-			public const string FirstName = "FirstName";
-			public const string LastName = "LastName";
-			public const string EmailAddress = "EmailAddress";
-			public const string Telephone = "Telephone";
-			public const string Title = "Title";
-			public const string HiredOn = "HiredOn";
-			public const string AssignedToZooId = "AssignedToZooId";
-			public const string AssignedToZoo = "AssignedToZoo";
-			public const string AnimalsOnAnimalsHandler_EmployeeId = "AnimalsOnAnimalsHandler_EmployeeId";
-		}
-	}
-
-	#endregion
-}
-
+///////////////////////////////////////////////////////////////////
+//	
+//	Auto generated -  Class Template 1.2.0
+//
+///////////////////////////////////////////////////////////////////
+using System;
+using System.Collections.Generic;
+
+namespace WebZoo.Data
+{
+	public partial class Employee : WebZoo.Data.BaseEntityInt, IEquatable<Employee>
+	{
+		#region Primary Key
+
+
+		#endregion
+
+		#region properties
+
+		public virtual string FirstName { get; set; }
+		public virtual string LastName { get; set; }
+		public virtual string EmailAddress { get; set; }
+		public virtual string Telephone { get; set; }
+		public virtual string Title { get; set; }
+		public virtual DateTime HiredOn { get; set; }
+		public virtual int? AssignedToZooId { get; set; }
+
+		#endregion
+
+		#region relations
+
+		public virtual WebZoo.Data.Zoo AssignedToZoo { get; set; }		
+		public virtual IList<WebZoo.Data.Animal> AnimalsOnAnimalsHandler_EmployeeId { get; set; }
+
+		#endregion
+		
+		#region Equatable
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="Employee"/> is equal to this instance.
+        /// </summary>
+        /// <param name="other">The <see cref="Employee"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="Employee"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public bool Equals(Employee other)
+		{
+			if(other == null)
+				return false;
+			
+			return other.Id.Equals(Id);
+		}
+		
+		/// <summary>
+        /// Returns a hash code for this instance.
+        /// </summary>
+        /// <returns>
+        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
+        /// </returns>
+		public override int GetHashCode()
+        {
+        	return Id.GetHashCode();
+        }
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
+        /// </summary>
+        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public override bool Equals(object obj)
+        {
+            if (obj is Employee)
+                return Equals((Employee)obj);
+		
+            return base.Equals(obj);
+		}
+		#endregion
+		
+	}
+
+	#region metadata
+
+	public static partial class PropertyNames
+	{
+		/// <summary>
+		/// Properties names for <see cref="WebZoo.Data.Employee"/>
+		/// </summary>
+		public static class Employee
+		{
+			public const string Id = "Id";
+			public const string FirstName = "FirstName";
+			public const string LastName = "LastName";
+			public const string EmailAddress = "EmailAddress";
+			public const string Telephone = "Telephone";
+			public const string Title = "Title";
+			public const string HiredOn = "HiredOn";
+			public const string AssignedToZooId = "AssignedToZooId";
+			public const string AssignedToZoo = "AssignedToZoo";
+			public const string AnimalsOnAnimalsHandler_EmployeeId = "AnimalsOnAnimalsHandler_EmployeeId";
+		}
+	}
+
+	#endregion
+}
+

File src/Goliath.Data.Console/Generated/Monkey.cs

View file
-///////////////////////////////////////////////////////////////////
-//	
-//	Auto generated -  Class Template 1.1.0
-//
-///////////////////////////////////////////////////////////////////
-using System;
-using System.Collections.Generic;
-
-namespace WebZoo.Data
-{
-	public partial class Monkey : WebZoo.Data.Animal
-	{
-		#region Primary Key
-
-
-		#endregion
-
-		#region properties
-
-		public virtual string Family { get; set; }
-		public virtual bool CanDoTricks { get; set; }
-
-		#endregion
-
-		#region relations
-
-
-		#endregion
-	}
-
-	#region metadata
-
-	public static partial class PropertyNames
-	{
-		/// <summary>
-		/// Properties names for <see cref="WebZoo.Data.Monkey"/>
-		/// </summary>
-		public static class Monkey
-		{
-			public const string Id = "Id";
-			public const string Family = "Family";
-			public const string CanDoTricks = "CanDoTricks";
-		}
-	}
-
-	#endregion
-}
-
+///////////////////////////////////////////////////////////////////
+//	
+//	Auto generated -  Class Template 1.2.0
+//
+///////////////////////////////////////////////////////////////////
+using System;
+using System.Collections.Generic;
+
+namespace WebZoo.Data
+{
+	public partial class Monkey : WebZoo.Data.Animal, IEquatable<Monkey>
+	{
+		#region Primary Key
+
+
+		#endregion
+
+		#region properties
+
+		public virtual string Family { get; set; }
+		public virtual bool CanDoTricks { get; set; }
+
+		#endregion
+
+		#region relations
+
+
+		#endregion
+		
+		#region Equatable
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="Monkey"/> is equal to this instance.
+        /// </summary>
+        /// <param name="other">The <see cref="Monkey"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="Monkey"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public bool Equals(Monkey other)
+		{
+			if(other == null)
+				return false;
+			
+			return other.Id.Equals(Id);
+		}
+		
+		/// <summary>
+        /// Returns a hash code for this instance.
+        /// </summary>
+        /// <returns>
+        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
+        /// </returns>
+		public override int GetHashCode()
+        {
+        	return Id.GetHashCode();
+        }
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
+        /// </summary>
+        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public override bool Equals(object obj)
+        {
+            if (obj is Monkey)
+                return Equals((Monkey)obj);
+		
+            return base.Equals(obj);
+		}
+		#endregion
+		
+	}
+
+	#region metadata
+
+	public static partial class PropertyNames
+	{
+		/// <summary>
+		/// Properties names for <see cref="WebZoo.Data.Monkey"/>
+		/// </summary>
+		public static class Monkey
+		{
+			public const string Id = "Id";
+			public const string Family = "Family";
+			public const string CanDoTricks = "CanDoTricks";
+		}
+	}
+
+	#endregion
+}
+

File src/Goliath.Data.Console/Generated/Zoo.cs

View file
-///////////////////////////////////////////////////////////////////
-//	
-//	Auto generated -  Class Template 1.1.0
-//
-///////////////////////////////////////////////////////////////////
-using System;
-using System.Collections.Generic;
-
-namespace WebZoo.Data
-{
-	public partial class Zoo : WebZoo.Data.BaseEntityInt
-	{
-		#region Primary Key
-
-
-		#endregion
-
-		#region properties
-
-		public virtual string Name { get; set; }
-		public virtual string City { get; set; }
-		public virtual bool AcceptNewAnimals { get; set; }
-
-		#endregion
-
-		#region relations
-
-		public virtual IList<WebZoo.Data.Animal> AnimalsOnZooId { get; set; }
-		public virtual IList<WebZoo.Data.Employee> EmployeesOnAssignedToZooId { get; set; }
-
-		#endregion
-	}
-
-	#region metadata
-
-	public static partial class PropertyNames
-	{
-		/// <summary>
-		/// Properties names for <see cref="WebZoo.Data.Zoo"/>
-		/// </summary>
-		public static class Zoo
-		{
-			public const string Id = "Id";
-			public const string Name = "Name";
-			public const string City = "City";
-			public const string AcceptNewAnimals = "AcceptNewAnimals";
-			public const string AnimalsOnZooId = "AnimalsOnZooId";
-			public const string EmployeesOnAssignedToZooId = "EmployeesOnAssignedToZooId";
-		}
-	}
-
-	#endregion
-}
-
+///////////////////////////////////////////////////////////////////
+//	
+//	Auto generated -  Class Template 1.2.0
+//
+///////////////////////////////////////////////////////////////////
+using System;
+using System.Collections.Generic;
+
+namespace WebZoo.Data
+{
+	public partial class Zoo : WebZoo.Data.BaseEntityInt, IEquatable<Zoo>
+	{
+		#region Primary Key
+
+
+		#endregion
+
+		#region properties
+
+		public virtual string Name { get; set; }
+		public virtual string City { get; set; }
+		public virtual bool AcceptNewAnimals { get; set; }
+
+		#endregion
+
+		#region relations
+
+		public virtual IList<WebZoo.Data.Animal> AnimalsOnZooId { get; set; }
+		public virtual IList<WebZoo.Data.Employee> EmployeesOnAssignedToZooId { get; set; }
+
+		#endregion
+		
+		#region Equatable
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="Zoo"/> is equal to this instance.
+        /// </summary>
+        /// <param name="other">The <see cref="Zoo"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="Zoo"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public bool Equals(Zoo other)
+		{
+			if(other == null)
+				return false;
+			
+			return other.Id.Equals(Id);
+		}
+		
+		/// <summary>
+        /// Returns a hash code for this instance.
+        /// </summary>
+        /// <returns>
+        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
+        /// </returns>
+		public override int GetHashCode()
+        {
+        	return Id.GetHashCode();
+        }
+		
+		/// <summary>
+        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
+        /// </summary>
+        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
+        /// <returns>
+        /// 	<c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
+        /// </returns>
+		public override bool Equals(object obj)
+        {
+            if (obj is Zoo)
+                return Equals((Zoo)obj);
+		
+            return base.Equals(obj);
+		}
+		#endregion
+		
+	}
+
+	#region metadata
+
+	public static partial class PropertyNames
+	{
+		/// <summary>
+		/// Properties names for <see cref="WebZoo.Data.Zoo"/>
+		/// </summary>
+		public static class Zoo
+		{
+			public const string Id = "Id";
+			public const string Name = "Name";
+			public const string City = "City";
+			public const string AcceptNewAnimals = "AcceptNewAnimals";
+			public const string AnimalsOnZooId = "AnimalsOnZooId";
+			public const string EmployeesOnAssignedToZooId = "EmployeesOnAssignedToZooId";
+		}
+	}
+
+	#endregion
+}
+

File src/Goliath.Data.Console/Templates/Class.razt

View file
-@using Goliath.Data.Mapping
-@using Goliath.Data.Diagnostics
-///////////////////////////////////////////////////////////////////
-//	
-//	Auto generated -  Class Template 1.1.0
-//
-///////////////////////////////////////////////////////////////////
-using System;
-using System.Collections.Generic;
-@{
-	//ILogger logger = Logger.GetLogger(this.GetType());
-	string _extends = string.Empty;
-	if(!string.IsNullOrWhiteSpace(Model.Extends))
-		_extends = string.Format(": {0}", Model.Extends);
-}
-
-namespace @Model.Namespace
-{
-	public partial class @Model.Name @(_extends)
-	{
-		#region Primary Key
-
-		@{
-			if(Model.PrimaryKey != null)
-			{
-				foreach(var k in Model.PrimaryKey.Keys)
-				{
-					Property p = k;
-					if(!p.CanPrint(Model))
-						continue;
-		@:public virtual @p.GetClrTypeAsString(Model) @p.PropertyName { get; set; }
-				}
-			}
-		}
-
-		#endregion
-
-		#region properties
-
-		@{
-			foreach(var p in Model.Properties)
-			{
-				if(!p.CanPrint(Model))
-					continue;
-		@:public virtual @p.GetClrTypeAsString(Model) @p.PropertyName { get; set; }
-			}
-		}
-
-		#endregion
-
-		#region relations
-
-		@{
-			foreach(var p in Model.Relations)
-			{
-				if(!p.CanPrint(Model))
-					continue;
-				var other = Model.Parent.EntityConfigs[p.ReferenceEntityName];
-				if((int)p.RelationType < 2)
-				{
-		@:public virtual @other.FullName @p.PropertyName { get; set; }		
-				}
-				else
-				{
-		@:public virtual IList<@other.FullName> @p.PropertyName { get; set; }
-				}
-			}
-		}
-
-		#endregion
-	}
-
-	#region metadata
-
-	public static partial class PropertyNames
-	{
-		/// <summary>
-		/// Properties names for <see cref="@(Model.FullName)"/>
-		/// </summary>
-		public static class @(Model.Name)
-		{
-			@{
-				if(Model.PrimaryKey != null)
-				{
-					foreach(var k in Model.PrimaryKey.Keys)
-					{
-						Property p = k;
-			@:public const string @p.PropertyName = "@p.PropertyName";
-					}
-				}
-
-				foreach(var p in Model.Properties)
-				{
-			@:public const string @p.PropertyName = "@p.PropertyName";
-				}
-				foreach(var p in Model.Relations)
-				{
-			@:public const string @p.PropertyName = "@p.PropertyName";
-				}
-			}	
-		}
-	}
-
-	#endregion
-}
-
+@using Goliath.Data.Mapping
+@using Goliath.Data.Diagnostics
+///////////////////////////////////////////////////////////////////
+//	
+//	Auto generated -  Class Template 1.2.0
+//
+///////////////////////////////////////////////////////////////////
+using System;
+using System.Collections.Generic;
+@{
+	//ILogger logger = Logger.GetLogger(this.GetType());
+	string _extends = string.Empty; 
+
+	if(!string.IsNullOrWhiteSpace(Model.Extends))
+		_extends = string.Format(": {0}", Model.Extends);
+
+	if(Model.PrimaryKey != null)
+	{
+		if(string.IsNullOrEmpty(_extends))
+			_extends = string.Format(": IEquatable<{0}>", Model.Name);
+		else
+			_extends = string.Format("{0}, IEquatable<{1}>", _extends, Model.Name); 
+	}
+}
+
+namespace @Model.Namespace
+{
+	public partial class @Model.Name @(_extends)
+	{
+		#region Primary Key
+
+		@{
+			if(Model.PrimaryKey != null)
+			{
+				foreach(var k in Model.PrimaryKey.Keys)
+				{
+					Property p = k;
+					if(!p.CanPrint(Model))
+						continue;
+		@:public virtual @p.GetClrTypeAsString(Model) @p.PropertyName { get; set; }
+				}
+			}
+		}
+
+		#endregion
+
+		#region properties
+
+		@{
+			foreach(var p in Model.Properties)
+			{
+				if(!p.CanPrint(Model))
+					continue;
+		@:public virtual @p.GetClrTypeAsString(Model) @p.PropertyName { get; set; }
+			}
+		}
+
+		#endregion
+
+		#region relations
+
+		@{
+			foreach(var p in Model.Relations)
+			{
+				if(!p.CanPrint(Model))
+					continue;
+				var other = Model.Parent.EntityConfigs[p.ReferenceEntityName];
+				if((int)p.RelationType < 2)
+				{
+		@:public virtual @other.FullName @p.PropertyName { get; set; }		
+				}
+				else
+				{
+		@:public virtual IList<@other.FullName> @p.PropertyName { get; set; }
+				}
+			}
+		}
+
+		#endregion
+		@{
+			if(Model.PrimaryKey != null)
+			{
+		@:
+		@:#region Equatable
+		@:
+		@:/// <summary>
+        @:/// Determines whether the specified <see cref="@(Model.Name)"/> is equal to this instance.
+        @:/// </summary>
+        @:/// <param name="other">The <see cref="@(Model.Name)"/> to compare with this instance.</param>
+        @:/// <returns>
+        @:/// 	<c>true</c> if the specified <see cref="@(Model.Name)"/> is equal to this instance; otherwise, <c>false</c>.
+        @:/// </returns>
+		@:public bool Equals(@(Model.Name) other)
+		@:{
+		@:	if(other == null)
+		@:		return false;
+		@:	
+		@:	return other.@(Model.PrimaryKey.Keys[0].Key.PropertyName).Equals(@(Model.PrimaryKey.Keys[0].Key.PropertyName));
+		@:}
+		@:
+		@:/// <summary>
+        @:/// Returns a hash code for this instance.
+        @:/// </summary>
+        @:/// <returns>
+        @:/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
+        @:/// </returns>
+		@:public override int GetHashCode()
+        @:{
+        @:	return @(Model.PrimaryKey.Keys[0].Key.PropertyName).GetHashCode();
+        @:}
+		@:
+		@:/// <summary>
+        @:/// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
+        @:/// </summary>
+        @:/// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
+        @:/// <returns>
+        @:/// 	<c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
+        @:/// </returns>
+		@:public override bool Equals(object obj)
+        @:{
+        @:    if (obj is @(Model.Name))
+        @:        return Equals((@(Model.Name))obj);
+		@:
+        @:    return base.Equals(obj);
+		@:}
+		@:#endregion
+			}
+		}
+		
+	}
+
+	#region metadata
+
+	public static partial class PropertyNames
+	{
+		/// <summary>
+		/// Properties names for <see cref="@(Model.FullName)"/>
+		/// </summary>
+		public static class @(Model.Name)
+		{
+			@{
+				if(Model.PrimaryKey != null)
+				{
+					foreach(var k in Model.PrimaryKey.Keys)
+					{
+						Property p = k;
+			@:public const string @p.PropertyName = "@p.PropertyName";
+					}
+				}
+
+				foreach(var p in Model.Properties)
+				{
+			@:public const string @p.PropertyName = "@p.PropertyName";
+				}
+				foreach(var p in Model.Relations)
+				{
+			@:public const string @p.PropertyName = "@p.PropertyName";
+				}
+			}	
+		}
+	}
+
+	#endregion
+}
+

File src/Goliath.Data/Entity/ITrackable.cs

View file
         /// </value>
         long Version { get; set; }
 
-        /// <summary>
-        /// Gets the created on.
-        /// </summary>
-        DateTime CreatedOn { get; }
+        ///// <summary>
+        ///// Gets the created on.
+        ///// </summary>
+        //DateTime CreatedOn { get; }
     }
 }