Compare commits

...

25 Commits

Author SHA1 Message Date
OlgunR
8933deec96 Add dark mode override for non-native DevExpress themes
Implements a dark mode override system for DevExpress Blazor themes lacking native dark support. Adds a JS function to toggle a dx-dark class on <html>, updates ThemeState to detect native dark themes, and applies targeted CSS variable overrides for consistent dark styling. Disables prerendering to ensure JS interop, and improves theme switching logic and documentation.
2026-05-05 16:41:15 +02:00
OlgunR
2010673eba Remove unused menu state and toggle logic from NavMenu
Removed the private menuOpen field and ToggleMenu() method from NavMenu.razor, as they are no longer needed for menu state management.
2026-04-30 15:41:05 +02:00
OlgunR
b75e7d730c Modernize sidebar with DxTreeView and new responsive styles
Refactor NavMenu to use DevExpress DxTreeView for navigation, replacing the old NavLink-based menu. Update sidebar and navigation row styling to use CSS variables, remove Bootstrap-specific and SVG icon CSS, and add a responsive hamburger menu for small screens. Improve dark mode support and overall maintainability.
2026-04-30 15:37:04 +02:00
OlgunR
075433c780 Improve spacing for Dark Mode button in top row
Wrapped the Dark Mode toggle button in a span with left margin
for better separation from the theme combo box. Added a new
.btn-gap CSS class to standardize button spacing in the top row.
2026-04-23 15:59:50 +02:00
OlgunR
35e39ff979 Add theme selection dropdown and refactor theme handling
Introduce a DxComboBox in MainLayout for selecting between multiple themes. Update ThemeState to manage the current theme, provide a list of available themes, and apply the selected theme via a new SetTheme method. Refactor dark mode handling to work with the new theme system, and ensure UI updates on theme or mode changes.
2026-04-23 15:44:26 +02:00
OlgunR
292ce02370 Refactor using statements for clearer layer boundaries
Clean up and reorganize using/import statements across the solution. Remove unnecessary DTO imports from Application and Infrastructure layers, and ensure Contracts DTOs are only referenced in API and BlazorWebApp layers. No business logic is changed; these updates improve code organization, reduce coupling, and clarify architectural separation between layers.
2026-04-23 13:55:05 +02:00
OlgunR
df4de5d5f5 Refactor imports and ensure enum type safety in Catalogs
Reorganize and deduplicate using directives in _Imports.razor for clarity and maintainability. Explicitly cast UpdateProcedure to CatalogUpdateProcedure in CatalogsGrid.razor to enforce type safety. Restore necessary DevExpress and DbFirst namespaces.
2026-04-23 13:54:50 +02:00
OlgunR
e4624c92ef Refactor DTOs: make public, add properties, clean up
Refactored DTO classes by removing unnecessary using statements and internal wrappers, making them public, and adding explicit properties with default values. Clarified namespaces and improved accessibility for use in API contracts or service layers. Added CatalogUpdateProcedure to CatalogWriteDto to specify update operation type.
2026-04-23 11:48:45 +02:00
OlgunR
b0d60461b4 Standardize DTO naming and namespaces for MassData
Refactored DTO class and namespace names from Massdata* to MassData* in DbFirst.Contracts. Updated all relevant application files to use the correct DTO namespaces for Catalogs and MassData. Adjusted _Imports.razor to include new DTO namespaces and removed unused usings. These changes improve code consistency and reduce namespace-related errors.
2026-04-23 11:41:10 +02:00
OlgunR
c45c1a69a7 Remove obsolete DTO classes and add Layouts folder
Deleted DTOs for catalogs, layouts, mass data, and dashboard info from both Application and BlazorWebApp.Models namespaces. Updated DbFirst.Application.csproj to include a new Layouts folder for future organization. No functional code changes in this commit.
2026-04-23 11:25:31 +02:00
OlgunR
b268e53e1f Add project references to Contracts and Domain projects
Added DbFirst.Contracts as a project reference to both DbFirst.Application and DbFirst.BlazorWebApp, and added DbFirst.Domain to DbFirst.Application. Also, a BOM was introduced in the BlazorWebApp project file. These changes enable shared use of contracts and domain types across projects.
2026-04-23 11:23:24 +02:00
OlgunR
a1fee6f5c0 Add initial empty DTO classes for Catalogs, Dashboards, etc.
Introduced six new internal DTO classes: CatalogReadDto, CatalogWriteDto, DashboardInfoDto, LayoutDto, MassdataReadDto, and MassdataWriteDto. Each class resides in its appropriate namespace and currently contains no properties or methods, serving as placeholders for future data transfer logic.
2026-04-23 11:22:58 +02:00
OlgunR
dbb39354ab Add DbFirst.Contracts project to solution
Added new DbFirst.Contracts project targeting .NET 8.0 with nullable and implicit usings enabled. Included a project reference to DbFirst.Domain and updated the solution file to register the new project with all build configurations.
2026-04-23 11:15:53 +02:00
OlgunR
2ffa389978 Update AutoMapper to 16.1.1 and adjust registration
Upgraded AutoMapper to version 16.1.1 across API, Application, and Infrastructure projects. Removed AutoMapper.Extensions.Microsoft.DependencyInjection where no longer needed. Updated AutoMapper registration in DependencyInjection.cs to use the new API. No other changes made.
2026-04-22 09:35:50 +02:00
OlgunR
f54de87ca2 Standardize string property initialization to string.Empty
Replaced String.Empty and null! with string.Empty for string properties
in CatalogReadDto, CatalogWriteDto, and VwmyCatalog classes. This
ensures consistent initialization and helps prevent null reference
issues across the codebase.
2026-04-22 09:25:03 +02:00
OlgunR
1b4205219f Set string defaults to String.Empty in CatalogReadDto
Changed default values of CatTitle, CatString, and AddedWho from null! to String.Empty to prevent potential null reference issues.
2026-04-21 17:01:44 +02:00
OlgunR
b35c167648 Add [FromBody] to DTO params in controller actions
Explicitly annotate DTO parameters with [FromBody] in CatalogsController (Create, Update) and MassDataController (Upsert) to ensure correct model binding from the request body and improve API clarity.
2026-04-21 15:22:33 +02:00
OlgunR
087708dcf7 Use array literal [] for empty CORS origins default
Replaces Array.Empty<string>() with the C# array literal [] when defaulting the CORS allowed origins array. This is a syntactic improvement with no change in behavior.
2026-04-21 15:22:19 +02:00
OlgunR
be40c39f47 Initialize VwmyCatalog string properties with String.Empty
Changed default values of CatTitle, CatString, and AddedWho from null! to String.Empty to prevent potential null reference issues and ensure safer property initialization.
2026-04-21 13:43:33 +02:00
OlgunR
4fa3bcae3d Make dashboard change notifications async and robust
Refactored DashboardChangeNotifier and IDashboardChangeNotifier to use async notification with improved error handling and logging. Updated SqlDashboardStorage to call the new async notification method after dashboard changes, ensuring non-blocking and reliable client updates.
2026-04-21 13:42:31 +02:00
OlgunR
612d8371d3 Improve exception handling with ProblemDetails responses
ExceptionHandlingMiddleware now returns structured ProblemDetails
responses for errors, including specific handling for
InvalidOperationException (400 Bad Request) and general exceptions
(500 Internal Server Error). Responses use "application/problem+json"
content type and include trace IDs. ProblemDetails support is also
registered in Program.cs.
2026-04-21 13:18:59 +02:00
OlgunR
b7e66ab5f9 Update MediatR and DI packages; refactor registration
Upgraded to MediatR 14.1.0 and updated registration to use the new syntax. Removed MediatR.Extensions.Microsoft.DependencyInjection where no longer needed. Bumped Microsoft.Extensions.DependencyInjection.Abstractions to 10.0.0 in Application and Infrastructure projects.
2026-04-21 12:01:23 +02:00
OlgunR
95a388015a Remove GetAllAsync method from MassDataRepository
The GetAllAsync method, which returned all Massdata records, has been removed from the MassDataRepository class. No other changes were made in this commit.
2026-04-21 10:30:10 +02:00
OlgunR
c16f0483c3 Remove unused using directives from API and client files
Cleaned up unnecessary System.Net and System.Net.Http.Json usings across multiple files, including controllers and API client classes, to reduce dependencies and improve code clarity.
2026-04-21 10:16:05 +02:00
OlgunR
83292f23f3 Refactor dashboard config to factory class
Move DashboardConfigurator setup from Program.cs to a new static DashboardConfiguratorFactory. This centralizes dashboard file creation, data source registration, and storage logic, improving code organization and maintainability. Unused usings are cleaned up accordingly.
2026-04-21 10:09:50 +02:00
70 changed files with 552 additions and 411 deletions

