Exemplo n.º 1
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));
        }