public void InsertAssetsDb(IList <Asset> listAssets, Guid userId, string company) { int count = 0; Cellar cellar = _cellarManager.GetAllCellars(company).FirstOrDefault(); foreach (Asset asset in listAssets) { if (count < 500) { _assetManager.Create(asset); if (asset.Price < 1) { asset.Price = 1; } Stock stock = Stock.Create(cellar.Id, asset.Id, 1, asset.Price, userId, asset.CreationTime, company); _stockManager.Create(stock); } count++; } }
public IList <Cellar> GetAllCellar(string company) { return(_cellarManager.GetAllCellars(company)); }