Пример #1
0
            public EntityType(
                Guid id,
                Guid destinationSystemId,
                string name,
                Type type,
                Type sinkType,
                Type cacheFeedType,
                bool isMutable,
                bool isDuplicable)
            {
                // validate parameters
                ArgumentValidator.EnsureArgumentNotEmpty(id, nameof(id));
                ArgumentValidator.EnsureArgumentNotEmpty(
                    destinationSystemId, nameof(destinationSystemId));
                ArgumentValidator.EnsureArgumentNotNullOrWhiteSpace(name, nameof(name));
                string trimmedName = name.Trim();

                ArgumentValidator.EnsureArgumentDoesNotExceedMaxLength(
                    trimmedName, MaxNameLength, nameof(name));
                ArgumentValidator.EnsureArgumentNotNull(type, nameof(type));
                ArgumentValidator.EnsureArgumentNotNull(sinkType, nameof(sinkType));

                // set property values
                this.Id = id;
                this.DestinationSystemId = destinationSystemId;
                this.Name                  = trimmedName;
                this.TypeName              = type.AssemblyQualifiedName;
                this.SinkTypeFullName      = sinkType.GetStrippedFullName();
                this.CacheFeedTypeFullName = cacheFeedType?.GetStrippedFullName();
                this.IsMutable             = isMutable;
                this.IsDuplicable          = isDuplicable;
            }
Пример #2
0
 private void EnsureNotEmptyIfNotNull(Guid?argument, string paramName)
 {
     if (argument.HasValue)
     {
         ArgumentValidator.EnsureArgumentNotEmpty(argument.Value, paramName);
     }
 }
Пример #3
0
 /// <summary>
 /// Sets the orphan mapping behavior for the specified entity type.
 /// </summary>
 /// <param name="context">The deployment context.</param>
 /// <param name="entityTypeId">The ID of the entity type.</param>
 /// <param name="behavior">The orphan mapping behavior.</param>
 public static void EntityTypeOrphanMappingBehavior(
     this IDeploymentContext context,
     Guid entityTypeId,
     OrphanMappingBehavior behavior)
 {
     ArgumentValidator.EnsureArgumentNotNull(context, nameof(context));
     ArgumentValidator.EnsureArgumentNotEmpty(entityTypeId, nameof(entityTypeId));
     ValidateOrphanMappingBehavior(behavior);
     context.EntityTypeParameter(
         entityTypeId,
         OrphanMappingBehaviorParameterName,
         behavior.ToString());
 }
Пример #4
0
 /// <summary>
 /// Sets the orphan mapping behavior for the specified source system.
 /// </summary>
 /// <param name="context">The deployment context.</param>
 /// <param name="sourceSystemId">The ID of the source (external) system.</param>
 /// <param name="behavior">The orphan mapping behavior.</param>
 public static void SourceSystemOrphanMappingBehavior(
     this IDeploymentContext context,
     Guid sourceSystemId,
     OrphanMappingBehavior behavior)
 {
     ArgumentValidator.EnsureArgumentNotNull(context, nameof(context));
     ArgumentValidator.EnsureArgumentNotEmpty(
         sourceSystemId, nameof(sourceSystemId));
     ValidateOrphanMappingBehavior(behavior);
     context.SourceSystemParameter(
         sourceSystemId,
         OrphanMappingBehaviorParameterName,
         behavior.ToString());
 }
Пример #5
0
 /// <summary>
 /// Sets the garbage collection behavior for the specified destination system.
 /// </summary>
 /// <param name="context">The deployment context.</param>
 /// <param name="destinationSystemId">
 /// The ID of the destination (external) system.
 /// </param>
 /// <param name="behavior">The garbage collection behavior.</param>
 public static void DestinationSystemGarbageCollectionBehavior(
     this IDeploymentContext context,
     Guid destinationSystemId,
     GarbageCollectionBehavior behavior)
 {
     ArgumentValidator.EnsureArgumentNotNull(context, nameof(context));
     ArgumentValidator.EnsureArgumentNotEmpty(
         destinationSystemId, nameof(destinationSystemId));
     ValidateGarbageCollectionBehavior(behavior);
     context.DestinationSystemParameter(
         destinationSystemId,
         GarbageCollectionBehaviorParameterName,
         behavior.ToString());
 }
Пример #6
0
            public ExternalSystem(Guid id, string name)
            {
                // validate parameters
                ArgumentValidator.EnsureArgumentNotEmpty(id, nameof(id));
                ArgumentValidator.EnsureArgumentNotNullOrWhiteSpace(name, nameof(name));
                string trimmedName = name.Trim();

                ArgumentValidator.EnsureArgumentDoesNotExceedMaxLength(
                    trimmedName, MaxNameLength, nameof(name));

                // set property values
                this.Id   = id;
                this.Name = trimmedName;
            }
Пример #7
0
            public Feed(
                Guid entityTypeId,
                Guid sourceSystemId,
                Type feedType)
            {
                // validate parameters
                ArgumentValidator.EnsureArgumentNotEmpty(
                    entityTypeId, nameof(entityTypeId));
                ArgumentValidator.EnsureArgumentNotEmpty(
                    sourceSystemId, nameof(sourceSystemId));
                ArgumentValidator.EnsureArgumentNotNull(feedType, nameof(feedType));

                // set property values
                this.EntityTypeId     = entityTypeId;
                this.SourceSystemId   = sourceSystemId;
                this.FeedTypeFullName = feedType.GetStrippedFullName();
            }
Пример #8
0
            public SharedSourceSystemIdentifierGroup(
                Guid entityTypeId, IEnumerable <Guid> sourceSystemIds)
            {
                // validate parameters
                ArgumentValidator.EnsureArgumentNotEmpty(
                    entityTypeId, nameof(entityTypeId));
                ArgumentValidator.EnsureArgumentNotNull(
                    sourceSystemIds, nameof(sourceSystemIds));
                if (sourceSystemIds.Count() < MinSharedSourceSystemCount)
                {
                    throw new ArgumentException(
                              Resources.TooFewSourceSystemsInGroup, nameof(sourceSystemIds));
                }
                foreach (Guid sourceSystemId in sourceSystemIds)
                {
                    ArgumentValidator.EnsureArgumentNotEmpty(
                        sourceSystemId, nameof(sourceSystemIds));
                }

                // set property values
                this.EntityTypeId    = entityTypeId;
                this.SourceSystemIds = sourceSystemIds;
            }