narsil/Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs

46 lines
1.2 KiB
C#

using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
namespace Tanshu.Accounts.Entities
{
public class Modifier
{
public virtual int ModifierID { get; set; }
public virtual string Name { get; set; }
public override int GetHashCode()
{
return ModifierID.GetHashCode() ^ Name.GetHashCode();
}
public override bool Equals(object obj)
{
if (obj is Modifier)
return (this == (Modifier)obj);
else
return false;
}
public override string ToString()
{
return string.Format("{0} - {1}", ModifierID, Name);
}
public static bool operator ==(Modifier a, Modifier b)
{
if (object.ReferenceEquals(null, a))
return object.ReferenceEquals(null, b);
if (!(a is Modifier))
return false;
if (!(b is Modifier))
return false;
return a.ModifierID == b.ModifierID && a.Name == b.Name;
}
public static bool operator !=(Modifier a, Modifier b)
{
return !(a == b);
}
}
}