View File

@@ -1,7 +1,7 @@
using DbFirst.Application.Catalogs;
using DbFirst.Application.Catalogs.Commands; using DbFirst.Application.Catalogs.Commands;
using DbFirst.Application.Catalogs.Queries; using DbFirst.Application.Catalogs.Queries;
using DbFirst.Domain; using DbFirst.Contracts.Catalogs;
using MediatR; using MediatR;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@@ -37,7 +37,7 @@ public class CatalogsController : ControllerBase
} }
[HttpPost] [HttpPost]
public async Task<ActionResult<CatalogReadDto>> Create(CatalogWriteDto dto, CancellationToken cancellationToken) public async Task<ActionResult<CatalogReadDto>> Create([FromBody]CatalogWriteDto dto, CancellationToken cancellationToken)
{ {
var created = await _mediator.Send(new CreateCatalogCommand(dto), cancellationToken); var created = await _mediator.Send(new CreateCatalogCommand(dto), cancellationToken);
if (created == null) if (created == null)
@@ -48,7 +48,7 @@ public class CatalogsController : ControllerBase
} }
[HttpPut("{id:int}")] [HttpPut("{id:int}")]
public async Task<ActionResult<CatalogReadDto>> Update(int id, CatalogWriteDto dto, CancellationToken cancellationToken) public async Task<ActionResult<CatalogReadDto>> Update(int id, [FromBody] CatalogWriteDto dto, CancellationToken cancellationToken)
{ {
var updated = await _mediator.Send(new UpdateCatalogCommand(id, dto), cancellationToken); var updated = await _mediator.Send(new UpdateCatalogCommand(id, dto), cancellationToken);
if (updated == null) if (updated == null)

View File

@@ -1,8 +1,8 @@
using System.Text;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Contracts.Layouts;
using DbFirst.Domain.Entities; using DbFirst.Domain.Entities;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using DbFirst.Application.Layouts; using System.Text;
namespace DbFirst.API.Controllers; namespace DbFirst.API.Controllers;

View File

@@ -1,6 +1,6 @@
using DbFirst.Application.MassData;
using DbFirst.Application.MassData.Commands; using DbFirst.Application.MassData.Commands;
using DbFirst.Application.MassData.Queries; using DbFirst.Application.MassData.Queries;
using DbFirst.Contracts.MassData;
using MediatR; using MediatR;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@@ -50,7 +50,7 @@ public class MassDataController : ControllerBase
} }
[HttpPost("upsert")] [HttpPost("upsert")]
public async Task<ActionResult<MassDataReadDto>> Upsert(MassDataWriteDto dto, CancellationToken cancellationToken) public async Task<ActionResult<MassDataReadDto>> Upsert([FromBody]MassDataWriteDto dto, CancellationToken cancellationToken)
{ {
var result = await _mediator.Send(new UpsertMassDataByCustomerNameCommand(dto), cancellationToken); var result = await _mediator.Send(new UpsertMassDataByCustomerNameCommand(dto), cancellationToken);
return Ok(result); return Ok(result);

View File

@@ -6,14 +6,23 @@ namespace DbFirst.API.Dashboards;
public class DashboardChangeNotifier : IDashboardChangeNotifier public class DashboardChangeNotifier : IDashboardChangeNotifier
{ {
private readonly IHubContext<DashboardsHub> _hubContext; private readonly IHubContext<DashboardsHub> _hubContext;
private readonly ILogger<DashboardChangeNotifier> _logger;
public DashboardChangeNotifier(IHubContext<DashboardsHub> hubContext) public DashboardChangeNotifier(IHubContext<DashboardsHub> hubContext, ILogger<DashboardChangeNotifier> logger)
{ {
_hubContext = hubContext; _hubContext = hubContext;
_logger = logger;
} }
public void NotifyChanged() public async Task NotifyChangedAsync()
{ {
_ = _hubContext.Clients.All.SendAsync("DashboardsChanged"); try
{
await _hubContext.Clients.All.SendAsync("DashboardsChanged");
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to notify dashboard clients.");
}
} }
} }

View File

@@ -0,0 +1,115 @@
using DbFirst.Domain.Entities;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using DevExpress.DataAccess.Json;
using System.Xml.Linq;
namespace DbFirst.API.Dashboards;
public static class DashboardConfiguratorFactory
{
public static DashboardConfigurator Create(
IServiceProvider serviceProvider,
IConfiguration configuration,
IWebHostEnvironment environment)
{
// Den gesamten Inhalt des Lambdas hierher verschieben
// serviceProvider, configuration, environment statt builder.* verwenden
var dashboardsPath = Path.Combine(environment.ContentRootPath, "Data", "Dashboards");
Directory.CreateDirectory(dashboardsPath);
var defaultDashboardPath = Path.Combine(dashboardsPath, "DefaultDashboard.xml");
if (!File.Exists(defaultDashboardPath))
{
var defaultDashboard = new Dashboard();
defaultDashboard.Title.Text = "Default Dashboard";
defaultDashboard.SaveToXml(defaultDashboardPath);
}
var dashboardBaseUrl = configuration["Dashboard:BaseUrl"]
?? configuration["ApiBaseUrl"]
?? configuration["ASPNETCORE_URLS"]?.Split(';', StringSplitOptions.RemoveEmptyEntries).FirstOrDefault()
?? "https://localhost:7204";
dashboardBaseUrl = dashboardBaseUrl.TrimEnd('/');
var catalogsGridDashboardPath = Path.Combine(dashboardsPath, "CatalogsGrid.xml");
if (!File.Exists(catalogsGridDashboardPath))
{
var dashboard = new Dashboard();
dashboard.Title.Text = "Catalogs (Dashboard Grid)";
var catalogDataSource = new DashboardJsonDataSource("Catalogs (API)")
{
ComponentName = "catalogsDataSource",
JsonSource = new UriJsonSource(new Uri($"{dashboardBaseUrl}/api/catalogs"))
};
dashboard.DataSources.Add(catalogDataSource);
var grid = new GridDashboardItem
{
DataSource = catalogDataSource,
Name = "Catalogs"
};
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.Guid))) { Name = "Id" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.CatTitle))) { Name = "Titel" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.CatString))) { Name = "String" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.AddedWho))) { Name = "Angelegt von" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.AddedWhen))) { Name = "Angelegt am" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.ChangedWho))) { Name = "Geändert von" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.ChangedWhen))) { Name = "Geändert am" });
dashboard.Items.Add(grid);
var layoutGroup = new DashboardLayoutGroup { Orientation = DashboardLayoutGroupOrientation.Vertical };
layoutGroup.ChildNodes.Add(new DashboardLayoutItem(grid));
dashboard.LayoutRoot = layoutGroup;
dashboard.SaveToXml(catalogsGridDashboardPath);
}
DashboardConfigurator configurator = new DashboardConfigurator();
var connectionString = configuration.GetConnectionString("DefaultConnection") ?? string.Empty;
var notifier = serviceProvider.GetRequiredService<IDashboardChangeNotifier>();
var dashboardStorage = new SqlDashboardStorage(connectionString, "TBDD_SMF_CONFIG", notifier: notifier);
configurator.SetDashboardStorage(dashboardStorage);
DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
DashboardJsonDataSource jsonDataSourceUrl = new DashboardJsonDataSource("JSON Data Source (URL)");
jsonDataSourceUrl.JsonSource = new UriJsonSource(
new Uri("https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json"));
jsonDataSourceUrl.RootElement = "Customers";
dataSourceStorage.RegisterDataSource("jsonDataSourceUrl", jsonDataSourceUrl.SaveToXml());
var catalogsJsonDataSource = new DashboardJsonDataSource("Catalogs (API)")
{
ComponentName = "catalogsDataSource",
JsonSource = new UriJsonSource(new Uri($"{dashboardBaseUrl}/api/catalogs"))
};
dataSourceStorage.RegisterDataSource(catalogsJsonDataSource.ComponentName, catalogsJsonDataSource.SaveToXml());
dataSourceStorage.RegisterDataSource(catalogsJsonDataSource.Name, catalogsJsonDataSource.SaveToXml());
configurator.SetDataSourceStorage(dataSourceStorage);
EnsureDashboardInStorage(dashboardStorage, "DefaultDashboard", defaultDashboardPath);
EnsureDashboardInStorage(dashboardStorage, "CatalogsGrid", catalogsGridDashboardPath);
return configurator;
}
private static void EnsureDashboardInStorage(IEditableDashboardStorage storage, string id, string filePath)
{
var exists = storage.GetAvailableDashboardsInfo().Any(info => string.Equals(info.ID, id, StringComparison.OrdinalIgnoreCase));
if (exists || !File.Exists(filePath))
{
return;
}
var doc = XDocument.Load(filePath);
storage.AddDashboard(doc, id);
}
}

