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)); } } }
public void Update(IStockAdapter item) { Stock stock = new Stock(item); _db.Entry(stock).State = EntityState.Modified; }
public void Create(IStockAdapter item) { Stock stock = new Stock(item); _db.Stocks.Add(stock); }
public StockEndpoint(IStockAdapter stockAdapter) { _stockAdapter = stockAdapter; }