Beispiel #1
0
        public void insertProduct()
        {
            ProductRepository productRepository = new ProductRepository();

            Product product = new Product()
                                  {
                                      Hidden = false,
                                      ProductName = "my name",
                                      ProductKey = "key",
                                  };

            productRepository.SaveEntity(product);
        }
Beispiel #2
0
 private Product FindProduct(string serviceToken)
 {
     ProductRepository productRepository = new ProductRepository();
     Product product = productRepository.FindByProductKey(serviceToken);
     if (product == null)
     {
         product = new Product()
         {
             Hidden = false,
             ProductKey = serviceToken,
             ProductName = serviceToken,
         };
         product = productRepository.SaveEntity(product);
     }
     return product;
 }