From d3122308033e3cac5eadca74d84603d840487bc6 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Mon, 12 Jan 2026 09:42:20 +0100 Subject: [PATCH] Initial .NET 8 Web API with EF Core Db-First for Catalogs Set up multi-project solution with DbFirst API, Application, Domain, and Infrastructure layers. Implemented database-first EF Core for the Catalog entity, including domain, DTOs, repository, service, and controller. Configured AutoMapper, DI, Swagger, and project settings. Added .gitattributes and initial configuration files. --- .gitattributes | 63 ++++++++++++++++++ DbFirst.API/Controllers/CatalogsController.cs | 63 ++++++++++++++++++ DbFirst.API/DbFirst.API.csproj | 27 ++++++++ DbFirst.API/DbFirst.API.http | 6 ++ DbFirst.API/Program.cs | 38 +++++++++++ DbFirst.API/Properties/launchSettings.json | 41 ++++++++++++ DbFirst.API/appsettings.Development.json | 8 +++ DbFirst.API/appsettings.json | 12 ++++ DbFirst.Application/Catalogs/CatalogDto.cs | 12 ++++ .../Catalogs/CatalogProfile.cs | 12 ++++ .../Catalogs/CatalogService.cs | 47 +++++++++++++ .../Catalogs/ICatalogService.cs | 10 +++ .../DbFirst.Application.csproj | 17 +++++ DbFirst.Domain/DbFirst.Domain.csproj | 14 ++++ DbFirst.Domain/DomainEntities/Catalog.cs | 12 ++++ .../Repositories/ICatalogRepository.cs | 12 ++++ .../ApplicationDbContext.cs | 56 ++++++++++++++++ .../DbFirst.Infrastructure.csproj | 23 +++++++ .../Mappings/CatalogInfrastructureProfile.cs | 13 ++++ .../Repositories/CatalogRepository.cs | 66 +++++++++++++++++++ .../ScaffoldEntities/TbmyCatalog.cs | 24 +++++++ DbFirst.sln | 43 ++++++++++++ NuGet.config | 9 +++ 23 files changed, 628 insertions(+) create mode 100644 .gitattributes create mode 100644 DbFirst.API/Controllers/CatalogsController.cs create mode 100644 DbFirst.API/DbFirst.API.csproj create mode 100644 DbFirst.API/DbFirst.API.http create mode 100644 DbFirst.API/Program.cs create mode 100644 DbFirst.API/Properties/launchSettings.json create mode 100644 DbFirst.API/appsettings.Development.json create mode 100644 DbFirst.API/appsettings.json create mode 100644 DbFirst.Application/Catalogs/CatalogDto.cs create mode 100644 DbFirst.Application/Catalogs/CatalogProfile.cs create mode 100644 DbFirst.Application/Catalogs/CatalogService.cs create mode 100644 DbFirst.Application/Catalogs/ICatalogService.cs create mode 100644 DbFirst.Application/DbFirst.Application.csproj create mode 100644 DbFirst.Domain/DbFirst.Domain.csproj create mode 100644 DbFirst.Domain/DomainEntities/Catalog.cs create mode 100644 DbFirst.Domain/Repositories/ICatalogRepository.cs create mode 100644 DbFirst.Infrastructure/ApplicationDbContext.cs create mode 100644 DbFirst.Infrastructure/DbFirst.Infrastructure.csproj create mode 100644 DbFirst.Infrastructure/Mappings/CatalogInfrastructureProfile.cs create mode 100644 DbFirst.Infrastructure/Repositories/CatalogRepository.cs create mode 100644 DbFirst.Infrastructure/ScaffoldEntities/TbmyCatalog.cs create mode 100644 DbFirst.sln create mode 100644 NuGet.config diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/DbFirst.API/Controllers/CatalogsController.cs b/DbFirst.API/Controllers/CatalogsController.cs new file mode 100644 index 0000000..2d2bea9 --- /dev/null +++ b/DbFirst.API/Controllers/CatalogsController.cs @@ -0,0 +1,63 @@ +using DbFirst.Application.Catalogs; +using Microsoft.AspNetCore.Mvc; + +namespace DbFirst.API.Controllers; + +[ApiController] +[Route("api/[controller]")] +public class CatalogsController : ControllerBase +{ + private readonly ICatalogService _service; + + public CatalogsController(ICatalogService service) + { + _service = service; + } + + [HttpGet] + public async Task>> GetAll(CancellationToken cancellationToken) + { + var result = await _service.GetAllAsync(cancellationToken); + return Ok(result); + } + + [HttpGet("{id:int}")] + public async Task> GetById(int id, CancellationToken cancellationToken) + { + var result = await _service.GetByIdAsync(id, cancellationToken); + if (result == null) + { + return NotFound(); + } + return Ok(result); + } + + [HttpPost] + public async Task> Create(CatalogDto dto, CancellationToken cancellationToken) + { + var created = await _service.CreateAsync(dto, cancellationToken); + return CreatedAtAction(nameof(GetById), new { id = created.Guid }, created); + } + + [HttpPut("{id:int}")] + public async Task Update(int id, CatalogDto dto, CancellationToken cancellationToken) + { + var updated = await _service.UpdateAsync(id, dto, cancellationToken); + if (!updated) + { + return NotFound(); + } + return NoContent(); + } + + [HttpDelete("{id:int}")] + public async Task Delete(int id, CancellationToken cancellationToken) + { + var deleted = await _service.DeleteAsync(id, cancellationToken); + if (!deleted) + { + return NotFound(); + } + return NoContent(); + } +} diff --git a/DbFirst.API/DbFirst.API.csproj b/DbFirst.API/DbFirst.API.csproj new file mode 100644 index 0000000..3e25a22 --- /dev/null +++ b/DbFirst.API/DbFirst.API.csproj @@ -0,0 +1,27 @@ + + + + net8.0 + enable + enable + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + diff --git a/DbFirst.API/DbFirst.API.http b/DbFirst.API/DbFirst.API.http new file mode 100644 index 0000000..5d1d794 --- /dev/null +++ b/DbFirst.API/DbFirst.API.http @@ -0,0 +1,6 @@ +@DbFirst.API_HostAddress = http://localhost:5131 + +GET {{DbFirst.API_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/DbFirst.API/Program.cs b/DbFirst.API/Program.cs new file mode 100644 index 0000000..90fc64e --- /dev/null +++ b/DbFirst.API/Program.cs @@ -0,0 +1,38 @@ +using AutoMapper; +using DbFirst.Application.Catalogs; +using DbFirst.Domain.Repositories; +using DbFirst.Infrastructure; +using DbFirst.Infrastructure.Repositories; +using Microsoft.EntityFrameworkCore; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddControllers(); +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +builder.Services.AddDbContext(options => + options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); + +builder.Services.AddAutoMapper(typeof(CatalogProfile).Assembly, typeof(ApplicationDbContext).Assembly); + +builder.Services.AddScoped(); +builder.Services.AddScoped(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/DbFirst.API/Properties/launchSettings.json b/DbFirst.API/Properties/launchSettings.json new file mode 100644 index 0000000..6cce69a --- /dev/null +++ b/DbFirst.API/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:27897", + "sslPort": 44349 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5131", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7204;http://localhost:5131", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/DbFirst.API/appsettings.Development.json b/DbFirst.API/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DbFirst.API/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/DbFirst.API/appsettings.json b/DbFirst.API/appsettings.json new file mode 100644 index 0000000..7561326 --- /dev/null +++ b/DbFirst.API/appsettings.json @@ -0,0 +1,12 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;TrustServerCertificate=True;" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/DbFirst.Application/Catalogs/CatalogDto.cs b/DbFirst.Application/Catalogs/CatalogDto.cs new file mode 100644 index 0000000..4688dbb --- /dev/null +++ b/DbFirst.Application/Catalogs/CatalogDto.cs @@ -0,0 +1,12 @@ +namespace DbFirst.Application.Catalogs; + +public class CatalogDto +{ + 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; } +} diff --git a/DbFirst.Application/Catalogs/CatalogProfile.cs b/DbFirst.Application/Catalogs/CatalogProfile.cs new file mode 100644 index 0000000..ce08744 --- /dev/null +++ b/DbFirst.Application/Catalogs/CatalogProfile.cs @@ -0,0 +1,12 @@ +using AutoMapper; +using DbFirst.Domain.DomainEntities; + +namespace DbFirst.Application.Catalogs; + +public class CatalogProfile : Profile +{ + public CatalogProfile() + { + CreateMap().ReverseMap(); + } +} diff --git a/DbFirst.Application/Catalogs/CatalogService.cs b/DbFirst.Application/Catalogs/CatalogService.cs new file mode 100644 index 0000000..4690387 --- /dev/null +++ b/DbFirst.Application/Catalogs/CatalogService.cs @@ -0,0 +1,47 @@ +using AutoMapper; +using DbFirst.Domain.DomainEntities; +using DbFirst.Domain.Repositories; + +namespace DbFirst.Application.Catalogs; + +public class CatalogService : ICatalogService +{ + private readonly ICatalogRepository _repository; + private readonly IMapper _mapper; + + public CatalogService(ICatalogRepository repository, IMapper mapper) + { + _repository = repository; + _mapper = mapper; + } + + public async Task> GetAllAsync(CancellationToken cancellationToken = default) + { + var domainItems = await _repository.GetAllAsync(cancellationToken); + return _mapper.Map>(domainItems); + } + + public async Task GetByIdAsync(int id, CancellationToken cancellationToken = default) + { + var domainItem = await _repository.GetByIdAsync(id, cancellationToken); + return domainItem == null ? null : _mapper.Map(domainItem); + } + + public async Task CreateAsync(CatalogDto dto, CancellationToken cancellationToken = default) + { + var domainItem = _mapper.Map(dto); + var created = await _repository.AddAsync(domainItem, cancellationToken); + return _mapper.Map(created); + } + + public async Task UpdateAsync(int id, CatalogDto dto, CancellationToken cancellationToken = default) + { + var domainItem = _mapper.Map(dto); + return await _repository.UpdateAsync(id, domainItem, cancellationToken); + } + + public async Task DeleteAsync(int id, CancellationToken cancellationToken = default) + { + return await _repository.DeleteAsync(id, cancellationToken); + } +} diff --git a/DbFirst.Application/Catalogs/ICatalogService.cs b/DbFirst.Application/Catalogs/ICatalogService.cs new file mode 100644 index 0000000..24101b0 --- /dev/null +++ b/DbFirst.Application/Catalogs/ICatalogService.cs @@ -0,0 +1,10 @@ +namespace DbFirst.Application.Catalogs; + +public interface ICatalogService +{ + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task GetByIdAsync(int id, CancellationToken cancellationToken = default); + Task CreateAsync(CatalogDto dto, CancellationToken cancellationToken = default); + Task UpdateAsync(int id, CatalogDto dto, CancellationToken cancellationToken = default); + Task DeleteAsync(int id, CancellationToken cancellationToken = default); +} diff --git a/DbFirst.Application/DbFirst.Application.csproj b/DbFirst.Application/DbFirst.Application.csproj new file mode 100644 index 0000000..418b461 --- /dev/null +++ b/DbFirst.Application/DbFirst.Application.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + diff --git a/DbFirst.Domain/DbFirst.Domain.csproj b/DbFirst.Domain/DbFirst.Domain.csproj new file mode 100644 index 0000000..4078f60 --- /dev/null +++ b/DbFirst.Domain/DbFirst.Domain.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/DbFirst.Domain/DomainEntities/Catalog.cs b/DbFirst.Domain/DomainEntities/Catalog.cs new file mode 100644 index 0000000..efbde28 --- /dev/null +++ b/DbFirst.Domain/DomainEntities/Catalog.cs @@ -0,0 +1,12 @@ +namespace DbFirst.Domain.DomainEntities; + +public class Catalog +{ + 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; } +} diff --git a/DbFirst.Domain/Repositories/ICatalogRepository.cs b/DbFirst.Domain/Repositories/ICatalogRepository.cs new file mode 100644 index 0000000..92e3dfd --- /dev/null +++ b/DbFirst.Domain/Repositories/ICatalogRepository.cs @@ -0,0 +1,12 @@ +using DbFirst.Domain.DomainEntities; + +namespace DbFirst.Domain.Repositories; + +public interface ICatalogRepository +{ + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task GetByIdAsync(int id, CancellationToken cancellationToken = default); + Task AddAsync(Catalog catalog, CancellationToken cancellationToken = default); + Task UpdateAsync(int id, Catalog catalog, CancellationToken cancellationToken = default); + Task DeleteAsync(int id, CancellationToken cancellationToken = default); +} diff --git a/DbFirst.Infrastructure/ApplicationDbContext.cs b/DbFirst.Infrastructure/ApplicationDbContext.cs new file mode 100644 index 0000000..6c15cc8 --- /dev/null +++ b/DbFirst.Infrastructure/ApplicationDbContext.cs @@ -0,0 +1,56 @@ +using DbFirst.Infrastructure.ScaffoldEntities; +using Microsoft.EntityFrameworkCore; + +namespace DbFirst.Infrastructure; + +public partial class ApplicationDbContext : DbContext +{ + public ApplicationDbContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet TbmyCatalogs { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Guid); + + entity.ToTable("TBMY_CATALOG"); + + entity.HasIndex(e => e.CatTitle, "UQ_TBMY_CATALOG_TITLE").IsUnique(); + + entity.Property(e => e.Guid).HasColumnName("GUID"); + entity.Property(e => e.AddedWhen) + .HasDefaultValueSql("(getdate())") + .HasColumnType("datetime") + .HasColumnName("ADDED_WHEN"); + entity.Property(e => e.AddedWho) + .HasMaxLength(30) + .IsUnicode(false) + .HasDefaultValue("SYSTEM") + .HasColumnName("ADDED_WHO"); + entity.Property(e => e.CatString) + .HasMaxLength(900) + .IsUnicode(false) + .HasColumnName("CAT_STRING"); + entity.Property(e => e.CatTitle) + .HasMaxLength(100) + .IsUnicode(false) + .HasColumnName("CAT_TITLE"); + entity.Property(e => e.ChangedWhen) + .HasColumnType("datetime") + .HasColumnName("CHANGED_WHEN"); + entity.Property(e => e.ChangedWho) + .HasMaxLength(30) + .IsUnicode(false) + .HasColumnName("CHANGED_WHO"); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +} diff --git a/DbFirst.Infrastructure/DbFirst.Infrastructure.csproj b/DbFirst.Infrastructure/DbFirst.Infrastructure.csproj new file mode 100644 index 0000000..e9c23bf --- /dev/null +++ b/DbFirst.Infrastructure/DbFirst.Infrastructure.csproj @@ -0,0 +1,23 @@ + + + + net8.0 + enable + enable + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/DbFirst.Infrastructure/Mappings/CatalogInfrastructureProfile.cs b/DbFirst.Infrastructure/Mappings/CatalogInfrastructureProfile.cs new file mode 100644 index 0000000..12f5e0e --- /dev/null +++ b/DbFirst.Infrastructure/Mappings/CatalogInfrastructureProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; +using DbFirst.Domain.DomainEntities; +using DbFirst.Infrastructure.ScaffoldEntities; + +namespace DbFirst.Infrastructure.Mappings; + +public class CatalogInfrastructureProfile : Profile +{ + public CatalogInfrastructureProfile() + { + CreateMap().ReverseMap(); + } +} diff --git a/DbFirst.Infrastructure/Repositories/CatalogRepository.cs b/DbFirst.Infrastructure/Repositories/CatalogRepository.cs new file mode 100644 index 0000000..f209804 --- /dev/null +++ b/DbFirst.Infrastructure/Repositories/CatalogRepository.cs @@ -0,0 +1,66 @@ +using AutoMapper; +using DbFirst.Domain.DomainEntities; +using DbFirst.Domain.Repositories; +using DbFirst.Infrastructure.ScaffoldEntities; +using Microsoft.EntityFrameworkCore; + +namespace DbFirst.Infrastructure.Repositories; + +public class CatalogRepository : ICatalogRepository +{ + private readonly ApplicationDbContext _db; + private readonly IMapper _mapper; + + public CatalogRepository(ApplicationDbContext db, IMapper mapper) + { + _db = db; + _mapper = mapper; + } + + public async Task> GetAllAsync(CancellationToken cancellationToken = default) + { + var entities = await _db.TbmyCatalogs.AsNoTracking().ToListAsync(cancellationToken); + return _mapper.Map>(entities); + } + + public async Task GetByIdAsync(int id, CancellationToken cancellationToken = default) + { + var entity = await _db.TbmyCatalogs.AsNoTracking().FirstOrDefaultAsync(x => x.Guid == id, cancellationToken); + return entity == null ? null : _mapper.Map(entity); + } + + public async Task AddAsync(Catalog catalog, CancellationToken cancellationToken = default) + { + var entity = _mapper.Map(catalog); + _db.TbmyCatalogs.Add(entity); + await _db.SaveChangesAsync(cancellationToken); + return _mapper.Map(entity); + } + + public async Task UpdateAsync(int id, Catalog catalog, CancellationToken cancellationToken = default) + { + var entity = await _db.TbmyCatalogs.FirstOrDefaultAsync(x => x.Guid == id, cancellationToken); + if (entity == null) + { + return false; + } + + _mapper.Map(catalog, entity); + entity.Guid = id; + await _db.SaveChangesAsync(cancellationToken); + return true; + } + + public async Task DeleteAsync(int id, CancellationToken cancellationToken = default) + { + var entity = await _db.TbmyCatalogs.FirstOrDefaultAsync(x => x.Guid == id, cancellationToken); + if (entity == null) + { + return false; + } + + _db.TbmyCatalogs.Remove(entity); + await _db.SaveChangesAsync(cancellationToken); + return true; + } +} diff --git a/DbFirst.Infrastructure/ScaffoldEntities/TbmyCatalog.cs b/DbFirst.Infrastructure/ScaffoldEntities/TbmyCatalog.cs new file mode 100644 index 0000000..625f208 --- /dev/null +++ b/DbFirst.Infrastructure/ScaffoldEntities/TbmyCatalog.cs @@ -0,0 +1,24 @@ +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 Non‑Nullable-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. +} diff --git a/DbFirst.sln b/DbFirst.sln new file mode 100644 index 0000000..2be8e42 --- /dev/null +++ b/DbFirst.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36804.6 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.API", "DbFirst.API\DbFirst.API.csproj", "{01A1D6C0-CEF6-4E90-A23D-B8594B72D8D2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.Application", "DbFirst.Application\DbFirst.Application.csproj", "{5FDD6C63-CFC3-48AD-9857-4AAA4C97D6D0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.Infrastructure", "DbFirst.Infrastructure\DbFirst.Infrastructure.csproj", "{16377B21-372D-438D-93F9-EBBA84E7CC73}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbFirst.Domain", "DbFirst.Domain\DbFirst.Domain.csproj", "{E989468B-CBF1-49F4-954E-4FFEE7CE5A77}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {01A1D6C0-CEF6-4E90-A23D-B8594B72D8D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {01A1D6C0-CEF6-4E90-A23D-B8594B72D8D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {01A1D6C0-CEF6-4E90-A23D-B8594B72D8D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {01A1D6C0-CEF6-4E90-A23D-B8594B72D8D2}.Release|Any CPU.Build.0 = Release|Any CPU + {5FDD6C63-CFC3-48AD-9857-4AAA4C97D6D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5FDD6C63-CFC3-48AD-9857-4AAA4C97D6D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FDD6C63-CFC3-48AD-9857-4AAA4C97D6D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5FDD6C63-CFC3-48AD-9857-4AAA4C97D6D0}.Release|Any CPU.Build.0 = Release|Any CPU + {16377B21-372D-438D-93F9-EBBA84E7CC73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16377B21-372D-438D-93F9-EBBA84E7CC73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16377B21-372D-438D-93F9-EBBA84E7CC73}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16377B21-372D-438D-93F9-EBBA84E7CC73}.Release|Any CPU.Build.0 = Release|Any CPU + {E989468B-CBF1-49F4-954E-4FFEE7CE5A77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E989468B-CBF1-49F4-954E-4FFEE7CE5A77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E989468B-CBF1-49F4-954E-4FFEE7CE5A77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E989468B-CBF1-49F4-954E-4FFEE7CE5A77}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {17F5E3D8-8F34-4A46-ACEB-DF4BBA46AB0E} + EndGlobalSection +EndGlobal diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 0000000..5ef1762 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,9 @@ + + + + + + + + +