Exemplo n.º 1
0
        public static void ValidateRegister(this MarketDataEntity.Input marketDataEntityInput)
        {
            if (marketDataEntityInput.MarketDataId != 0)
            {
                throw new ArgumentException("MarketDataId must be 0");
            }

            if (marketDataEntityInput.Type == MarketDataType.MarketAssessment && marketDataEntityInput.TransformID != null)
            {
                throw new ArgumentException("No transform possible when Type is MarketAssessment");
            }
        }
Exemplo n.º 2
0
        public static void ValidateUpdate(this MarketDataEntity.Input marketDataEntityInput)
        {
            if (marketDataEntityInput.Type == MarketDataType.MarketAssessment && marketDataEntityInput.TransformID != null)
            {
                throw new ArgumentException("No transform possible when Type is MarketAssessment");
            }

            if (marketDataEntityInput.Type == MarketDataType.MarketAssessment && marketDataEntityInput.AggregationRule != AggregationRule.Undefined)
            {
                throw new ArgumentException("Aggregation Rule must be Undefined if Type is MarketAssessment");
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// The MarketData Constructor by MarketDataEntity.Input
 /// </summary>
 public Output(MarketDataEntity.Input input)
 {
     if (input != null)
     {
         this.MarketDataId        = input.MarketDataId;
         this.ETag                = input.ETag;
         this.ProviderName        = input.ProviderName;
         this.MarketDataName      = input.MarketDataName;
         this.OriginalGranularity = input.OriginalGranularity;
         this.Type                = input.Type;
         this.OriginalTimezone    = input.OriginalTimezone;
         this.AggregationRule     = input.AggregationRule;
         this.TransformID         = input.TransformID;
         this.ProviderDescription = input.ProviderDescription;
         this.Tags                = input.Tags;
     }
 }