Пример #1
0
        public Fund AddOrUpdate(Fund fund)
        {
            addOrUpdate(fund);

            SaveFunds(_funds);

            return fund;
        }
Пример #2
0
 private Fund addOrUpdate(Fund fund)
 {
     var oldFund = _funds.FirstOrDefault(f => f.ExchangeBloombergCode == fund.ExchangeBloombergCode);
     if (oldFund == null)
     {
         _funds.Add(fund);
         return fund;
     }
     else
     {
         oldFund.FundISIN = fund.FundISIN;
         oldFund.FundName = fund.FundName;
         oldFund.FundBrand = fund.FundBrand;
         oldFund.FundType = fund.FundType;
         oldFund.FundMarket = fund.FundMarket;
         oldFund.FundAssetClass = fund.FundAssetClass;
         oldFund.FundAssetSubClass = fund.FundAssetSubClass;
         oldFund.FundAssetSubClass2 = fund.FundAssetSubClass2;
         oldFund.FundAssetClassGeoFocus = fund.FundAssetClassGeoFocus;
         oldFund.FundAssetSubClassCategory = fund.FundAssetSubClassCategory;
         oldFund.FundAssetSubClassCategory2 = fund.FundAssetSubClassCategory2;
         oldFund.FundUrl = fund.FundUrl;
         oldFund.FundInceptionDate = fund.FundInceptionDate;
         oldFund.FundReplicationType = fund.FundReplicationType;
         oldFund.FundDomicile = fund.FundDomicile;
         oldFund.FundTER = fund.FundTER;
         oldFund.FundCurrency = fund.FundCurrency;
         oldFund.FundSecurityLending = fund.FundSecurityLending;
         oldFund.FundIncomeTreatment = fund.FundIncomeTreatment;
         oldFund.FundUCITS = fund.FundUCITS;
         oldFund.FundCurrencyhedgedIndicator = fund.FundCurrencyhedgedIndicator;
         oldFund.FundDistributionCountries = fund.FundDistributionCountries;
         oldFund.FundRiskKIID = fund.FundRiskKIID;
         oldFund.FundManager = fund.FundManager;
         oldFund.FundAdministrator = fund.FundAdministrator;
         oldFund.FundCustodian = fund.FundCustodian;
         oldFund.FundAudit = fund.FundAudit;
         oldFund.BenchmarkName = fund.BenchmarkName;
         oldFund.BenchmarkProvider = fund.BenchmarkProvider;
         oldFund.BenchmarkDescription = fund.BenchmarkDescription;
         oldFund.BenchmarkCurrency = fund.BenchmarkCurrency;
         oldFund.BenchmarkCategory = fund.BenchmarkCategory;
         oldFund.BenchmarkWeighting = fund.BenchmarkWeighting;
         oldFund.BenchmarkWebsite = fund.BenchmarkWebsite;
         oldFund.BenchmarkISIN = fund.BenchmarkISIN;
         oldFund.BenchmarkRIC = fund.BenchmarkRIC;
         oldFund.BenchmarkBloomberg = fund.BenchmarkBloomberg;
         oldFund.BenchmarkType = fund.BenchmarkType;
         oldFund.ExchangeName = fund.ExchangeName;
         oldFund.ExchangeTicker = fund.ExchangeTicker;
         oldFund.ExchangeTradingCurrency = fund.ExchangeTradingCurrency;
         oldFund.ExchangeBloombergCode = fund.ExchangeBloombergCode;
         oldFund.ExchangeReutersCode = fund.ExchangeReutersCode;
         return oldFund;
     }
 }
Пример #3
0
        private bool MeetCriteria(Fund fund, SearchCriteria searchCriteria)
        {
            foreach (var filter in searchCriteria.Filters.Where(f=>f.Value.Any()))
            {
                var propertyInfo = _fundPropertyInfos.Single(f=>f.Name == filter.Key);
                if (!filter.Value.Contains(propertyInfo.GetValue(fund)?.ToString()))
                    return false;
            }

            return true;
        }
Пример #4
0
        public Fund Convert() {
            Fund fund = new Fund();

            //fund.ISIN = GetProperty("	ISIN	");
            //fund.Sedol = GetProperty("	Sedol	");
            //fund.Name = GetProperty("Product");
            //fund.Company = GetProperty("	Issuer	");
            //fund.InceptionDate = GetProperty(nameof(fund.InceptionDate));
            //fund.ReplicationType = GetProperty(nameof(fund.ReplicationType));
            //fund.Legislation = GetProperty(nameof(fund.Legislation));
            //fund.TER = GetProperty(nameof(fund.TER));
            //fund.FundCurrency = GetProperty("	Currency (base)	");
            //fund.SecurityLending = GetProperty(nameof(fund.SecurityLending));
            //fund.Distribution = GetProperty("	Dividends	");
            ////fund.DistributionFrequency = GetProperty("		");
            //fund.UCITS = GetProperty(nameof(fund.UCITS));
            //fund.DistributionCountries = GetProperty("	Registered countries	");
            //fund.Administrator = GetProperty("	Registrar	");
            //fund.Custodian = GetProperty("	Trustee	");
            ////fund.Audit = GetProperty("		");
            //fund.CurrencyhedgedIndicator = GetProperty("	Currency hedged	");
            //fund.RiskKIID = GetProperty("	KIID classification 	");
            //fund.BenchmarkName = GetProperty(nameof(fund.BenchmarkName));
            //fund.BenchmarkDescription = GetProperty(nameof(fund.BenchmarkDescription));
            //fund.BenchmarkWebsite = GetProperty("	Website	");
            //fund.BenchmarkBloombergCode = GetProperty(nameof(fund.BenchmarkBloombergCode));
            //fund.BenchmarkProvider = GetProperty(nameof(fund.BenchmarkProvider));
            //fund.BenchmarkCurrency = GetProperty(nameof(fund.BenchmarkCurrency));
            //fund.AssetClass = GetProperty("	Asset class	");
            //fund.AssetSubClass = GetProperty("	Exposure	");
            //fund.AssetClassGeoFocus = GetProperty(nameof(fund.AssetClassGeoFocus));
            //fund.Category = GetProperty(nameof(fund.Category));
            //fund.Weighting = GetProperty(nameof(fund.Weighting));
            //fund.Exchange = GetProperty("	Exchange	");
            //fund.ExchangeCode = GetProperty(nameof(fund.ExchangeCode));
            //fund.TradingCurrency = GetProperty(nameof(fund.TradingCurrency));
            //fund.BloombergCode = GetProperty("	Bloomberg Code	");
            //fund.FundUrl= GetProperty(nameof(FundUrl));

            //if(string.IsNullOrEmpty(fund.FundUrl))
            //    fund.FundUrl = this.FundUrl;
            //fund.PostData = this.FundPostData;
            return fund;
        }
Пример #5
0
Файл: Fund.cs Проект: igiel/Etf
 public void Update(Fund fund)
 {
     throw new System.NotImplementedException();
 }