Пример #1
0
        private List <ViewModels.Home.CalculateResultDetail> Calculate(StorageRedundancy redundancy, StorageTemperature temperature, ViewModels.Home.CalculateArgs args)
        {
            var results             = new List <ViewModels.Home.CalculateResultDetail>();
            var atRestPrices        = AtRestPrice.GetDefault();
            var otherPrices         = OtherPrice.GetDefault();
            var mainTransactionRate = otherPrices.FirstOrDefault(x => x.StorageRedundancy == redundancy &&
                                                                 x.StorageTemperature == temperature &&
                                                                 x.PriceType == OtherPriceType.BlobBlockPutListCreateContainer);
            var otherTransactionRate = otherPrices.FirstOrDefault(x => x.StorageRedundancy == redundancy &&
                                                                  x.StorageTemperature == temperature &&
                                                                  x.PriceType == OtherPriceType.BlobBlockOther);
            var retreivedRate = otherPrices.FirstOrDefault(x => x.StorageRedundancy == redundancy &&
                                                           x.StorageTemperature == temperature &&
                                                           x.PriceType == OtherPriceType.DataRetrieval);
            var writeRate = otherPrices.FirstOrDefault(x => x.StorageRedundancy == redundancy &&
                                                       x.StorageTemperature == temperature &&
                                                       x.PriceType == OtherPriceType.DataWrite);
            var replicationRate = otherPrices.FirstOrDefault(x => x.StorageRedundancy == redundancy &&
                                                             x.StorageTemperature == temperature &&
                                                             x.PriceType == OtherPriceType.GeoReplication);

            for (int i = 0; i <= args.MonthsToProject; i++)
            {
                results.Add(Calculate(redundancy, temperature, args, i, atRestPrices, mainTransactionRate, otherTransactionRate, retreivedRate, writeRate, replicationRate));
            }

            return(results);
        }
Пример #2
0
        public ActionResult Index()
        {
            var vm = new ViewModels.Home.Index();

            vm.AtRestPrices = AtRestPrice.GetDefault();
            vm.OtherPrices  = OtherPrice.GetDefault();
            return(View(vm));
        }