public IEnumerable<Supplier> getSupplier(IEnumerable<SupplierModel> data) { var list = new List<Supplier>(); if (data.Count() > 0) { foreach (var model in data) { var supplier = new Supplier(); if (model != null) { supplier.Address = model.Address; supplier.City = model.City; supplier.Country = model.Country; supplier.Phone = model.Phone; supplier.PostalCode = model.PostalCode; supplier.Products = getProduct(model.Products); supplier.Region = model.Region; supplier.SupplierId = model.SupplierId; supplier.SupplierName = model.SupplierName; supplier.SupplierTitle = model.SupplierTitle; } list.Add(supplier); } } return list.AsEnumerable(); }
public Supplier getSupplier(SupplierModel model) { var supplier = new Supplier(); if (model != null) { supplier.Address = model.Address; supplier.City = model.City; supplier.Country = model.Country; supplier.Phone = model.Phone; supplier.PostalCode = model.PostalCode; supplier.Products = getProduct(model.Products); supplier.Region = model.Region; supplier.SupplierId = model.SupplierId; supplier.SupplierName = model.SupplierName; supplier.SupplierTitle = model.SupplierTitle; } return supplier; }