public int AddGalardon(GalardonProductInput input) { if (input.ProductId == null) { throw new UserFriendlyException("Producto no definido"); } var galardon = ProductCertification.Create(input.Id, input.ProductId); return(_productManager.AddGalardon(galardon)); }
public void AddCertificationToProduct(Guid productId, int id) { var coincidence = _productCertificationRepository.GetAllList(a => a.CertId == id && a.ProductId == productId); if (coincidence.Any()) { return; } var relation = ProductCertification.Create(id, productId); _productCertificationRepository.InsertOrUpdateAndGetId(relation); }