public static ProductYad2Collection GetAllProductByAppUserId(Int64 AppUserId) { Query qry = new Query(ProductYad2.TableSchema); qry.Where(ProductYad2.Columns.AppUserId, AppUserId); qry.OrderBy(ProductYad2.Columns.UpdateDate, SortDirection.DESC); ProductYad2Collection pcol = ProductYad2Collection.FetchByQuery(qry); return(pcol); }
public static List <ProductYad2UI> GetAllProduct() { Query qry = new Query(ProductYad2.TableSchema); qry.Where(ProductYad2.Columns.Status, StatusType.Approved); qry.AddWhere(ProductYad2.TableSchema.SchemaName, ProductYad2.Columns.UpdateDate, WhereComparision.GreaterThanOrEqual, DateTime.UtcNow.AddDays(-(Convert.ToDouble(Settings.GetSetting(Settings.Keys.YAD_2_EXPIRY_DAY))))); qry.OrderBy(ProductYad2.Columns.UpdateDate, SortDirection.DESC); ProductYad2Collection pcol = ProductYad2Collection.FetchByQuery(qry); List <ProductYad2UI> LstProductYad2UI = new List <ProductYad2UI>(); foreach (ProductYad2 item in pcol) { LstProductYad2UI.Add(new ProductYad2UI(item, GetAllCatagoriesOfProduct(item._ProductId))); } return(LstProductYad2UI); }