Esempio n. 1
0
 /// <summary>
 ///     Returns items matching given search parameters
 ///     and optionally, the itemType
 /// </summary>
 /// <param name="productId"></param>
 /// <param name="name"></param>
 /// <param name="productType"></param>
 /// <returns></returns>
 public IEnumerable <Item> GetItems(uint?productId = null, string name = null, ProductType?productType = null)
 {
     if (productType == ProductType.Service)
     {
         throw new NotSupportedException("ProductType 'Service' is not applicable here");
     }
     using (var connection = Connector.GetConnection())
     {
         var itemDal = new ItemDal(connection);
         return(itemDal.Search(productId, name == null ? null : $"%{name}%", productType));
     }
 }