View File

@@ -2,5 +2,5 @@ namespace DbFirst.API.Dashboards;
public interface IDashboardChangeNotifier public interface IDashboardChangeNotifier
{ {
void NotifyChanged(); Task NotifyChangedAsync();
} }

View File

@@ -1,8 +1,8 @@
using DevExpress.DashboardWeb;
using Microsoft.Data.SqlClient;
using System.Data; using System.Data;
using System.Text; using System.Text;
using System.Xml.Linq; using System.Xml.Linq;
using DevExpress.DashboardWeb;
using Microsoft.Data.SqlClient;
namespace DbFirst.API.Dashboards; namespace DbFirst.API.Dashboards;
@@ -100,7 +100,7 @@ public sealed class SqlDashboardStorage : IEditableDashboardStorage
connection.Open(); connection.Open();
command.ExecuteNonQuery(); command.ExecuteNonQuery();
_notifier?.NotifyChanged(); _ = _notifier?.NotifyChangedAsync();
return id; return id;
} }
@@ -122,7 +122,7 @@ public sealed class SqlDashboardStorage : IEditableDashboardStorage
throw new ArgumentException($"Dashboard '{dashboardId}' not found."); throw new ArgumentException($"Dashboard '{dashboardId}' not found.");
} }
_notifier?.NotifyChanged(); _ = _notifier?.NotifyChangedAsync();
} }
public void DeleteDashboard(string dashboardId) public void DeleteDashboard(string dashboardId)
@@ -133,6 +133,6 @@ public sealed class SqlDashboardStorage : IEditableDashboardStorage
connection.Open(); connection.Open();
command.ExecuteNonQuery(); command.ExecuteNonQuery();
_notifier?.NotifyChanged(); _ = _notifier?.NotifyChangedAsync();
} }
} }

View File

@@ -7,8 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" /> <PackageReference Include="AutoMapper" Version="16.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="DevExpress.AspNetCore.Dashboard" Version="25.2.3" /> <PackageReference Include="DevExpress.AspNetCore.Dashboard" Version="25.2.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.22" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.22" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.22" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.22" />
@@ -17,7 +16,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,5 +1,4 @@
using System.Net; using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
namespace DbFirst.API.Middleware; namespace DbFirst.API.Middleware;
@@ -20,33 +19,35 @@ public class ExceptionHandlingMiddleware
{ {
await _next(context); await _next(context);
} }
catch (InvalidOperationException ex)
{
_logger.LogWarning(ex, "Domain validation error");
await WriteProblemAsync(context, StatusCodes.Status400BadRequest, "Eingabe ungültig", ex.Message);
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Unhandled exception"); _logger.LogError(ex, "Unhandled exception");
await WriteProblemDetailsAsync(context, ex); await WriteProblemAsync(context, StatusCodes.Status500InternalServerError, "Serverfehler", ex.Message);
} }
} }
private static async Task WriteProblemDetailsAsync(HttpContext context, Exception ex) private static async Task WriteProblemAsync(HttpContext context, int status, string title, string detail)
{ {
if (context.Response.HasStarted) if (context.Response.HasStarted) return;
{
throw ex;
}
context.Response.Clear(); context.Response.Clear();
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; context.Response.StatusCode = status;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/problem+json";
var problem = new var problem = new ProblemDetails
{ {
type = "https://tools.ietf.org/html/rfc9110#section-15.6.1", Type = $"https://tools.ietf.org/html/rfc9110#section-{(status == 400 ? "15.5.1" : "15.6.1")}",
title = "Serverfehler", Title = title,
status = context.Response.StatusCode, Status = status,
detail = ex.Message, Detail = detail,
traceId = context.TraceIdentifier Extensions = { ["traceId"] = context.TraceIdentifier }
}; };
await context.Response.WriteAsync(JsonSerializer.Serialize(problem)); await context.Response.WriteAsJsonAsync(problem);
} }
} }

View File

