0f323f8fab
Signed-off-by: unknown <tanshu@.(none)>
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using System;
|
|
using System.Runtime.Serialization;
|
|
using FluentNHibernate.Mapping;
|
|
using System.Collections.Generic;
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
namespace Tanshu.Accounts.Entities
|
|
{
|
|
public class Modifier
|
|
{
|
|
public virtual int ModifierID { get; set; }
|
|
public virtual string Name { get; set; }
|
|
|
|
[NotNull]
|
|
public virtual IList<ProductGroupModifier> ProductGroupModifiers { 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);
|
|
}
|
|
|
|
}
|
|
}
|