var definition = new HarvestDefinition(); definition.Add(new WebHarvestDefinition { Url = "https://example.com", Filters = new List{ new HtmlSelectorFilter("h1"), new HtmlContentFilter(), } });
definition.Add(new DatabaseHarvestDefinition { ConnectionString = "Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;", Query = "SELECT * FROM Customers;", Filters = new ListIn this example, we add a DatabaseHarvestDefinition to the existing HarvestDefinition object. The ConnectionString property specifies the database connection details, and the Query property specifies the SQL query to be executed. The CsvFilter is applied to the extracted data before it is returned. Overall, the Server.Engines.Harvest HarvestDefinition package provides a powerful set of tools for data harvesting and extraction in C# applications.{ new CsvFilter(), } });