private int FindCreateArtifactType(ArtifactType artifactType) { using (RuntimeEntityModel context = RuntimeEntityModel.CreateInstance()) { if (string.IsNullOrEmpty(artifactType.ReferenceName)) { throw new ArgumentException(string.Format(MigrationToolkitResources.MissingArtifactTypeRefName)); } if (string.IsNullOrEmpty(artifactType.FriendlyName)) { throw new ArgumentException(string.Format(MigrationToolkitResources.MissingArtifactTypeDispName)); } var artifactTypeQuery = from t in context.RTArtifactTypeSet where t.ReferenceName.Equals(artifactType.ReferenceName) && t.DisplayName.Equals(artifactType.FriendlyName) && t.ArtifactContentType.Equals(artifactType.ContentTypeReferenceName) select t; if (artifactTypeQuery.Count() > 0) { return(artifactTypeQuery.First().Id); } var newType = RTArtifactType.CreateRTArtifactType(0, artifactType.ReferenceName, artifactType.FriendlyName, artifactType.ContentTypeReferenceName); context.AddToRTArtifactTypeSet(newType); context.TrySaveChanges(); return(newType.Id); } }
protected ComplexLinkType( string referenceName, string friendlyName, ArtifactType sourceArtifactType, ArtifactType targetArtifactType, ExtendedLinkProperties extendedLinkProperties) : base(referenceName, friendlyName, sourceArtifactType, targetArtifactType) { if (null == extendedLinkProperties) { throw new ArgumentNullException("extendedLinkProperties"); } ExtendedProperties = extendedLinkProperties; }
public Artifact(string uri, ArtifactType artifactType) { if (null == uri) { throw new ArgumentNullException("uri"); } if (null == artifactType) { throw new ArgumentNullException("artifactType"); } Uri = uri; ArtifactType = artifactType; }
public LinkType( string referenceName, string friendlyName, ArtifactType sourceArtifactType, ArtifactType targetArtifactType, ExtendedLinkProperties extendedLinkProperties) { if (string.IsNullOrEmpty(referenceName)) { throw new ArgumentNullException("referenceName"); } if (string.IsNullOrEmpty(friendlyName)) { throw new ArgumentNullException("friendlyName"); } if (null == sourceArtifactType) { throw new ArgumentNullException("sourceArtifactType"); } if (null == targetArtifactType) { throw new ArgumentNullException("targetArtifactType"); } if (null == extendedLinkProperties) { throw new ArgumentNullException("extendedLinkProperties"); } ReferenceName = referenceName; FriendlyName = friendlyName; SourceArtifactType = sourceArtifactType; TargetArtifactType = targetArtifactType; ExtendedProperties = extendedLinkProperties; }