Exemplo n.º 1
0
        public Product GetProductById(int id)
        {
            using (StoreDBcontext context = new StoreDBcontext())
            {
                ProductEntity product = context.Products.AsNoTracking()
                                        .Where(e => e.ProductId == id).FirstOrDefault();

                return((product == null) ? null : product.ConvertToApplicationModel());
            }
        }