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