@@ -1,16 +1,11 @@
using DbFirst.API.Middleware;
using DbFirst.API.Dashboards; using DbFirst.API.Dashboards;
using DbFirst.API.Hubs; using DbFirst.API.Hubs;
using DbFirst.API.Middleware;
using DbFirst.Application; using DbFirst.Application;
using DbFirst.Domain;
using DbFirst.Domain.Entities;
using DbFirst.Infrastructure; using DbFirst.Infrastructure;
using DevExpress.AspNetCore; using DevExpress.AspNetCore;
using DevExpress.DashboardAspNetCore; using DevExpress.DashboardAspNetCore;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb; using DevExpress.DashboardWeb;
using DevExpress.DataAccess.Json;
using System.Xml.Linq;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@@ -18,6 +13,7 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers(); builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer(); builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(); builder.Services.AddSwaggerGen();
builder.Services.AddProblemDetails();
// TODO: allow listed origins configured in appsettings.json // TODO: allow listed origins configured in appsettings.json
// In any case, dont let them to free to use without cors. if there is no origin specified, block all. // In any case, dont let them to free to use without cors. if there is no origin specified, block all.
@@ -34,7 +30,7 @@ builder.Services.AddCors(options =>
} }
else else
{ {
var origins = builder.Configuration.GetSection("Cors:AllowedOrigins").Get<string[]>() ?? Array.Empty<string>(); var origins = builder.Configuration.GetSection("Cors:AllowedOrigins").Get<string[]>() ?? [];
if (origins.Length > 0) if (origins.Length > 0)
{ {
policy.WithOrigins(origins) policy.WithOrigins(origins)
@@ -52,91 +48,8 @@ builder.Services.AddApplication();
builder.Services.AddDevExpressControls(); builder.Services.AddDevExpressControls();
builder.Services.AddSignalR(); builder.Services.AddSignalR();
builder.Services.AddSingleton<IDashboardChangeNotifier, DashboardChangeNotifier>(); builder.Services.AddSingleton<IDashboardChangeNotifier, DashboardChangeNotifier>();
builder.Services.AddScoped<DashboardConfigurator>((IServiceProvider serviceProvider) => { builder.Services.AddScoped<DashboardConfigurator>(sp =>
var dashboardsPath = Path.Combine(builder.Environment.ContentRootPath, "Data", "Dashboards"); DashboardConfiguratorFactory.Create(sp, builder.Configuration, builder.Environment));
Directory.CreateDirectory(dashboardsPath);
var defaultDashboardPath = Path.Combine(dashboardsPath, "DefaultDashboard.xml");
if (!File.Exists(defaultDashboardPath))
{
var defaultDashboard = new Dashboard();
defaultDashboard.Title.Text = "Default Dashboard";
defaultDashboard.SaveToXml(defaultDashboardPath);
}
var dashboardBaseUrl = builder.Configuration["Dashboard:BaseUrl"]
?? builder.Configuration["ApiBaseUrl"]
?? builder.Configuration["ASPNETCORE_URLS"]?.Split(';', StringSplitOptions.RemoveEmptyEntries).FirstOrDefault()
?? "https://localhost:7204";
dashboardBaseUrl = dashboardBaseUrl.TrimEnd('/');
var catalogsGridDashboardPath = Path.Combine(dashboardsPath, "CatalogsGrid.xml");
if (!File.Exists(catalogsGridDashboardPath))
{
var dashboard = new Dashboard();
dashboard.Title.Text = "Catalogs (Dashboard Grid)";
var catalogDataSource = new DashboardJsonDataSource("Catalogs (API)")
{
ComponentName = "catalogsDataSource",
JsonSource = new UriJsonSource(new Uri($"{dashboardBaseUrl}/api/catalogs"))
};
dashboard.DataSources.Add(catalogDataSource);
var grid = new GridDashboardItem
{
DataSource = catalogDataSource,
Name = "Catalogs"
};
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.Guid))) { Name = "Id" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.CatTitle))) { Name = "Titel" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.CatString))) { Name = "String" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.AddedWho))) { Name = "Angelegt von" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.AddedWhen))) { Name = "Angelegt am" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.ChangedWho))) { Name = "Geändert von" });
grid.Columns.Add(new GridDimensionColumn(new Dimension(nameof(VwmyCatalog.ChangedWhen))) { Name = "Geändert am" });
dashboard.Items.Add(grid);
var layoutGroup = new DashboardLayoutGroup { Orientation = DashboardLayoutGroupOrientation.Vertical };
layoutGroup.ChildNodes.Add(new DashboardLayoutItem(grid));
dashboard.LayoutRoot = layoutGroup;
dashboard.SaveToXml(catalogsGridDashboardPath);
}
DashboardConfigurator configurator = new DashboardConfigurator();
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? string.Empty;
var notifier = serviceProvider.GetRequiredService<IDashboardChangeNotifier>();
var dashboardStorage = new SqlDashboardStorage(connectionString, "TBDD_SMF_CONFIG", notifier: notifier);
configurator.SetDashboardStorage(dashboardStorage);
DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
DashboardJsonDataSource jsonDataSourceUrl = new DashboardJsonDataSource("JSON Data Source (URL)");
jsonDataSourceUrl.JsonSource = new UriJsonSource(
new Uri("https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json"));
jsonDataSourceUrl.RootElement = "Customers";
dataSourceStorage.RegisterDataSource("jsonDataSourceUrl", jsonDataSourceUrl.SaveToXml());
var catalogsJsonDataSource = new DashboardJsonDataSource("Catalogs (API)")
{
ComponentName = "catalogsDataSource",
JsonSource = new UriJsonSource(new Uri($"{dashboardBaseUrl}/api/catalogs"))
};
dataSourceStorage.RegisterDataSource(catalogsJsonDataSource.ComponentName, catalogsJsonDataSource.SaveToXml());
dataSourceStorage.RegisterDataSource(catalogsJsonDataSource.Name, catalogsJsonDataSource.SaveToXml());
configurator.SetDataSourceStorage(dataSourceStorage);
EnsureDashboardInStorage(dashboardStorage, "DefaultDashboard", defaultDashboardPath);
EnsureDashboardInStorage(dashboardStorage, "CatalogsGrid", catalogsGridDashboardPath);
return configurator;
});
var app = builder.Build(); var app = builder.Build();
@@ -158,16 +71,4 @@ app.MapDashboardRoute("api/dashboard", "DefaultDashboard");
app.MapHub<DashboardsHub>("/hubs/dashboards"); app.MapHub<DashboardsHub>("/hubs/dashboards");
app.MapControllers(); app.MapControllers();
app.Run(); app.Run();
static void EnsureDashboardInStorage(IEditableDashboardStorage storage, string id, string filePath)
{
var exists = storage.GetAvailableDashboardsInfo().Any(info => string.Equals(info.ID, id, StringComparison.OrdinalIgnoreCase));
if (exists || !File.Exists(filePath))
{
return;
}
var doc = XDocument.Load(filePath);
storage.AddDashboard(doc, id);
}

View File

@@ -1,4 +1,5 @@
using AutoMapper; using AutoMapper;
using DbFirst.Contracts.Catalogs;
using DbFirst.Domain.Entities; using DbFirst.Domain.Entities;
namespace DbFirst.Application.Catalogs; namespace DbFirst.Application.Catalogs;

View File

@@ -1,12 +0,0 @@
namespace DbFirst.Application.Catalogs;
public class CatalogReadDto
{
public int Guid { get; set; }
public string CatTitle { get; set; } = null!;
public string CatString { get; set; } = null!;
public string AddedWho { get; set; } = null!;
public DateTime AddedWhen { get; set; }
public string? ChangedWho { get; set; }
public DateTime? ChangedWhen { get; set; }
}

View File

@@ -1,10 +0,0 @@
using DbFirst.Domain;
namespace DbFirst.Application.Catalogs;
public class CatalogWriteDto
{
public string CatTitle { get; set; } = null!;
public string CatString { get; set; } = null!;
public CatalogUpdateProcedure UpdateProcedure { get; set; } = CatalogUpdateProcedure.Update;
}

View File

@@ -1,3 +1,4 @@
using DbFirst.Contracts.Catalogs;
using MediatR; using MediatR;
namespace DbFirst.Application.Catalogs.Commands; namespace DbFirst.Application.Catalogs.Commands;

View File

@@ -1,5 +1,6 @@
using AutoMapper; using AutoMapper;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Contracts.Catalogs;
using DbFirst.Domain.Entities; using DbFirst.Domain.Entities;
using MediatR; using MediatR;

View File

@@ -1,3 +1,4 @@
using DbFirst.Contracts.Catalogs;
using MediatR; using MediatR;
namespace DbFirst.Application.Catalogs.Commands; namespace DbFirst.Application.Catalogs.Commands;

View File

@@ -1,7 +1,8 @@
using AutoMapper; using AutoMapper;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Domain.Entities; using DbFirst.Contracts.Catalogs;
using DbFirst.Domain; using DbFirst.Domain;
using DbFirst.Domain.Entities;
using MediatR; using MediatR;
namespace DbFirst.Application.Catalogs.Commands; namespace DbFirst.Application.Catalogs.Commands;

View File

@@ -1,5 +1,6 @@
using AutoMapper; using AutoMapper;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Contracts.Catalogs;
using MediatR; using MediatR;
namespace DbFirst.Application.Catalogs.Queries; namespace DbFirst.Application.Catalogs.Queries;

View File

@@ -1,3 +1,4 @@
using DbFirst.Contracts.Catalogs;
using MediatR; using MediatR;
namespace DbFirst.Application.Catalogs.Queries; namespace DbFirst.Application.Catalogs.Queries;

View File

@@ -1,5 +1,6 @@
using AutoMapper; using AutoMapper;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Contracts.Catalogs;
using MediatR; using MediatR;
namespace DbFirst.Application.Catalogs.Queries; namespace DbFirst.Application.Catalogs.Queries;

View File

@@ -1,3 +1,4 @@
using DbFirst.Contracts.Catalogs;
using MediatR; using MediatR;
namespace DbFirst.Application.Catalogs.Queries; namespace DbFirst.Application.Catalogs.Queries;

View File

@@ -7,14 +7,18 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" /> <PackageReference Include="AutoMapper" Version="16.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" /> <PackageReference Include="MediatR" Version="14.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DbFirst.Contracts\DbFirst.Contracts.csproj" />
<ProjectReference Include="..\DbFirst.Domain\DbFirst.Domain.csproj" /> <ProjectReference Include="..\DbFirst.Domain\DbFirst.Domain.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Layouts\" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,5 +1,4 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using MediatR;
namespace DbFirst.Application; namespace DbFirst.Application;
@@ -7,8 +6,9 @@ public static class DependencyInjection
{ {
public static IServiceCollection AddApplication(this IServiceCollection services) public static IServiceCollection AddApplication(this IServiceCollection services)
{ {
services.AddAutoMapper(typeof(DependencyInjection).Assembly); services.AddAutoMapper(cfg => cfg.AddMaps(typeof(DependencyInjection).Assembly));
services.AddMediatR(typeof(DependencyInjection).Assembly); services.AddMediatR(cfg =>
cfg.RegisterServicesFromAssembly(typeof(DependencyInjection).Assembly));
return services; return services;
} }
} }

