public ProductModel ToModel(Product product) { if (product == null) { return(null); } ProductModel productModel = new ProductModel(); productModel.CompanyID = product.companyid; productModel.Cost = product.cost; productModel.DateCreated = product.datecreated; productModel.Description = product.description; productModel.EndDate = product.enddate; productModel.ID = product.id; productModel.Reference = product.reference; productModel.Title = product.title; productModel.UserID = product.userid; productModel.Bids = product.bids != null?bidMapper.ToModelList(product.bids) : null; productModel.ProductUpdates = product.productupdates != null?notificationMapper.ToModelList(product.productupdates) : null; return(productModel); }
public List <NotificationModel> GetNotificationsForUser(Guid userID) { return(notificationsMapper.ToModelList(notificationsRepository.GetNotificationsForUser(userID))); }