コード例 #1
0
        public async Task UpsertAsync(IAssetSettings settings)
        {
            var entity = Mapper.Map <AssetSettingsEntity>(settings);

            entity.PartitionKey = GetPartitionKey();
            entity.RowKey       = GetRowKey(settings.Asset);

            await _assetSettingsTable.InsertOrReplaceAsync(entity);
        }
コード例 #2
0
        public JsAsset(IAssetSettings settings, string src, bool defer = false)
            : base(settings, _tagName, src, true)
        {
            _attributes = new Dictionary <string, string>
            {
                { "type", "text/javascript" }
            };

            if (defer)
            {
                _attributes.Add("defer", "defer");
            }
        }
コード例 #3
0
 public static void PropertiesAreEqual(this Assert assert, IAssetSettings expected, AssetSettings actual)
 {
     Assert.AreEqual(expected.Asset, actual.Asset);
     Assert.AreEqual(expected.CashinCoef, actual.CashinCoef);
     Assert.AreEqual(expected.ChangeWallet, actual.ChangeWallet);
     Assert.AreEqual(expected.Dust, actual.Dust);
     Assert.AreEqual(expected.HotWallet, actual.HotWallet);
     Assert.AreEqual(expected.MaxBalance, actual.MaxBalance);
     Assert.AreEqual(expected.MaxOutputsCount, actual.MaxOutputsCount);
     Assert.AreEqual(expected.MaxOutputsCountInTx, actual.MaxOutputsCountInTx);
     Assert.AreEqual(expected.MinBalance, actual.MinBalance);
     Assert.AreEqual(expected.MinOutputsCount, actual.MinOutputsCount);
     Assert.AreEqual(expected.OutputSize, actual.OutputSize);
     Assert.AreEqual(expected.PrivateIncrement, actual.PrivateIncrement);
 }
コード例 #4
0
        public AssetBase(IAssetSettings configuration, string tagName, string path, bool hasClosingTag, IDictionary <string, string> attributes = null)
        {
            if (string.IsNullOrWhiteSpace(tagName))
            {
                throw new ArgumentNullException(nameof(tagName));
            }

            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentNullException(nameof(path));
            }

            _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
            TagName        = tagName;
            Path           = path;
            HasClosingTag  = hasClosingTag;
            Attributes     = attributes ?? new Dictionary <string, string>(0);
        }
コード例 #5
0
 public CssAsset(IAssetSettings settings, string href)
     : base(settings, _tagName, href, false, new Dictionary <string, string>(_defaultAttributes))
 {
 }
コード例 #6
0
 public async Task UpdateAsync(IAssetSettings settings)
 {
     await _assetSettingsRepository.UpsertAsync(settings);
 }
コード例 #7
0
        public async Task <IAssetSettings> AddAsync(IAssetSettings settings)
        {
            await _assetSettingsRepository.UpsertAsync(settings);

            return(settings);
        }