feat: Implement ExistingDatabaseContext for managing existing databases with customizable naming strategies and auto-discovery of entities
feat: Add SqlServerSchemaProvider for extracting database schema information from SQL Server feat: Introduce DatabaseType and NamingStrategy enums for better database management and naming conventions feat: Create IDatabaseDiscovery and IDatabaseManager interfaces for database operations and metadata retrieval feat: Develop REST service client architecture with BaseRestServiceClient and SAP Business One specific implementation feat: Implement REST service discovery page with UI for connecting to SAP Business One Service Layer and displaying discovered entities
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataConnection.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Interfaccia per la gestione di database preesistenti tramite EF Core
|
||||
/// </summary>
|
||||
public interface IDatabaseManager : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifica la connessione al database
|
||||
/// </summary>
|
||||
Task<bool> TestConnectionAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Ottiene entità dal database in base ai criteri specificati
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Tipo di entità</typeparam>
|
||||
/// <param name="filter">Espressione di filtro</param>
|
||||
/// <param name="orderBy">Espressione di ordinamento</param>
|
||||
/// <param name="includeProperties">Proprietà di navigazione da includere</param>
|
||||
/// <param name="skip">Numero di elementi da saltare</param>
|
||||
/// <param name="take">Numero di elementi da prendere</param>
|
||||
Task<IEnumerable<T>> GetAsync<T>(
|
||||
Expression<Func<T, bool>> filter = null,
|
||||
Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
|
||||
string includeProperties = "",
|
||||
int? skip = null,
|
||||
int? take = null) where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Ottiene un'entità singola in base alla chiave primaria
|
||||
/// </summary>
|
||||
Task<T> GetByIdAsync<T>(object id) where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una query SQL raw
|
||||
/// </summary>
|
||||
Task<IEnumerable<T>> ExecuteQueryAsync<T>(string sql, params object[] parameters) where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Esegue un comando SQL che non restituisce risultati
|
||||
/// </summary>
|
||||
Task<int> ExecuteCommandAsync(string sql, params object[] parameters);
|
||||
|
||||
/// <summary>
|
||||
/// Ottiene i metadati delle tabelle nel database
|
||||
/// </summary>
|
||||
Task<IDictionary<string, IEnumerable<DbColumnInfo>>> GetDatabaseSchemaAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Informazioni su una colonna del database
|
||||
/// </summary>
|
||||
public class DbColumnInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string DataType { get; set; }
|
||||
public bool IsNullable { get; set; }
|
||||
public bool IsPrimaryKey { get; set; }
|
||||
public bool IsForeignKey { get; set; }
|
||||
public string ReferencedTable { get; set; }
|
||||
public string ReferencedColumn { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user