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

46 lines
1.2 KiB
C#
Raw Normal View History

2011-01-22 12:38:30 +00:00
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
2011-01-22 12:38:30 +00:00
namespace Tanshu.Accounts.Entities
2011-01-22 12:38:30 +00:00
{
public class Modifier
2011-01-22 12:38:30 +00:00
{
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);
}
2011-01-22 12:38:30 +00:00
}
}