public Product Insert(Product product, SqlConnection con = null, SqlTransaction trans = null) { IProductDal IproductDal = new ProductDal(); ProductDto productNameDto = new ProductDto { ProductAttribute = "Name", ProductDetails = product.Name, ProductId = IproductDal.GetHighestProductId() + 1, IsActive = true }; IproductDal.Insert(productNameDto); ProductDto productPriceDto = new ProductDto { ProductAttribute = "Price", ProductDetails = product.Price.ToString(), ProductId = productNameDto.ProductId, IsActive = true }; IproductDal.Insert(productPriceDto); return(product); }