1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.ActiveRecord
.Tests
.Model
.CompositeModel
29 public AgentKey(string orgId
, string name
)
36 public virtual string OrgId
39 set { orgId = value; }
43 public virtual string Name
49 public override string ToString()
51 return String
.Join(":", new string[] {orgId, name}
);
54 public override bool Equals(object obj
)
60 if (ReferenceEquals(this, obj
))
64 if (!(obj
is AgentKey
))
68 AgentKey rhs
= (AgentKey
) obj
;
69 return (this.orgId
== rhs
.orgId
|| (this.orgId
!= null && this.orgId
.Equals(rhs
.orgId
))) &&
70 (this.name
== rhs
.name
|| (this.name
!= null && this.name
.Equals(rhs
.name
)));
73 public override int GetHashCode()
75 return (this.orgId
.GetHashCode() ^
this.name
.GetHashCode());