Exemple #1
0
        public StockModel(IStockAdapter adapter) : this()
        {
            Id        = adapter.Id;
            Name      = adapter.Name;
            Resources = new List <ResourceModel>();

            if (adapter.ResourceAdapters != null)
            {
                foreach (var item in adapter.ResourceAdapters)
                {
                    Resources.Add(new ResourceModel(item));
                }
            }
        }
Exemple #2
0
        public void Update(IStockAdapter item)
        {
            Stock stock = new Stock(item);

            _db.Entry(stock).State = EntityState.Modified;
        }
Exemple #3
0
        public void Create(IStockAdapter item)
        {
            Stock stock = new Stock(item);

            _db.Stocks.Add(stock);
        }
 public StockEndpoint(IStockAdapter stockAdapter)
 {
     _stockAdapter = stockAdapter;
 }