Exemplo n.º 1
0
        protected BasketRegionModel SerializeBasketRegion(Core.ManagingBpt.BasketRegionModel model, CalculationTicket ticket)
        {
            var result = new BasketRegionModel(
                this.serializer.SerializeEditableExpression(model.Base),
                this.serializer.SerializeNullableExpression(model.BaseActive, ticket),
                this.serializer.SerializeRegionBasket(model.Basket),
                this.serializer.SerializeExpression(model.Benchmark, ticket),
                this.SerializeCountries(model.Countries, ticket),
                this.serializer.SerializeExpression(model.Overlay, ticket),
                this.serializer.SerializeEditableExpression(model.PortfolioAdjustment),
                this.serializer.SerializeNullableExpression(model.PortfolioScaled, ticket),
                this.serializer.SerializeNullableExpression(model.TrueActive, ticket),
                this.serializer.SerializeNullableExpression(model.TrueExposure, ticket)
                );

            return(result);
        }
Exemplo n.º 2
0
        protected Core.ManagingBpt.BasketRegionModel DeserializeBasketRegion(BasketRegionModel model, Core.ManagingBpt.Computations computations)
        {
            var basket = this.deserializer.DeserializeRegionBasket(model.Basket);

            var baseExpression = this.modelBuilder.CreateBaseExpression();

            this.deserializer.PopulateEditableExpression(baseExpression, model.Base);

            var portfolioAdjustmentExpression = this.modelBuilder.CreatePortfolioAdjustmentExpression();

            this.deserializer.PopulateEditableExpression(portfolioAdjustmentExpression, model.PortfolioAdjustment);

            var countries = model.Countries.Select(x => this.DeserializeCountry(x)).ToArray();
            var result    = this.modelBuilder.CreateBasketRegionModel(
                basket,
                countries,
                computations,
                baseExpression,
                portfolioAdjustmentExpression
                );

            return(result);
        }
Exemplo n.º 3
0
 public void Resolve(BasketRegionModel model)
 {
     this.Result = this.deserializer.DeserializeBasketRegion(model, this.computations);
 }