using System; using Widgetsphere.EFCore.DataAccess; namespace Acme.EFExample.EFDAL.Entity { #region CustomerPrimaryKey /// <summary> /// A strongly-typed primary key object for the 'Customer' table. /// </summary> [Serializable()] public partial class CustomerPrimaryKey : Widgetsphere.EFCore.DataAccess.IPrimaryKey { /// <summary> /// A primary key field of the Customer entity /// </summary> protected int _UserId; /// <summary> /// The constructor for this object which takes the fields that comprise the primary key for the 'Customer' table. /// </summary> public CustomerPrimaryKey(int userId) { _UserId = userId; } /// <summary> /// A primary key for the 'Customer' table. /// </summary> public int UserId { get { return _UserId; } } /// <summary> /// Returns a value indicating whether the current object is equal to a specified object. /// </summary> public override bool Equals(object obj) { if (obj == null) return false; if (obj.GetType() == this.GetType()) { bool retval = true; retval &= (this.UserId == ((Acme.EFExample.EFDAL.Entity.CustomerPrimaryKey)obj).UserId); return retval; } return false; } /// <summary> /// Serves as a hash function for this particular type. /// </summary> public override int GetHashCode() { return base.GetHashCode(); } } #endregion }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)