View File

@@ -1,9 +0,0 @@
namespace DbFirst.Application.Layouts;
public class LayoutDto
{
public string LayoutType { get; set; } = string.Empty;
public string LayoutKey { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
public string LayoutData { get; set; } = string.Empty;
}

View File

@@ -1,3 +1,4 @@
using DbFirst.Contracts.MassData;
using MediatR; using MediatR;
namespace DbFirst.Application.MassData.Commands; namespace DbFirst.Application.MassData.Commands;

View File

@@ -1,5 +1,6 @@
using AutoMapper; using AutoMapper;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Contracts.MassData;
using MediatR; using MediatR;
namespace DbFirst.Application.MassData.Commands; namespace DbFirst.Application.MassData.Commands;

View File

@@ -1,4 +1,5 @@
using AutoMapper; using AutoMapper;
using DbFirst.Contracts.MassData;
using DbFirst.Domain.Entities; using DbFirst.Domain.Entities;
namespace DbFirst.Application.MassData; namespace DbFirst.Application.MassData;

View File

@@ -1,12 +0,0 @@
namespace DbFirst.Application.MassData;
public class MassDataReadDto
{
public int Id { get; set; }
public string CustomerName { get; set; } = string.Empty;
public decimal Amount { get; set; }
public string Category { get; set; } = string.Empty;
public bool StatusFlag { get; set; }
public DateTime AddedWhen { get; set; }
public DateTime? ChangedWhen { get; set; }
}

View File

@@ -1,5 +1,6 @@
using AutoMapper; using AutoMapper;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Contracts.MassData;
using MediatR; using MediatR;
namespace DbFirst.Application.MassData.Queries; namespace DbFirst.Application.MassData.Queries;

View File

@@ -1,3 +1,4 @@
using DbFirst.Contracts.MassData;
using MediatR; using MediatR;
namespace DbFirst.Application.MassData.Queries; namespace DbFirst.Application.MassData.Queries;

View File

@@ -1,5 +1,6 @@
using AutoMapper; using AutoMapper;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Contracts.MassData;
using MediatR; using MediatR;
namespace DbFirst.Application.MassData.Queries; namespace DbFirst.Application.MassData.Queries;

View File

@@ -1,3 +1,4 @@
using DbFirst.Contracts.MassData;
using MediatR; using MediatR;
namespace DbFirst.Application.MassData.Queries; namespace DbFirst.Application.MassData.Queries;

View File

@@ -24,6 +24,14 @@
<link rel="stylesheet" href="DbFirst.BlazorWebApp.styles.css" /> <link rel="stylesheet" href="DbFirst.BlazorWebApp.styles.css" />
<link rel="icon" type="image/png" href="favicon.png" /> <link rel="icon" type="image/png" href="favicon.png" />
<script src="js/size-manager.js"></script> <script src="js/size-manager.js"></script>
<script>
window.setDxDarkOverride = function (enabled) {
if (enabled)
document.documentElement.classList.add('dx-dark');
else
document.documentElement.classList.remove('dx-dark');
};
</script>
<HeadOutlet /> <HeadOutlet />
</head> </head>

View File

@@ -259,7 +259,7 @@ else
{ {
CatTitle = editModel.CatTitle, CatTitle = editModel.CatTitle,
CatString = editModel.CatString, CatString = editModel.CatString,
UpdateProcedure = editModel.UpdateProcedure UpdateProcedure = (CatalogUpdateProcedure)editModel.UpdateProcedure
}; };
try try

View File

@@ -1,15 +1,23 @@
@inherits LayoutComponentBase @inherits LayoutComponentBase
@implements IDisposable @implements IDisposable
@inject ThemeState ThemeState @inject ThemeState ThemeState
@inject IJSRuntime JS
<div class="page @(ThemeState.IsDarkMode ? "app-dark" : "app-light")"> <div class="page @(ThemeState.IsDarkMode ? "app-dark" : "app-light") @(ThemeState.IsNativeDarkTheme ? "native-dark" : "")">
<div class="sidebar"> <div class="sidebar">
<NavMenu /> <NavMenu />
</div> </div>
<main> <main>
<div class="top-row px-4"> <div class="top-row px-4">
<DxButton Text="@(ThemeState.IsDarkMode ? "Dark Mode aus" : "Dark Mode an")" Click="ToggleTheme" /> <DxComboBox Data="@ThemeState.AvailableThemes"
Value="@ThemeState.CurrentThemeName"
ValueChanged="@((string t) => ThemeState.SetTheme(t))"
style="width: 130px;" />
<span style="margin-left: 12px;">
<DxButton Text="@(ThemeState.IsDarkMode ? "Dark Mode aus" : "Dark Mode an")"
Click="ToggleTheme" />
</span>
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a> <a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
</div> </div>
@@ -26,9 +34,43 @@
</div> </div>
@code { @code {
private bool _isInteractive;
protected override void OnInitialized() protected override void OnInitialized()
{ {
ThemeState.OnChange += StateHasChanged; ThemeState.OnChange += OnThemeChanged;
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
_isInteractive = true;
}
await ApplyDxDarkOverrideAsync();
}
private async void OnThemeChanged()
{
StateHasChanged();
if (_isInteractive)
{
await ApplyDxDarkOverrideAsync();
}
}
private async Task ApplyDxDarkOverrideAsync()
{
if (!_isInteractive) return;
try
{
bool needsOverride = ThemeState.IsDarkMode && !ThemeState.IsNativeDarkTheme;
await JS.InvokeVoidAsync("setDxDarkOverride", needsOverride);
}
catch (JSException)
{
// JS-Funktion noch nicht verfügbar kein Circuit-Crash
}
} }
private void ToggleTheme() private void ToggleTheme()
@@ -38,6 +80,6 @@
public void Dispose() public void Dispose()
{ {
ThemeState.OnChange -= StateHasChanged; ThemeState.OnChange -= OnThemeChanged;
} }
} }

View File

