Refactor catalog CRUD to use stored procedures only

Removed direct usage of TbmyCatalog entity and DbSet. All create, update, and delete operations now use stored procedures. Entity lookups and mappings are performed via the VwmyCatalog view. Updated AutoMapper profile and DbContext configuration accordingly. Catalog creation now sets ChangedWho/ChangedWhen to "system" and current UTC time.
This commit is contained in:
OlgunR
2026-01-14 12:50:58 +01:00
parent 6f3c0e33fa
commit ccd97fe9d6
5 changed files with 51 additions and 108 deletions

View File

@@ -1,24 +0,0 @@
namespace DbFirst.Infrastructure.ScaffoldEntities;
public partial class TbmyCatalog
{
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; }
// = null!; ist nur eine Null-Unterdrückung für NonNullable-Referenztypen. Hintergrund: Die Spalten CatTitle, CatString, AddedWho
// sind in der DB als NOT NULL definiert, also generiert der Scaffold string (ohne ?). Damit der Compiler bei aktivierter Nullable-Analyse
// nicht warnt („non-nullable property is uninitialized“), wird ein Dummy-Init auf null! gesetzt. Das ! sagt dem Compiler „ich garantiere,
// dass zur Laufzeit ein Wert gesetzt wird“. Bei string? ChangedWho/DateTime? ChangedWhen sind die Spalten nullable, daher kein null! nötig.
// Bei Value Types wie int/DateTime braucht es ebenfalls kein Init, da sie Standardwerte haben.
}