public string[] AutocompleteSearchProductMetal(string term) { if (term == null) { return(null); } List <ProductMetal> productMetals = _productMetalBusinessLogic.GetByStr(term); List <string> array = new List <string>(); foreach (var item in productMetals) { array.Add(item.Name); } return(array.ToArray()); }
public int?Resolve(ProductView source, Product destination, int?destMember, ResolutionContext context) { try { var item = _productMetalBusinessLogic.GetByStr(source.ProductMetalName).FirstOrDefault(); if (item == null) { return(null); } return(item.Id); } catch (Exception e) { Console.WriteLine(e); throw; } }