/// <summary> /// Gets a product from store based on id <paramref name="id"/> /// </summary> /// <param name="id">Id of the product</param> /// <returns><see cref="IProduct"/></returns> public IProduct GetProduct(Guid id) { var prod = _prodRepo.GetNewProduct(); var result = _dbHandler.Execute <Guid, IResultSet <IProduct> >("Product", id) as IResultSet <IProduct>; return(result.Items.Count == 0 ? prod : result.Items[0]); }
public override IDbResult GetResult() { var prodResult = _prodRepo.GetProdResult<IProduct>(Status.Success); while (_result.Read()) { var prod = _prodRepo.GetNewProduct(); _dbHelper.PopulateProduct(_result, prod); prodResult.Items.Add(prod); } return (T)prodResult; }