You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Models/BaseModel.cs

43 lines
1.1 KiB

6 years ago
using System;
using System.Runtime.Serialization;
namespace ZeroLevel.Models
{
[DataContract]
[Serializable]
public abstract class BaseModel
{
#region Equal
6 years ago
public bool Equals(BaseModel other)
{
if (this == null)
6 years ago
throw new NullReferenceException();
if (other == null)
return false;
if (ReferenceEquals(this, other))
return true;
if (this.GetType() != other.GetType())
return false;
return true;
}
public override bool Equals(object obj)
{
if (this == null)
throw new NullReferenceException();
return Equals(obj as BaseModel);
}
public static bool operator ==(BaseModel first, BaseModel second) => Equals(first, second);
6 years ago
public static bool operator !=(BaseModel first, BaseModel second) => !Equals(first, second);
#endregion Equal
6 years ago
public abstract override int GetHashCode();
6 years ago
public abstract object Clone();
}
}

Powered by TurnKey Linux.