@@ -18,11 +18,13 @@ main {
} }
.sidebar { .sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); background-color: var(--dx-color-surface-container, #f4f4f4);
border-right: 1px solid var(--dx-color-outline-variant, #e0e0e0);
} }
.page.app-dark .sidebar { .page.app-dark .sidebar {
background-image: linear-gradient(180deg, #171717 0%, #0f2a46 70%); background-color: var(--dx-color-surface-container, #1e1e1e);
border-right-color: var(--dx-color-outline-variant, #333);
} }
.top-row { .top-row {

View File

@@ -1,36 +1,24 @@
<div class="top-row ps-3 navbar navbar-dark"> <div class="nav-brand-row">
<div class="container-fluid"> <a class="nav-brand-link" href="">DbFirst</a>
<a class="navbar-brand" href="">DbFirst.BlazorWebApp</a> <button class="nav-toggle-btn" @onclick="ToggleMenu" title="Navigation menu">&#9776;</button>
</div>
</div> </div>
<input type="checkbox" title="Navigation menu" class="navbar-toggler" /> <div class="nav-scrollable @(menuOpen ? "nav-open" : "")">
<DxTreeView CssClass="sidebar-tree">
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()"> <Nodes>
<nav class="flex-column"> <DxTreeViewNode Text="Home" NavigateUrl="/" IconCssClass="dxi dxi-home" />
<div class="nav-item px-3"> <DxTreeViewNode Text="Data Management" Expanded="true">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All"> <Nodes>
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home <DxTreeViewNode Text="Catalogs" NavigateUrl="/catalogs" IconCssClass="dxi dxi-folder" />
</NavLink> <DxTreeViewNode Text="Dashboards" NavigateUrl="/dashboards" IconCssClass="dxi dxi-chart-bar" />
</div> <DxTreeViewNode Text="Mass Data" NavigateUrl="/massdata" IconCssClass="dxi dxi-table" />
</Nodes>
<div class="nav-item px-3"> </DxTreeViewNode>
<NavLink class="nav-link" href="catalogs"> </Nodes>
<span class="bi bi-collection-nav-menu" aria-hidden="true"></span> Catalogs </DxTreeView>
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="dashboards">
<span class="bi bi-speedometer-nav-menu" aria-hidden="true"></span> Dashboards
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="massdata">
<span class="bi bi-table-nav-menu" aria-hidden="true"></span> MassData
</NavLink>
</div>
</nav>
</div> </div>
@code {
private bool menuOpen = false;
private void ToggleMenu() => menuOpen = !menuOpen;
}

View File

@@ -1,117 +1,52 @@
.navbar-toggler { .nav-brand-row {
appearance: none;
cursor: pointer;
width: 3.5rem;
height: 2.5rem;
color: white;
position: absolute;
top: 0.5rem;
right: 1rem;
border: 1px solid rgba(255, 255, 255, 0.1);
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
}
.navbar-toggler:checked {
background-color: rgba(255, 255, 255, 0.5);
}
.top-row {
height: 3.5rem; height: 3.5rem;
background-color: rgba(0,0,0,0.4); display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
} }
.navbar-brand { .nav-brand-link {
font-size: 1.1rem; font-size: 1.05rem;
font-weight: 600;
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.bi { .nav-toggle-btn {
display: inline-block; display: block;
position: relative; background: none;
width: 1.25rem; border: none;
height: 1.25rem; font-size: 1.4rem;
margin-right: 0.75rem; cursor: pointer;
top: -1px; padding: 0.25rem 0.5rem;
background-size: cover; line-height: 1;
}
.bi-house-door-fill-nav-menu {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}
.bi-plus-square-fill-nav-menu {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}
.bi-list-nested-nav-menu {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}
.bi-collection-nav-menu {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M2 3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5v1H2V3z'/%3E%3Cpath d='M2 5h12v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5z'/%3E%3C/svg%3E");
}
.bi-speedometer-nav-menu {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M1 11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v4zm5 0a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v8zm5 0a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2z'/%3E%3C/svg%3E");
}
.bi-table-nav-menu {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M1 2a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2zm1 1v2h12V3H2zm12 3H2v2h12V6zm0 3H2v2h12V9zm0 3H2v1h12v-1z'/%3E%3C/svg%3E");
}
.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
}
.nav-item:first-of-type {
padding-top: 1rem;
}
.nav-item:last-of-type {
padding-bottom: 1rem;
}
.nav-item ::deep .nav-link {
color: #d7d7d7;
background: none;
border: none;
border-radius: 4px;
height: 3rem;
display: flex;
align-items: center;
line-height: 3rem;
width: 100%;
}
.nav-item ::deep a.active {
background-color: rgba(255,255,255,0.37);
color: white;
}
.nav-item ::deep .nav-link:hover {
background-color: rgba(255,255,255,0.1);
color: white;
} }
.nav-scrollable { .nav-scrollable {
display: none; display: none;
} }
.navbar-toggler:checked ~ .nav-scrollable { .nav-scrollable.nav-open {
display: block; display: block;
}
.sidebar-tree {
width: 100%;
} }
@media (min-width: 641px) { @media (min-width: 641px) {
.navbar-toggler { .nav-toggle-btn {
display: none; display: none;
} }
.nav-scrollable { .nav-scrollable {
/* Never collapse the sidebar for wide screens */
display: block; display: block;
/* Allow sidebar to scroll for tall menus */
height: calc(100vh - 3.5rem); height: calc(100vh - 3.5rem);
overflow-y: auto; overflow-y: auto;
} }
} }

View File

@@ -1,4 +1,5 @@
@rendermode InteractiveServer @rendermode @(new InteractiveServerRenderMode(prerender: false))
<Router AppAssembly="typeof(Program).Assembly"> <Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData"> <Found Context="routeData">

View File

@@ -1,21 +1,28 @@
@using System.Net.Http @using System.Net.Http
@using System.Net.Http.Json @using System.Net.Http.Json
@using System.Text.Json @using System.Text.Json
@using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Rendering @using Microsoft.AspNetCore.Components.Rendering
@using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Microsoft.AspNetCore.SignalR.Client @using Microsoft.AspNetCore.SignalR.Client
@using Microsoft.JSInterop
@using Microsoft.Extensions.Options
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using DbFirst.BlazorWebApp @using DbFirst.BlazorWebApp
@using DbFirst.BlazorWebApp.Components @using DbFirst.BlazorWebApp.Components
@using DbFirst.BlazorWebApp.Models
@using DbFirst.BlazorWebApp.Models.Grid @using DbFirst.BlazorWebApp.Models.Grid
@using DbFirst.BlazorWebApp.Services @using DbFirst.BlazorWebApp.Services
@using DbFirst.Contracts.Catalogs
@using DbFirst.Contracts.Dashboards
@using DbFirst.Contracts.MassData
@using DbFirst.Contracts.Layouts
@using DbFirst.Domain
@using DevExpress.Blazor @using DevExpress.Blazor
@using DevExpress.DashboardBlazor @using DevExpress.DashboardBlazor
@using DevExpress.DashboardWeb @using DevExpress.DashboardWeb
@using DevExpress.Data.Filtering @using DevExpress.Data.Filtering
@using Microsoft.Extensions.Options

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
@@ -18,4 +18,8 @@
<Folder Include="wwwroot\images\" /> <Folder Include="wwwroot\images\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DbFirst.Contracts\DbFirst.Contracts.csproj" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,12 +0,0 @@
namespace DbFirst.BlazorWebApp.Models;
public class CatalogReadDto
{
public int Guid { get; set; }
public string CatTitle { get; set; } = null!;
public string CatString { get; set; } = null!;
public string AddedWho { get; set; } = null!;
public DateTime AddedWhen { get; set; }
public string? ChangedWho { get; set; }
public DateTime? ChangedWhen { get; set; }
}

View File

@@ -1,8 +0,0 @@
namespace DbFirst.BlazorWebApp.Models;
public class CatalogWriteDto
{
public string CatTitle { get; set; } = string.Empty;
public string CatString { get; set; } = string.Empty;
public int UpdateProcedure { get; set; }
}

View File

@@ -1,9 +0,0 @@
namespace DbFirst.BlazorWebApp.Models;
public class MassDataWriteDto
{
public string CustomerName { get; set; } = string.Empty;
public decimal Amount { get; set; }
public string Category { get; set; } = string.Empty;
public bool StatusFlag { get; set; }
}

View File

@@ -1,5 +1,4 @@
using System.Net; using System.Net;
using System.Net.Http.Json;
namespace DbFirst.BlazorWebApp.Services; namespace DbFirst.BlazorWebApp.Services;

View File

@@ -1,5 +1,5 @@
using DbFirst.BlazorWebApp.Models; using DbFirst.BlazorWebApp.Models.Grid;
using DbFirst.BlazorWebApp.Models.Grid; using DbFirst.Contracts.Layouts;
using Microsoft.JSInterop; using Microsoft.JSInterop;
using System.Text.Json; using System.Text.Json;

View File

@@ -1,6 +1,5 @@
using System.Net;
using System.Net.Http.Json;
using DbFirst.BlazorWebApp.Models; using DbFirst.BlazorWebApp.Models;
using DbFirst.Contracts.Catalogs;
namespace DbFirst.BlazorWebApp.Services; namespace DbFirst.BlazorWebApp.Services;

View File

@@ -1,5 +1,4 @@
using System.Net.Http.Json; using DbFirst.Contracts.Dashboards;
using DbFirst.BlazorWebApp.Models;
namespace DbFirst.BlazorWebApp.Services; namespace DbFirst.BlazorWebApp.Services;

View File

@@ -1,4 +1,5 @@
using DbFirst.BlazorWebApp.Models; using DbFirst.BlazorWebApp.Models;
using DbFirst.Contracts.Catalogs;
namespace DbFirst.BlazorWebApp.Services; namespace DbFirst.BlazorWebApp.Services;

View File

@@ -1,4 +1,4 @@
using DbFirst.BlazorWebApp.Models; using DbFirst.Contracts.Dashboards;
namespace DbFirst.BlazorWebApp.Services namespace DbFirst.BlazorWebApp.Services
{ {

View File

@@ -1,4 +1,4 @@
using DbFirst.BlazorWebApp.Models; using DbFirst.Contracts.Layouts;
namespace DbFirst.BlazorWebApp.Services namespace DbFirst.BlazorWebApp.Services
{ {

View File

@@ -1,4 +1,5 @@
using DbFirst.BlazorWebApp.Models; using DbFirst.BlazorWebApp.Models;
using DbFirst.Contracts.MassData;
namespace DbFirst.BlazorWebApp.Services namespace DbFirst.BlazorWebApp.Services
{ {

View File

@@ -1,5 +1,4 @@
using System.Net.Http.Json; using DbFirst.Contracts.Layouts;
using DbFirst.BlazorWebApp.Models;
namespace DbFirst.BlazorWebApp.Services; namespace DbFirst.BlazorWebApp.Services;

View File

@@ -1,5 +1,5 @@
using System.Net.Http.Json;
using DbFirst.BlazorWebApp.Models; using DbFirst.BlazorWebApp.Models;
using DbFirst.Contracts.MassData;
namespace DbFirst.BlazorWebApp.Services; namespace DbFirst.BlazorWebApp.Services;

View File

@@ -12,24 +12,54 @@ public class ThemeState
} }
public bool IsDarkMode { get; private set; } public bool IsDarkMode { get; private set; }
public string CurrentThemeName { get; private set; } = "Fluent";
/// <summary>
/// Themes die eine native DevExpress Dark-Variante besitzen:
/// - Fluent ? Themes.Fluent.Clone(ThemeMode.Dark), verwendet --DS-* Token-System
/// - BlazingBerry ? Themes.BlazingDark
/// Alle anderen Themes (Purple, OfficeWhite, BootstrapExternal) haben keine offizielle
/// Dark-Variante; dort übernehmen CSS-Overrides auf --dxbl-grid-* Variablen die Arbeit.
/// </summary>
public bool IsNativeDarkTheme => IsDarkMode &&
(CurrentThemeName == "Fluent" || CurrentThemeName == "BlazingBerry");
public static readonly List<string> AvailableThemes = ["Fluent", "BlazingBerry", "Purple", "OfficeWhite", "BootstrapExternal"];
public event Action? OnChange; public event Action? OnChange;
public void SetDarkMode(bool isDarkMode) public void SetTheme(string themeName)
{ {
if (IsDarkMode == isDarkMode) if (CurrentThemeName == themeName) return;
{ CurrentThemeName = themeName;
return; ApplyTheme();
}
IsDarkMode = isDarkMode;
var theme = Themes.Fluent.Clone(properties =>
{
properties.Mode = isDarkMode ? ThemeMode.Dark : ThemeMode.Light;
properties.ApplyToPageElements = true;
});
themeChangeService.SetTheme(theme);
OnChange?.Invoke(); OnChange?.Invoke();
} }
}
public void SetDarkMode(bool isDarkMode)
{
if (IsDarkMode == isDarkMode) return;
IsDarkMode = isDarkMode;
ApplyTheme();
OnChange?.Invoke();
}
private void ApplyTheme()
{
if (CurrentThemeName == "Fluent")
{
var theme = Themes.Fluent.Clone(properties =>
{
properties.Mode = IsDarkMode ? ThemeMode.Dark : ThemeMode.Light;
properties.ApplyToPageElements = true;
});
themeChangeService.SetTheme(theme);
}
else if (CurrentThemeName == "BlazingBerry") themeChangeService.SetTheme(IsDarkMode ? Themes.BlazingDark : Themes.BlazingBerry);
else if (CurrentThemeName == "Purple") themeChangeService.SetTheme(Themes.Purple);
else if (CurrentThemeName == "OfficeWhite") themeChangeService.SetTheme(Themes.OfficeWhite);
else if (CurrentThemeName == "BootstrapExternal") themeChangeService.SetTheme(Themes.BootstrapExternal);
else
themeChangeService.SetTheme(Themes.Fluent);
}
}

View File

@@ -5,5 +5,11 @@
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
}, },
"ApiBaseUrl": "https://localhost:7204/" "ApiBaseUrl": "https://localhost:7204/",
"BrowserLink": {
"Enabled": false
},
"DetailedErrors": true
} }

View File

@@ -148,6 +148,105 @@ dxbl-grid tbody tr:nth-child(even) td {
background-color: var(--grid-stripe-bg) !important; background-color: var(--grid-stripe-bg) !important;
} }
/* ?? Dark-Mode-Overrides für nicht-native Themes ?????????????????????????????
Strategie: CSS-Custom-Properties werden von DevExpress DIREKT auf den
Komponenten-Elementen definiert (z. B. --dxbl-popup-bg:#fff auf .dxbl-modal).
Eine geerbte Variable aus html.dx-dark würde durch die direkte Zuweisung
überschrieben. Deshalb targeten wir exakt dieselben Elemente, aber mit einem
zusätzlichen Vorfahren-Selektor (html.dx-dark) für höhere Spezifizität:
html.dx-dark .dxbl-modal = (0,2,1) > .dxbl-modal = (0,1,0) ?
html.dx-dark wird per JS gesetzt, wenn IsDarkMode && !IsNativeDarkTheme.
?? */
/* Popup / Modal (CRUD-Dialoge) Variablen-Quelle: .dxbl-modal */
html.dx-dark .dxbl-modal {
--dxbl-popup-bg: #2d2d2d;
--dxbl-popup-color: #e8e8e8;
--dxbl-popup-border-color: #555;
--dxbl-popup-header-bg: #333;
--dxbl-popup-header-color: #e8e8e8;
--dxbl-popup-footer-bg: #333;
--dxbl-popup-footer-color: #e8e8e8;
}
/* Flyout (Column Chooser, Filter-Panel) Variablen-Quelle: .dxbl-flyout */
html.dx-dark .dxbl-flyout {
--dxbl-flyout-bg: #2d2d2d;
--dxbl-flyout-color: #e8e8e8;
--dxbl-flyout-border-color: #555;
--dxbl-flyout-header-bg: #333;
--dxbl-flyout-header-color: #e8e8e8;
--dxbl-flyout-footer-bg: #333;
}
/* Dropdown (ComboBox-Klappliste, Band-Dropdowns) Quelle: .dxbl-dropdown */
html.dx-dark .dxbl-dropdown,
html.dx-dark .dxbl-itemlist-dropdown {
--dxbl-dropdown-bg: #2d2d2d;
--dxbl-dropdown-color: #e8e8e8;
--dxbl-dropdown-border-color: #555;
--dxbl-dropdown-header-bg: #333;
--dxbl-dropdown-footer-bg: #333;
}
/* Edit-Dropdown (ComboBox-Popup wenn als Modal gerendert) Quelle: .dxbl-edit-dropdown */
html.dx-dark .dxbl-edit-dropdown {
--dxbl-edit-dropdown-bg: #2d2d2d;
--dxbl-edit-dropdown-color: #e8e8e8;
--dxbl-edit-dropdown-border-color: #555;
}
/* ListBox (Einträge in Dropdowns) Quelle: .dxbl-list-box */
html.dx-dark .dxbl-list-box,
html.dx-dark .dxbl-list-box-render-container {
--dxbl-list-box-bg: #2d2d2d;
--dxbl-list-box-color: #e8e8e8;
--dxbl-list-box-border-color: #555;
--dxbl-list-box-item-hover-bg: #3a3a3a;
--dxbl-list-box-item-hover-color: #e8e8e8;
}
/* TextEdit / ComboBox Eingabefeld Quelle: .dxbl-text-edit */
html.dx-dark .dxbl-text-edit {
--dxbl-text-edit-bg: #2d2d2d;
--dxbl-text-edit-color: #e8e8e8;
--dxbl-text-edit-border-color: #555;
--dxbl-text-edit-btn-bg: #3a3a3a;
--dxbl-text-edit-btn-color: #e8e8e8;
--dxbl-text-edit-btn-hover-bg: #444;
--dxbl-text-edit-btn-hover-color: #e8e8e8;
}
/* Buttons */
html.dx-dark .dxbl-btn {
--dxbl-btn-color: #e8e8e8;
--dxbl-btn-bg: #3a3a3a;
--dxbl-btn-border-color: #555;
--dxbl-btn-hover-bg: #444;
--dxbl-btn-hover-color: #e8e8e8;
--dxbl-btn-hover-border-color: #666;
}
/* FormLayout */
html.dx-dark .dxbl-fl {
--dxbl-fl-caption-color: #bbb;
--dxbl-fl-group-bg: #242424;
--dxbl-fl-group-color: #e8e8e8;
}
/* Grid */
html.dx-dark .dxbl-grid {
background-color: #242424;
color: #e8e8e8;
border-color: #444;
}
html.dx-dark .dxbl-grid > .dxbl-scroll-viewer,
html.dx-dark .dxbl-grid > .dxbl-grid-top-panel {
background-color: #242424;
color: #e8e8e8;
}
/* MassData-spezifisch */ /* MassData-spezifisch */
.page-size-selector { .page-size-selector {
display: flex; display: flex;
@@ -185,3 +284,7 @@ dxbl-grid tbody tr:nth-child(even) td {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.top-row .btn-gap {
margin-left: 8px;
}

View File

@@ -1,3 +1,4 @@
window.setSize = function (fontSize) { window.setSize = function (fontSize) {
document.documentElement.style.setProperty('--global-size', fontSize); document.documentElement.style.setProperty('--global-size', fontSize);
}; };

View File

@@ -0,0 +1,12 @@
namespace DbFirst.Contracts.Catalogs;
public class CatalogReadDto
{
public int Guid { get; set; }
public string CatTitle { get; set; } = string.Empty;
public string CatString { get; set; } = string.Empty;
public string AddedWho { get; set; } = string.Empty;
public DateTime AddedWhen { get; set; }
public string? ChangedWho { get; set; }
public DateTime? ChangedWhen { get; set; }
}

View File

@@ -0,0 +1,10 @@
using DbFirst.Domain;
namespace DbFirst.Contracts.Catalogs;
public class CatalogWriteDto
{
public string CatTitle { get; set; } = string.Empty;
public string CatString { get; set; } = string.Empty;
public CatalogUpdateProcedure UpdateProcedure { get; set; } = CatalogUpdateProcedure.Update;
}

View File

@@ -1,7 +1,7 @@
namespace DbFirst.BlazorWebApp.Models; namespace DbFirst.Contracts.Dashboards;
public class DashboardInfoDto public class DashboardInfoDto
{ {
public string Id { get; set; } = string.Empty; public string Id { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
} }

View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DbFirst.Domain\DbFirst.Domain.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,4 +1,4 @@
namespace DbFirst.BlazorWebApp.Models; namespace DbFirst.Contracts.Layouts;
public class LayoutDto public class LayoutDto
{ {
@@ -6,4 +6,4 @@ public class LayoutDto
public string LayoutKey { get; set; } = string.Empty; public string LayoutKey { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty; public string UserName { get; set; } = string.Empty;
public string LayoutData { get; set; } = string.Empty; public string LayoutData { get; set; } = string.Empty;
} }

View File

@@ -1,4 +1,4 @@
namespace DbFirst.BlazorWebApp.Models; namespace DbFirst.Contracts.MassData;
public class MassDataReadDto public class MassDataReadDto
{ {
@@ -9,4 +9,4 @@ public class MassDataReadDto
public bool StatusFlag { get; set; } public bool StatusFlag { get; set; }
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
public DateTime? ChangedWhen { get; set; } public DateTime? ChangedWhen { get; set; }
} }

View File

@@ -1,4 +1,4 @@
namespace DbFirst.Application.MassData; namespace DbFirst.Contracts.MassData;
public class MassDataWriteDto public class MassDataWriteDto
{ {
@@ -6,4 +6,4 @@ public class MassDataWriteDto
public decimal Amount { get; set; } public decimal Amount { get; set; }
public string Category { get; set; } = string.Empty; public string Category { get; set; } = string.Empty;
public bool StatusFlag { get; set; } public bool StatusFlag { get; set; }
} }

View File

@@ -4,12 +4,12 @@ public partial class VwmyCatalog
{ {
public int Guid { get; set; } public int Guid { get; set; }
public string CatTitle { get; set; } = null!; public string CatTitle { get; set; } = string.Empty;
public string CatString { get; set; } = null!; public string CatString { get; set; } = string.Empty;
public string AddedWho { get; set; } = null!;
public string AddedWho { get; set; } = string.Empty;
public DateTime AddedWhen { get; set; } public DateTime AddedWhen { get; set; }
public string? ChangedWho { get; set; } public string? ChangedWho { get; set; }

View File

@@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" /> <PackageReference Include="AutoMapper" Version="16.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.22" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.22" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.22" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.22" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.22"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.22">
@@ -15,7 +15,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" /> <PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
</ItemGroup> </ItemGroup>

View File

@@ -1,6 +1,6 @@
using DbFirst.Application.Repositories;
using DbFirst.Domain; using DbFirst.Domain;
using DbFirst.Domain.Entities; using DbFirst.Domain.Entities;
using DbFirst.Application.Repositories;
using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Data; using System.Data;

View File

@@ -1,8 +1,8 @@
using System.Data;
using DbFirst.Application.Repositories; using DbFirst.Application.Repositories;
using DbFirst.Domain.Entities; using DbFirst.Domain.Entities;
using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Data;
namespace DbFirst.Infrastructure.Repositories; namespace DbFirst.Infrastructure.Repositories;
@@ -20,11 +20,6 @@ public class MassDataRepository : IMassDataRepository
return await _db.Massdata.AsNoTracking().CountAsync(cancellationToken); return await _db.Massdata.AsNoTracking().CountAsync(cancellationToken);
} }
public async Task<List<Massdata>> GetAllAsync(CancellationToken cancellationToken = default)
{
return await _db.Massdata.AsNoTracking().ToListAsync(cancellationToken);
}
public async Task<Massdata?> GetByCustomerNameAsync(string customerName, CancellationToken cancellationToken = default) public async Task<Massdata?> GetByCustomerNameAsync(string customerName, CancellationToken cancellationToken = default)
{ {
return await _db.Massdata.AsNoTracking() return await _db.Massdata.AsNoTracking()

View File

@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.Domain", "DbFirst.D
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.BlazorWebApp", "DbFirst.BlazorWebApp\DbFirst.BlazorWebApp.csproj", "{FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.BlazorWebApp", "DbFirst.BlazorWebApp\DbFirst.BlazorWebApp.csproj", "{FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.Contracts", "DbFirst.Contracts\DbFirst.Contracts.csproj", "{94FFCA01-9476-49B3-B7D0-5706514E42E4}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -83,6 +85,18 @@ Global
{FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}.Release|x64.Build.0 = Release|Any CPU {FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}.Release|x64.Build.0 = Release|Any CPU
{FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}.Release|x86.ActiveCfg = Release|Any CPU {FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}.Release|x86.ActiveCfg = Release|Any CPU
{FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}.Release|x86.Build.0 = Release|Any CPU {FF1D77C4-A13D-43E0-BCE1-C18C01F1767C}.Release|x86.Build.0 = Release|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Debug|x64.ActiveCfg = Debug|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Debug|x64.Build.0 = Debug|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Debug|x86.ActiveCfg = Debug|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Debug|x86.Build.0 = Debug|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Release|Any CPU.Build.0 = Release|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Release|x64.ActiveCfg = Release|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Release|x64.Build.0 = Release|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Release|x86.ActiveCfg = Release|Any CPU
{94FFCA01-9476-49B3-B7D0-5706514E42E4}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE