Exemplo n.º 1
0
 public ProductServiceModel(ProductRepositoryModel model)
 {
     this.Id    = model.Id;
     this.MPN   = model.MPN;
     this.Price = model.Price;
     this.Title = model.Title;
 }
Exemplo n.º 2
0
        public async Task <int> CreateAsync(CreateProductRepositoryModel model)
        {
            var id    = _data.Any() ? _data.Max(o => o.Id) + 1 : 1;
            var toAdd = new ProductRepositoryModel
            {
                Id    = id,
                MPN   = model.MPN,
                Title = model.Title,
                Price = model.Price
            };

            _data.Enqueue(toAdd);
            return(await Task.FromResult(id));
        }