IConnectionsService.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Microsoft.AspNetCore.Http;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace FastReport.Web.Services
  6. {
  7. /// <summary>
  8. /// Interface for working with connections. Allows to get connection string properties, connected tables, connection types and create a connection string.
  9. /// </summary>
  10. /// <remarks>
  11. /// The interface may change over time
  12. /// </remarks>
  13. public interface IConnectionsService
  14. {
  15. /// <summary>
  16. /// Returns JSON string of connection string properties.
  17. /// </summary>
  18. /// <param name="isError">Out variable, which helps to determine if an error is returned</param>
  19. /// <returns>Returns JSON string with connection string properties. If an error is detected, it returns the error text.</returns>
  20. string GetConnectionStringPropertiesJSON(string connectionType, string connectionString, out bool isError);
  21. /// <summary>
  22. /// Create connection string and returns json with this connection string
  23. /// </summary>
  24. /// <param name="isError">Out variable, which helps to determine if an error is returned</param>
  25. /// <returns>Returns JSON with сonnection string. If an error is detected, it returns the error text.</returns>
  26. string CreateConnectionStringJSON(string connectionType, IFormCollection form, out bool isError);
  27. /// <summary>
  28. /// Returns the list of connected tables by connection type and connection string
  29. /// </summary>
  30. /// <param name="isError">Returns a bool variable which means whether the error is returned or not</param>
  31. /// <returns>Returns JSON with connected tables</returns>
  32. string GetConnectionTables(string connectionType, string connectionString, List<CustomViewModel> customConnections);
  33. /// <summary>
  34. /// Returns the list of connection types
  35. /// </summary>
  36. List<string> GetConnectionTypes(bool needSqlSupportInfo = false);
  37. }
  38. }