csharp-nancyfx.modelMutable.mustache Maven / Gradle / Ivy
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Sharpility.Extensions;
using NodaTime;
{{#imports}}using {{import}};
{{/imports}}
{{#models}}
{{#model}}
namespace {{packageName}}.{{packageContext}}.Models
{ {{#vars}}{{#isEnum}}{{^parent}}
{{>innerModelEnum}}{{/parent}}{{/isEnum}}{{#items.isEnum}}
{{#items}}{{>innerModelEnum}}{{/items}}{{/items.isEnum}}{{/vars}}
///
/// {{description}}{{^description}}{{classname}}{{/description}}
///
public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}>
{ {{#vars}}{{^isInherited}}
///
/// {{description}}{{^description}}{{{name}}}{{/description}}
///
public {{>nullableDataType}} {{name}} { get; set; }
{{/isInherited}}{{/vars}}
public override string ToString()
{
return this.PropertiesToString();
}
public override bool Equals(object obj)
{
return this.EqualsByProperties(obj);
}
public bool Equals({{classname}} other)
{
return Equals((object) other);
}
public override int GetHashCode()
{
return this.PropertiesHash();
}
///
/// Implementation of == operator for ({{classname}}.
///
/// Compared ({{classname}}
/// Compared ({{classname}}
/// true if compared items are equals, false otherwise
public static bool operator == ({{classname}} left, {{classname}} right)
{
return Equals(left, right);
}
///
/// Implementation of != operator for ({{classname}}.
///
/// Compared ({{classname}}
/// Compared ({{classname}}
/// true if compared items are not equals, false otherwise
public static bool operator != ({{classname}} left, {{classname}} right)
{
return !Equals(left, right);
}
}
{{/model}}
{{/models}}
}