string NextId() { while (true) { string s = "Re" + RelationshipId.ToString(); if (!Relationships.ContainsKey(s)) { return(s); } RelationshipId++; } }
public IEnumerable<Error> GetErrors() { if (string.IsNullOrEmpty(FirstName)) yield return new Error("First name is required.", "FirstName"); if (string.IsNullOrEmpty(LastName)) yield return new Error("Last name is required.", "LastName"); if (string.IsNullOrEmpty(Phone)) yield return new Error("Phone is required.", "Phone"); if (string.IsNullOrEmpty(Address)) yield return new Error("Address is required.", "Address"); if (string.IsNullOrEmpty(Country)) yield return new Error("Country is required.", "Country"); int x = 1; if (!Object.ReferenceEquals(RelationshipId.GetType(), x.GetType())) yield return new Error("Relationship Id should be an integer.", "RelationshipId"); }
private CswNbtMetaDataNodeTypeProp _getRelationshipProp() { CswNbtMetaDataNodeTypeProp RelationshipProp = null; Int32 NodeTypeId = this.NodeTypeProp.getNodeType().NodeTypeId; if (RelationshipType == CswEnumNbtViewPropIdType.NodeTypePropId) { RelationshipProp = _CswNbtResources.MetaData.getNodeTypePropVersion(NodeTypeId, RelationshipId); } else if (RelationshipType == CswEnumNbtViewPropIdType.ObjectClassPropId) { RelationshipProp = _CswNbtResources.MetaData.getNodeTypePropByObjectClassProp(NodeTypeId, RelationshipId); } if (RelationshipProp == null) { throw new CswDniException("RecalculateReferenceValue(): RelationshipId is not valid:" + RelationshipId.ToString()); } return(RelationshipProp); }
private ICswNbtMetaDataProp _getRelationshipProp() { ICswNbtMetaDataProp RelationshipProp = null; if (RelationshipType == CswEnumNbtViewPropIdType.NodeTypePropId) { RelationshipProp = _CswNbtResources.MetaData.getNodeTypeProp(RelationshipId); } else if (RelationshipType == CswEnumNbtViewPropIdType.ObjectClassPropId) { RelationshipProp = _CswNbtResources.MetaData.getObjectClassProp(RelationshipId); } if (RelationshipProp == null) { throw new CswDniException("ChildContents RelationshipId is not valid:" + RelationshipId.ToString()); } return(RelationshipProp); } // _getRelationshipProp()