SQL maanager, Module Creator, module settings enhancements
This commit is contained in:
34
Oqtane.Client/Services/SqlService.cs
Normal file
34
Oqtane.Client/Services/SqlService.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using Oqtane.Models;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Oqtane.Shared;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public class SqlService : ServiceBase, ISqlService
|
||||
{
|
||||
private readonly HttpClient _http;
|
||||
private readonly SiteState _siteState;
|
||||
private readonly NavigationManager _navigationManager;
|
||||
|
||||
public SqlService(HttpClient http, SiteState siteState, NavigationManager navigationManager)
|
||||
{
|
||||
_http = http;
|
||||
_siteState = siteState;
|
||||
_navigationManager = navigationManager;
|
||||
}
|
||||
|
||||
private string Apiurl
|
||||
{
|
||||
get { return CreateApiUrl(_siteState.Alias, _navigationManager.Uri, "Sql"); }
|
||||
}
|
||||
|
||||
public async Task<SqlQuery> ExecuteQueryAsync(SqlQuery sqlquery)
|
||||
{
|
||||
return await _http.PostJsonAsync<SqlQuery>(Apiurl, sqlquery);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user