Forráskód Böngészése

restructure Project

Florian Morel 3 éve
szülő
commit
8e972eff2b
60 módosított fájl, 1288 hozzáadás és 1027 törlés
  1. 9 0
      .gitignore
  2. 77 0
      Dotnet/DataLayer/AbstractRepository.cs
  3. 33 0
      Dotnet/DataLayer/DataLayer.csproj
  4. 43 0
      Dotnet/DataLayer/DbContextInitializer.cs
  5. 34 0
      Dotnet/DataLayer/DeathwatchDbContext.cs
  6. 20 0
      Dotnet/DataLayer/Interfaces/IAbstractRepository.cs
  7. 7 0
      Dotnet/DataLayer/Interfaces/IPlayerRepository.cs
  8. 44 32
      Dotnet/Warhammer/Migrations/20220922082312_newMigration.Designer.cs
  9. 108 0
      Dotnet/DataLayer/Migrations/20230106171505_InitialCreate.cs
  10. 41 30
      Dotnet/Warhammer/Migrations/DeathwatchDbContextModelSnapshot.cs
  11. 14 0
      Dotnet/DataLayer/PlayerRepository.cs
  12. 11 0
      Dotnet/Domain/BaseEntity.cs
  13. 13 0
      Dotnet/Domain/Domain.csproj
  14. 38 0
      Dotnet/Domain/Enum/Enum.cs
  15. 80 0
      Dotnet/Domain/Player.cs
  16. 29 0
      Dotnet/Domain/Weapons/Bolter.cs
  17. 22 0
      Dotnet/Domain/Weapons/FlameThrower.cs
  18. 31 0
      Dotnet/Domain/Weapons/Sword.cs
  19. 30 0
      Dotnet/Domain/Weapons/Weapon.cs
  20. 20 0
      Dotnet/Infrastructure/DiceService.cs
  21. 17 0
      Dotnet/Infrastructure/Infrastructure.csproj
  22. 11 0
      Dotnet/Infrastructure/Utilities.cs
  23. 20 0
      Dotnet/Services/Interfaces/IPlayerService.cs
  24. 69 0
      Dotnet/Services/PlayerService.cs
  25. 15 0
      Dotnet/Services/Services.csproj
  26. 26 2
      Dotnet/Warhammer.sln
  27. 24 27
      Dotnet/Warhammer/Controllers/HomeController.cs
  28. 42 35
      Dotnet/Warhammer/Controllers/Players/PlayerController.cs
  29. 0 81
      Dotnet/Warhammer/DataLayer/AbstractRepository.cs
  30. 0 46
      Dotnet/Warhammer/DataLayer/DbContextInitializer.cs
  31. 0 26
      Dotnet/Warhammer/DataLayer/DeathwatchDbContext.cs
  32. 0 26
      Dotnet/Warhammer/DataLayer/Interfaces/IAbstractRepository.cs
  33. 0 8
      Dotnet/Warhammer/DataLayer/Interfaces/IPlayerRepository.cs
  34. 0 14
      Dotnet/Warhammer/DataLayer/PlayerRepository.cs
  35. 0 102
      Dotnet/Warhammer/Migrations/20220922082312_newMigration.cs
  36. 0 14
      Dotnet/Warhammer/Models/BaseEntity.cs
  37. 0 39
      Dotnet/Warhammer/Models/Enum/Enum.cs
  38. 5 6
      Dotnet/Warhammer/Models/ErrorViewModel.cs
  39. 0 45
      Dotnet/Warhammer/Models/Player.cs
  40. 0 17
      Dotnet/Warhammer/Models/Utilities.cs
  41. 0 36
      Dotnet/Warhammer/Models/Weapons/Bolter.cs
  42. 0 28
      Dotnet/Warhammer/Models/Weapons/FlameThrower.cs
  43. 0 38
      Dotnet/Warhammer/Models/Weapons/Sword.cs
  44. 0 34
      Dotnet/Warhammer/Models/Weapons/Weapon.cs
  45. 28 26
      Dotnet/Warhammer/Program.cs
  46. 1 1
      Dotnet/Warhammer/Properties/PublishProfiles/DeathwatchWebApp - Web Deploy.pubxml.user
  47. 84 0
      Dotnet/Warhammer/Properties/ServiceDependencies/DeathwatchWebApp - Web Deploy/mssql1.arm.json
  48. 12 6
      Dotnet/Warhammer/Properties/ServiceDependencies/DeathwatchWebApp - Web Deploy/profile.arm.json
  49. 11 0
      Dotnet/Warhammer/Properties/serviceDependencies.DeathwatchWebApp - Web Deploy.json
  50. 20 0
      Dotnet/Warhammer/Properties/serviceDependencies.DeathwatchWebApp - Web Deploy.json.user
  51. 8 0
      Dotnet/Warhammer/Properties/serviceDependencies.json
  52. 0 30
      Dotnet/Warhammer/Service/DiceService.cs
  53. 0 24
      Dotnet/Warhammer/Service/Interfaces/IPlayerService.cs
  54. 0 66
      Dotnet/Warhammer/Service/PlayerService.cs
  55. 54 59
      Dotnet/Warhammer/Startup.cs
  56. 35 35
      Dotnet/Warhammer/Views/Shared/Players/PlayerDetail.cshtml
  57. 84 83
      Dotnet/Warhammer/Views/Shared/Players/PlayerListView.cshtml
  58. 15 9
      Dotnet/Warhammer/Warhammer.csproj
  59. 1 1
      Dotnet/Warhammer/Warhammer.csproj.user
  60. 2 1
      Dotnet/Warhammer/appsettings.json

+ 9 - 0
.gitignore

@@ -9,3 +9,12 @@ __pycache__
 /Dotnet/Warhammer/wwwroot
 /Dotnet/.vs/Warhammer
 /Dotnet/Warhammer/bin/Release/netcoreapp3.1
+/Dotnet/DataLayer/bin/Debug/net6.0
+/Dotnet/DataLayer/obj
+/Dotnet/Domain/bin/Debug/net6.0
+/Dotnet/Domain/obj
+/Dotnet/Infrastructure/bin/Debug/net6.0
+/Dotnet/Infrastructure/obj
+/Dotnet/Services/bin/Debug/net6.0
+/Dotnet/Services/obj
+/Dotnet/Warhammer/bin/Debug/net6.0

+ 77 - 0
Dotnet/DataLayer/AbstractRepository.cs

@@ -0,0 +1,77 @@
+using System.Linq.Expressions;
+using DataLayer.Interfaces;
+using Domain;
+using Microsoft.EntityFrameworkCore;
+
+namespace DataLayer;
+
+public class AbstractRepository<T> : IAbstractRepository<T> where T : BaseEntity
+{
+    #region Fields
+
+    private readonly DeathwatchDbContext _deathwatchDbContext;
+    private readonly DbSet<T> _entities;
+
+    #endregion
+
+    public AbstractRepository(DeathwatchDbContext deathwatchDbContext)
+    {
+        _deathwatchDbContext = deathwatchDbContext;
+        _entities = _deathwatchDbContext.Set<T>();
+    }
+
+    #region Public Methods
+
+    public async Task<T> GetById(int id)
+    {
+        return await _entities.FindAsync(id);
+    }
+
+    public async Task<T> FirstOrDefault(Expression<Func<T, bool>> predicate)
+    {
+        var entity = await _entities.FirstOrDefaultAsync(predicate);
+        return entity;
+    }
+
+    public async Task Add(T entity)
+    {
+        await _entities.AddAsync(entity);
+        await _deathwatchDbContext.SaveChangesAsync();
+    }
+
+    public Task Update(T entity)
+    {
+        // In case AsNoTracking is used
+        _deathwatchDbContext.Entry(entity).State = EntityState.Modified;
+        return _deathwatchDbContext.SaveChangesAsync();
+    }
+
+    public Task Remove(T entity)
+    {
+        _entities.Remove(entity);
+        return _deathwatchDbContext.SaveChangesAsync();
+    }
+
+    public async Task<IEnumerable<T>> GetAll()
+    {
+        var entries = await _entities.ToListAsync();
+        return entries;
+    }
+
+    public async Task<IEnumerable<T>> GetWhere(Expression<Func<T, bool>> predicate)
+    {
+        return await _entities.Where(predicate).ToListAsync();
+    }
+
+    public Task<int> CountAll()
+    {
+        return _entities.CountAsync();
+    }
+
+    public Task<int> CountWhere(Expression<Func<T, bool>> predicate)
+    {
+        return _entities.CountAsync(predicate);
+    }
+
+    #endregion
+}

+ 33 - 0
Dotnet/DataLayer/DataLayer.csproj

@@ -0,0 +1,33 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.1">
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Domain\Domain.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="Migrations\" />
+  </ItemGroup>
+
+</Project>

+ 43 - 0
Dotnet/DataLayer/DbContextInitializer.cs

@@ -0,0 +1,43 @@
+using Domain;
+using Domain.Weapons;
+
+namespace DataLayer;
+
+public static class DbContextInitializer
+{
+    public static void Initialize(DeathwatchDbContext context)
+    {
+        context.Database.EnsureCreated();
+
+        // Look for any students.
+        if (context.Players.Any()) return; // DB has been seeded
+
+        var weapon = new Weapon
+        {
+            At = "test",
+            Range = 30,
+            Attribute = "CT",
+            Type = "RANGE"
+        };
+
+        var players = new[]
+        {
+            new Player
+            {
+                Experience = 17400,
+                CC = 52,
+                CT = 40,
+                F = 46,
+                E = 45,
+                AG = 50,
+                INT = 34,
+                PER = 43,
+                FM = 43,
+                SOC = 40,
+                Weapons = new List<Weapon> { weapon }
+            }
+        };
+        foreach (var player in players) context.Players.Add(player);
+        context.SaveChanges();
+    }
+}

+ 34 - 0
Dotnet/DataLayer/DeathwatchDbContext.cs

@@ -0,0 +1,34 @@
+using Domain;
+using Domain.Weapons;
+using Microsoft.EntityFrameworkCore;
+
+namespace DataLayer;
+
+public class DeathwatchDbContext : DbContext
+{
+    public DbSet<Player> Players { get; set; }
+    public DbSet<Weapon> Weapons { get; set; }
+
+    public DeathwatchDbContext() : base()
+    {
+    }
+
+    public DeathwatchDbContext(DbContextOptions<DeathwatchDbContext> options) : base(options)
+    {
+    }
+
+    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+    {
+        if (!optionsBuilder.IsConfigured)
+        {
+            //optionsBuilder.UseSqlServer("Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=ReadersDB");
+        }
+    }
+
+
+    protected override void OnModelCreating(ModelBuilder modelBuilder)
+    {
+        modelBuilder.Entity<Player>().HasMany(s => s.Weapons);
+        modelBuilder.Entity<Weapon>().HasMany(w => w.Players);
+    }
+}

+ 20 - 0
Dotnet/DataLayer/Interfaces/IAbstractRepository.cs

@@ -0,0 +1,20 @@
+using System.Linq.Expressions;
+using Domain;
+
+namespace DataLayer.Interfaces;
+
+public interface IAbstractRepository<T> where T : BaseEntity
+{
+    Task<T> GetById(int id);
+    Task<T> FirstOrDefault(Expression<Func<T, bool>> predicate);
+
+    Task Add(T entity);
+    Task Update(T entity);
+    Task Remove(T entity);
+
+    Task<IEnumerable<T>> GetAll();
+    Task<IEnumerable<T>> GetWhere(Expression<Func<T, bool>> predicate);
+
+    Task<int> CountAll();
+    Task<int> CountWhere(Expression<Func<T, bool>> predicate);
+}

+ 7 - 0
Dotnet/DataLayer/Interfaces/IPlayerRepository.cs

@@ -0,0 +1,7 @@
+using Domain;
+
+namespace DataLayer.Interfaces;
+
+public interface IPlayerRepository : IAbstractRepository<Player>
+{
+}

+ 44 - 32
Dotnet/Warhammer/Migrations/20220922082312_newMigration.Designer.cs

@@ -1,32 +1,37 @@
 // <auto-generated />
 using System;
+using DataLayer;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Infrastructure;
 using Microsoft.EntityFrameworkCore.Metadata;
 using Microsoft.EntityFrameworkCore.Migrations;
 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Warhammer.DataLayer;
 
-namespace Warhammer.Migrations
+#nullable disable
+
+namespace DataLayer.Migrations
 {
     [DbContext(typeof(DeathwatchDbContext))]
-    [Migration("20220922082312_newMigration")]
-    partial class newMigration
+    [Migration("20230106171505_InitialCreate")]
+    partial class InitialCreate
     {
+        /// <inheritdoc />
         protected override void BuildTargetModel(ModelBuilder modelBuilder)
         {
 #pragma warning disable 612, 618
             modelBuilder
-                .HasAnnotation("ProductVersion", "3.1.0")
-                .HasAnnotation("Relational:MaxIdentifierLength", 128)
-                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+                .HasAnnotation("ProductVersion", "7.0.1")
+                .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
 
-            modelBuilder.Entity("Warhammer.Models.Player", b =>
+            modelBuilder.Entity("Domain.Player", b =>
                 {
                     b.Property<int>("Id")
                         .ValueGeneratedOnAdd()
-                        .HasColumnType("int")
-                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+                        .HasColumnType("int");
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
 
                     b.Property<int>("AG")
                         .HasColumnType("int");
@@ -76,22 +81,18 @@ namespace Warhammer.Migrations
                     b.Property<int>("SOC")
                         .HasColumnType("int");
 
-                    b.Property<int?>("WeaponId")
-                        .HasColumnType("int");
-
                     b.HasKey("Id");
 
-                    b.HasIndex("WeaponId");
-
                     b.ToTable("Players");
                 });
 
-            modelBuilder.Entity("Warhammer.Models.Weapons.Weapon", b =>
+            modelBuilder.Entity("Domain.Weapons.Weapon", b =>
                 {
                     b.Property<int>("Id")
                         .ValueGeneratedOnAdd()
-                        .HasColumnType("int")
-                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+                        .HasColumnType("int");
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
 
                     b.Property<string>("At")
                         .HasColumnType("nvarchar(max)");
@@ -117,9 +118,6 @@ namespace Warhammer.Migrations
                     b.Property<int>("Pene")
                         .HasColumnType("int");
 
-                    b.Property<int?>("PlayerId")
-                        .HasColumnType("int");
-
                     b.Property<int>("Range")
                         .HasColumnType("int");
 
@@ -131,23 +129,37 @@ namespace Warhammer.Migrations
 
                     b.HasKey("Id");
 
-                    b.HasIndex("PlayerId");
-
-                    b.ToTable("Weapon");
+                    b.ToTable("Weapons");
                 });
 
-            modelBuilder.Entity("Warhammer.Models.Player", b =>
+            modelBuilder.Entity("PlayerWeapon", b =>
                 {
-                    b.HasOne("Warhammer.Models.Weapons.Weapon", null)
-                        .WithMany("Players")
-                        .HasForeignKey("WeaponId");
+                    b.Property<int>("PlayersId")
+                        .HasColumnType("int");
+
+                    b.Property<int>("WeaponsId")
+                        .HasColumnType("int");
+
+                    b.HasKey("PlayersId", "WeaponsId");
+
+                    b.HasIndex("WeaponsId");
+
+                    b.ToTable("PlayerWeapon");
                 });
 
-            modelBuilder.Entity("Warhammer.Models.Weapons.Weapon", b =>
+            modelBuilder.Entity("PlayerWeapon", b =>
                 {
-                    b.HasOne("Warhammer.Models.Player", null)
-                        .WithMany("Weapons")
-                        .HasForeignKey("PlayerId");
+                    b.HasOne("Domain.Player", null)
+                        .WithMany()
+                        .HasForeignKey("PlayersId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Domain.Weapons.Weapon", null)
+                        .WithMany()
+                        .HasForeignKey("WeaponsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
                 });
 #pragma warning restore 612, 618
         }

+ 108 - 0
Dotnet/DataLayer/Migrations/20230106171505_InitialCreate.cs

@@ -0,0 +1,108 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace DataLayer.Migrations
+{
+    /// <inheritdoc />
+    public partial class InitialCreate : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "Players",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    CharacterName = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Background = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Experience = table.Column<int>(type: "int", nullable: false),
+                    CC = table.Column<int>(type: "int", nullable: false),
+                    CT = table.Column<int>(type: "int", nullable: false),
+                    F = table.Column<int>(type: "int", nullable: false),
+                    E = table.Column<int>(type: "int", nullable: false),
+                    AG = table.Column<int>(type: "int", nullable: false),
+                    INT = table.Column<int>(type: "int", nullable: false),
+                    PER = table.Column<int>(type: "int", nullable: false),
+                    FM = table.Column<int>(type: "int", nullable: false),
+                    SOC = table.Column<int>(type: "int", nullable: false),
+                    MF = table.Column<int>(type: "int", nullable: false),
+                    CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    ModifiedDate = table.Column<DateTime>(type: "datetime2", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Players", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Weapons",
+                columns: table => new
+                {
+                    Id = table.Column<int>(type: "int", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Range = table.Column<int>(type: "int", nullable: false),
+                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    GPE = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Pene = table.Column<int>(type: "int", nullable: false),
+                    Mode = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    At = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Rch = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Attribute = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    ModifiedDate = table.Column<DateTime>(type: "datetime2", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Weapons", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "PlayerWeapon",
+                columns: table => new
+                {
+                    PlayersId = table.Column<int>(type: "int", nullable: false),
+                    WeaponsId = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_PlayerWeapon", x => new { x.PlayersId, x.WeaponsId });
+                    table.ForeignKey(
+                        name: "FK_PlayerWeapon_Players_PlayersId",
+                        column: x => x.PlayersId,
+                        principalTable: "Players",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_PlayerWeapon_Weapons_WeaponsId",
+                        column: x => x.WeaponsId,
+                        principalTable: "Weapons",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PlayerWeapon_WeaponsId",
+                table: "PlayerWeapon",
+                column: "WeaponsId");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "PlayerWeapon");
+
+            migrationBuilder.DropTable(
+                name: "Players");
+
+            migrationBuilder.DropTable(
+                name: "Weapons");
+        }
+    }
+}

+ 41 - 30
Dotnet/Warhammer/Migrations/DeathwatchDbContextModelSnapshot.cs

@@ -1,12 +1,14 @@
 // <auto-generated />
 using System;
+using DataLayer;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Infrastructure;
 using Microsoft.EntityFrameworkCore.Metadata;
 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Warhammer.DataLayer;
 
-namespace Warhammer.Migrations
+#nullable disable
+
+namespace DataLayer.Migrations
 {
     [DbContext(typeof(DeathwatchDbContext))]
     partial class DeathwatchDbContextModelSnapshot : ModelSnapshot
@@ -15,16 +17,18 @@ namespace Warhammer.Migrations
         {
 #pragma warning disable 612, 618
             modelBuilder
-                .HasAnnotation("ProductVersion", "3.1.0")
-                .HasAnnotation("Relational:MaxIdentifierLength", 128)
-                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+                .HasAnnotation("ProductVersion", "7.0.1")
+                .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
 
-            modelBuilder.Entity("Warhammer.Models.Player", b =>
+            modelBuilder.Entity("Domain.Player", b =>
                 {
                     b.Property<int>("Id")
                         .ValueGeneratedOnAdd()
-                        .HasColumnType("int")
-                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+                        .HasColumnType("int");
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
 
                     b.Property<int>("AG")
                         .HasColumnType("int");
@@ -74,22 +78,18 @@ namespace Warhammer.Migrations
                     b.Property<int>("SOC")
                         .HasColumnType("int");
 
-                    b.Property<int?>("WeaponId")
-                        .HasColumnType("int");
-
                     b.HasKey("Id");
 
-                    b.HasIndex("WeaponId");
-
                     b.ToTable("Players");
                 });
 
-            modelBuilder.Entity("Warhammer.Models.Weapons.Weapon", b =>
+            modelBuilder.Entity("Domain.Weapons.Weapon", b =>
                 {
                     b.Property<int>("Id")
                         .ValueGeneratedOnAdd()
-                        .HasColumnType("int")
-                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+                        .HasColumnType("int");
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
 
                     b.Property<string>("At")
                         .HasColumnType("nvarchar(max)");
@@ -115,9 +115,6 @@ namespace Warhammer.Migrations
                     b.Property<int>("Pene")
                         .HasColumnType("int");
 
-                    b.Property<int?>("PlayerId")
-                        .HasColumnType("int");
-
                     b.Property<int>("Range")
                         .HasColumnType("int");
 
@@ -129,23 +126,37 @@ namespace Warhammer.Migrations
 
                     b.HasKey("Id");
 
-                    b.HasIndex("PlayerId");
-
-                    b.ToTable("Weapon");
+                    b.ToTable("Weapons");
                 });
 
-            modelBuilder.Entity("Warhammer.Models.Player", b =>
+            modelBuilder.Entity("PlayerWeapon", b =>
                 {
-                    b.HasOne("Warhammer.Models.Weapons.Weapon", null)
-                        .WithMany("Players")
-                        .HasForeignKey("WeaponId");
+                    b.Property<int>("PlayersId")
+                        .HasColumnType("int");
+
+                    b.Property<int>("WeaponsId")
+                        .HasColumnType("int");
+
+                    b.HasKey("PlayersId", "WeaponsId");
+
+                    b.HasIndex("WeaponsId");
+
+                    b.ToTable("PlayerWeapon");
                 });
 
-            modelBuilder.Entity("Warhammer.Models.Weapons.Weapon", b =>
+            modelBuilder.Entity("PlayerWeapon", b =>
                 {
-                    b.HasOne("Warhammer.Models.Player", null)
-                        .WithMany("Weapons")
-                        .HasForeignKey("PlayerId");
+                    b.HasOne("Domain.Player", null)
+                        .WithMany()
+                        .HasForeignKey("PlayersId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Domain.Weapons.Weapon", null)
+                        .WithMany()
+                        .HasForeignKey("WeaponsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
                 });
 #pragma warning restore 612, 618
         }

+ 14 - 0
Dotnet/DataLayer/PlayerRepository.cs

@@ -0,0 +1,14 @@
+using DataLayer.Interfaces;
+using Domain;
+
+namespace DataLayer;
+
+public class PlayerRepository : AbstractRepository<Player>, IPlayerRepository
+{
+    private readonly DeathwatchDbContext _deathwatchDbContext;
+
+    public PlayerRepository(DeathwatchDbContext deathwatchDbContext) : base(deathwatchDbContext)
+    {
+        _deathwatchDbContext = deathwatchDbContext;
+    }
+}

+ 11 - 0
Dotnet/Domain/BaseEntity.cs

@@ -0,0 +1,11 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Domain;
+
+public class BaseEntity
+{
+    [Key] public int Id { get; set; }
+
+    public DateTime CreatedDate { get; set; }
+    public DateTime ModifiedDate { get; set; }
+}

+ 13 - 0
Dotnet/Domain/Domain.csproj

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

+ 38 - 0
Dotnet/Domain/Enum/Enum.cs

@@ -0,0 +1,38 @@
+using System.ComponentModel;
+
+namespace Domain.Enum;
+
+public enum WeaponClass
+{
+    [Description("Pistol")] PISTOL,
+    [Description("Basic")] BASIC,
+    [Description("Heavy")] HEAVY,
+    [Description("Thrown")] THROWN,
+    [Description("Melee")] MELEE
+}
+
+public enum ItemAvailibility
+{
+    [Description("Automatic")] UBIQUITOUS = 100,
+    [Description("Easy")] ABUNDANT = 30,
+    [Description("Routine")] PLENTIFUL = 20,
+    [Description("Ordinary")] COMMON = 10,
+    [Description("Challenging")] AVERAGE = 0,
+    [Description("Difficult")] SCARCE = -10,
+    [Description("Hard")] RARE = -20,
+    [Description("Very Hard")] VERY_RARE = -30,
+    [Description("Arduous ")] EXTREMELY_RARE = -40,
+    [Description("Punishing ")] NEAR_UNIQUE = -50,
+    [Description("Hellish")] UNIQUE = -60
+}
+
+public enum OrganisationLevel
+{
+    [Description("Local Influence")] LOCAL,
+    [Description("Regional Influence")] REGIONAL,
+    [Description("National Influence")] NATIONAL,
+    [Description("All the Planet")] PLANETARY,
+
+    [Description("All the galaxy & beyond")]
+    INTERGALACTICAL
+}

+ 80 - 0
Dotnet/Domain/Player.cs

@@ -0,0 +1,80 @@
+using Domain.Weapons;
+using Infrastructure;
+
+namespace Domain;
+
+public class Player : BaseEntity
+{
+   
+    public string? Name { get; set; }
+    public string? CharacterName { get; set; }
+    public string? Background { get; set; }
+    public int Experience { get; set; }
+    public int CC { get; set; }
+    public int CT { get; set; }
+    public int F { get; set; }
+    public int E { get; set; }
+    public int AG { get; set; }
+    public int INT { get; set; }
+    public int PER { get; set; }
+    public int FM { get; set; }
+    public int SOC { get; set; }
+    public int MF { get; set; }
+
+    public ICollection<Weapon> Weapons { get; set; }
+
+    public int Initiative()
+    {
+        return DiceService.RollDices(1, 10) + DiceService.Bonus(AG);
+    }
+
+    public bool TestCC()
+    {
+        return DiceService.RollDices(1, 100) <= CC;
+    }
+
+    public bool TestCT()
+    {
+        return DiceService.RollDices(1, 100) <= CT;
+    }
+
+    public bool TestF()
+    {
+        return DiceService.RollDices(1, 100) <= F;
+    }
+
+    public bool TestE()
+    {
+        return DiceService.RollDices(1, 100) <= E;
+    }
+
+    public bool TestAG()
+    {
+        return DiceService.RollDices(1, 100) <= AG;
+    }
+
+    public bool TestINT()
+    {
+        return DiceService.RollDices(1, 100) <= INT;
+    }
+
+    public bool TestPER()
+    {
+        return DiceService.RollDices(1, 100) <= PER;
+    }
+
+    public bool TestFM()
+    {
+        return DiceService.RollDices(1, 100) <= FM;
+    }
+
+    public bool TestSOC()
+    {
+        return DiceService.RollDices(1, 100) <= SOC;
+    }
+
+    public bool TestMF()
+    {
+        return DiceService.RollDices(1, 100) <= MF;
+    }
+}

+ 29 - 0
Dotnet/Domain/Weapons/Bolter.cs

@@ -0,0 +1,29 @@
+using Infrastructure;
+
+namespace Domain.Weapons;
+
+public class Bolter : Weapon
+{
+    public override int DamageAmount(int successDegree)
+    {
+        var throws = new List<int>();
+        for (var i = 0; i < successDegree; i++)
+        {
+            var currentThrow = DiceService.RollDices(3, 10);
+            throws.Add(currentThrow);
+        }
+
+        return throws.Sum() + 5 * successDegree;
+    }
+
+    public override int Attack(int bonusCt, int ct, string amo = null, bool? isHorde = null)
+    {
+        int successDegree;
+        var ctDice = ct - DiceService.RollDices(1, 100) + bonusCt;
+        if (ctDice > 0)
+            successDegree = 1 + Utilities.Round(ctDice, 10);
+        else
+            successDegree = 0;
+        return DamageAmount(successDegree);
+    }
+}

+ 22 - 0
Dotnet/Domain/Weapons/FlameThrower.cs

@@ -0,0 +1,22 @@
+using Infrastructure;
+
+namespace Domain.Weapons;
+
+public class FlameThrower : Weapon
+{
+    public FlameThrower()
+    {
+        Range = 30;
+    }
+
+    public override int DamageAmount(int successDegree)
+    {
+        throw new NotImplementedException();
+    }
+
+    public override int Attack(int bonusCt, int ct, string amo = null, bool? isHorde = null)
+    {
+        if (isHorde == true) return DiceService.RollDices(1, 5) + Utilities.Round(Range, 4);
+        return 0;
+    }
+}

+ 31 - 0
Dotnet/Domain/Weapons/Sword.cs

@@ -0,0 +1,31 @@
+using Infrastructure;
+
+namespace Domain.Weapons;
+
+public class Sword : Weapon
+{
+    //public virtual object sword_damage()
+    //{
+    //    return this.RollDices(1, 10) + 3 + this.MF;
+    //}
+
+
+    public int FastAttack(int cc)
+    {
+        var damage = 0;
+        for (var i = 0; i < 2; i++)
+            if (DiceService.RollDices(1, 100) <= cc)
+                damage += DiceService.RollDices(1, 10) + 3 + cc;
+        return damage;
+    }
+
+    public override int DamageAmount(int successDegree)
+    {
+        throw new NotImplementedException();
+    }
+
+    public override int Attack(int bonusCc, int cc, string amo = null, bool? isHorde = null)
+    {
+        return DiceService.RollDices(1, 10) + 3 + cc;
+    }
+}

+ 30 - 0
Dotnet/Domain/Weapons/Weapon.cs

@@ -0,0 +1,30 @@
+using Infrastructure;
+
+namespace Domain.Weapons;
+
+public class Weapon : BaseEntity
+{
+    public int Damage;
+    public int Range { get; set; }
+    public string? Name { get; set; }
+    public string? GPE { get; set; }
+    public string? Type { get; set; }
+    public int Pene { get; set; }
+    public string? Mode { get; set; }
+    public string? At { get; set; }
+    public string? Rch { get; set; }
+    public string? Attribute { get; set; }
+
+    public ICollection<Player> Players { get; set; }
+
+    public virtual int Attack(int bonusStat, int stat, string amo = null, bool? isHorde = null)
+    {
+        var ctDice = DiceService.RollDices(1, 100);
+        return ctDice;
+    }
+
+    public virtual int DamageAmount(int successDegree)
+    {
+        return 0;
+    }
+}

+ 20 - 0
Dotnet/Infrastructure/DiceService.cs

@@ -0,0 +1,20 @@
+namespace Infrastructure;
+
+public static class DiceService
+{
+    public static Random Random = new();
+
+    public static int Bonus(int statValue)
+    {
+        return Utilities.Round(statValue, 10);
+    }
+
+    public static int RollDices(int numberOfRoll, int diceValue)
+    {
+        var sum = 0;
+
+        for (var i = 0; i < numberOfRoll; i++) sum += Random.Next(1, diceValue);
+
+        return sum;
+    }
+}

+ 17 - 0
Dotnet/Infrastructure/Infrastructure.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="Interfaces\" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.1" />
+  </ItemGroup>
+
+</Project>

+ 11 - 0
Dotnet/Infrastructure/Utilities.cs

@@ -0,0 +1,11 @@
+namespace Infrastructure;
+
+public static class Utilities
+{
+    public static int Round(int value, int dividedBy)
+    {
+        if (value < 0) return (int)Math.Floor(value / (double)dividedBy);
+
+        return 0;
+    }
+}

+ 20 - 0
Dotnet/Services/Interfaces/IPlayerService.cs

@@ -0,0 +1,20 @@
+using System.Linq.Expressions;
+using Domain;
+
+namespace Services.Interfaces;
+
+public interface IPlayerService
+{
+    Task<Player> GetById(int id);
+    Task<Player> FirstOrDefault(Expression<Func<Player, bool>> predicate);
+
+    Task Add(Player entity);
+    Task Update(Player entity);
+    Task Remove(Player entity);
+
+    Task<IEnumerable<Player>> GetAll();
+    Task<IEnumerable<Player>> GetWhere(Expression<Func<Player, bool>> predicate);
+
+    Task<int> CountAll();
+    Task<int> CountWhere(Expression<Func<Player, bool>> predicate);
+}

+ 69 - 0
Dotnet/Services/PlayerService.cs

@@ -0,0 +1,69 @@
+using System.Linq.Expressions;
+using DataLayer.Interfaces;
+using Domain;
+using Services.Interfaces;
+
+namespace Services;
+
+public class PlayerService : IPlayerService
+{
+    private readonly IAbstractRepository<Player> _playerRepository;
+
+    public PlayerService(IPlayerRepository playerRepository)
+    {
+        _playerRepository = playerRepository;
+    }
+
+    public Task Add(Player entity)
+    {
+        throw new NotImplementedException();
+    }
+
+    public Task<int> CountAll()
+    {
+        throw new NotImplementedException();
+    }
+
+    public Task<int> CountWhere(Expression<Func<Player, bool>> predicate)
+    {
+        throw new NotImplementedException();
+    }
+
+    public Task<Player> FirstOrDefault(Expression<Func<Player, bool>> predicate)
+    {
+        throw new NotImplementedException();
+    }
+
+    public async Task<IEnumerable<Player>> GetAll()
+    {
+        try
+        {
+            var players = await _playerRepository.GetAll();
+            return players;
+        }
+        catch (Exception e)
+        {
+            throw;
+        }
+    }
+
+    public async Task<Player> GetById(int id)
+    {
+        return await _playerRepository.GetById(id);
+    }
+
+    public Task<IEnumerable<Player>> GetWhere(Expression<Func<Player, bool>> predicate)
+    {
+        throw new NotImplementedException();
+    }
+
+    public Task Remove(Player entity)
+    {
+        throw new NotImplementedException();
+    }
+
+    public Task Update(Player entity)
+    {
+        throw new NotImplementedException();
+    }
+}

+ 15 - 0
Dotnet/Services/Services.csproj

@@ -0,0 +1,15 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\DataLayer\DataLayer.csproj" />
+    <ProjectReference Include="..\Domain\Domain.csproj" />
+    <ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
+  </ItemGroup>
+
+</Project>

+ 26 - 2
Dotnet/Warhammer.sln

@@ -1,10 +1,18 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.32901.82
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32421.90
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Warhammer", "Warhammer\Warhammer.csproj", "{CAC4117F-9DAA-4631-8AFE-7CB1FE2183F6}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "Domain\Domain.csproj", "{6513BB0B-4DC1-483F-887E-F40C8603FC2B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Services", "Services\Services.csproj", "{8FA3AA34-0FC6-4C63-8D77-46A94C6BBB17}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "Infrastructure\Infrastructure.csproj", "{1EAD6FA9-441F-4386-AA6F-1FD40D77E2DC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataLayer", "DataLayer\DataLayer.csproj", "{7C05BF26-5E6B-4572-82DA-90E2876F1842}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -15,6 +23,22 @@ Global
 		{CAC4117F-9DAA-4631-8AFE-7CB1FE2183F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CAC4117F-9DAA-4631-8AFE-7CB1FE2183F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CAC4117F-9DAA-4631-8AFE-7CB1FE2183F6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6513BB0B-4DC1-483F-887E-F40C8603FC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6513BB0B-4DC1-483F-887E-F40C8603FC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6513BB0B-4DC1-483F-887E-F40C8603FC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6513BB0B-4DC1-483F-887E-F40C8603FC2B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8FA3AA34-0FC6-4C63-8D77-46A94C6BBB17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8FA3AA34-0FC6-4C63-8D77-46A94C6BBB17}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8FA3AA34-0FC6-4C63-8D77-46A94C6BBB17}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8FA3AA34-0FC6-4C63-8D77-46A94C6BBB17}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1EAD6FA9-441F-4386-AA6F-1FD40D77E2DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1EAD6FA9-441F-4386-AA6F-1FD40D77E2DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1EAD6FA9-441F-4386-AA6F-1FD40D77E2DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1EAD6FA9-441F-4386-AA6F-1FD40D77E2DC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7C05BF26-5E6B-4572-82DA-90E2876F1842}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7C05BF26-5E6B-4572-82DA-90E2876F1842}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7C05BF26-5E6B-4572-82DA-90E2876F1842}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7C05BF26-5E6B-4572-82DA-90E2876F1842}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 24 - 27
Dotnet/Warhammer/Controllers/HomeController.cs

@@ -1,38 +1,35 @@
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading.Tasks;
+using System.Diagnostics;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Logging;
+using Services.Interfaces;
 using Warhammer.Models;
-using Warhammer.Service.Interfaces;
 
-namespace Warhammer.Controllers
+namespace Warhammer.Controllers;
+
+public class HomeController : Controller
 {
-    public class HomeController : Controller
-    {
-        private readonly ILogger<HomeController> _logger;
-        private readonly IPlayerService _playerService;
+    private readonly ILogger<HomeController> _logger;
+    private readonly IPlayerService _playerService;
 
-        public HomeController(ILogger<HomeController> logger, IPlayerService playerService)
-        {
-            _logger = logger;
-            _playerService = playerService;
-        }
+    public HomeController(ILogger<HomeController> logger, IPlayerService playerService)
+    {
+        _logger = logger;
+        _playerService = playerService;
+    }
 
-        public IActionResult Index()
-        {
-            return View();
-        }
+    public IActionResult Index()
+    {
+        return View();
+    }
 
-        public IActionResult Privacy()
-        {
-            return View();
-        }
+    public IActionResult Privacy()
+    {
+        return View();
+    }
 
-        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
-        public IActionResult Error()
-        {
-            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
-        }
+    [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+    public IActionResult Error()
+    {
+        return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
     }
 }

+ 42 - 35
Dotnet/Warhammer/Controllers/Players/PlayerController.cs

@@ -1,53 +1,60 @@
-using System.Threading.Tasks;
+using System;
+using System.Threading.Tasks;
+using Domain;
 using Microsoft.AspNetCore.Mvc;
-using Warhammer.Models;
-using Warhammer.Service.Interfaces;
+using Services.Interfaces;
 
+namespace Warhammer.Controllers.Players;
 
-namespace Warhammer.Controllers.Players
+public class PlayerController : Controller
 {
-    public class PlayerController : Controller
+    private readonly IPlayerService _playerService;
+
+    public PlayerController(IPlayerService playerService)
     {
-        private Player CurrentPlayer { get; set; }
-        private readonly IPlayerService _playerService;
+        CurrentPlayer = new Player();
+        _playerService = playerService;
+    }
 
-        public PlayerController(IPlayerService playerService)
-        {
-            CurrentPlayer = new Player();
-            _playerService = playerService;
-        }
+    private Player CurrentPlayer { get; }
 
-        public async Task<IActionResult> PlayersAsync()
+    public async Task<IActionResult> PlayersAsync()
+    {
+        try
         {
             var players = await _playerService.GetAll();
             return View("Players/PlayerListView", players);
         }
+        catch (Exception e)
+        {
+            throw;
+        }
+    }
 
-        public async Task<IActionResult> PlayerDetailsAsync(int id)
+    public async Task<IActionResult> PlayerDetailsAsync(int id)
+    {
+        try
+        {
+            var player = await _playerService.GetById(id);
+            return View("Players/PlayerDetail", player);
+        }
+        catch (Exception e)
         {
-            try
-            {
-                var player = await _playerService.GetById(id);
-                return View("Players/PlayerDetail", player);
-            }
-            catch (System.Exception e)
-            {
-                throw e;
-            }
+            throw e;
         }
+    }
 
-        [HttpPost]
-        public async Task<IActionResult> IndexAsync()
+    [HttpPost]
+    public async Task<IActionResult> IndexAsync()
+    {
+        try
+        {
+            var player = await _playerService.GetById(0);
+            return View("Players/PlayerDetail", player);
+        }
+        catch (Exception e)
         {
-            try
-            {
-                var player = await _playerService.GetById(0);
-                return View("Players/PlayerDetail", player);
-            }
-            catch (System.Exception e)
-            {
-                throw e;
-            }
+            throw e;
         }
     }
-}
+}

+ 0 - 81
Dotnet/Warhammer/DataLayer/AbstractRepository.cs

@@ -1,81 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Threading.Tasks;
-using Microsoft.EntityFrameworkCore;
-using Warhammer.DataLayer.Interfaces;
-using Warhammer.Models;
-
-namespace Warhammer.DataLayer
-{
-    public class AbstractRepository<T> : IAbstractRepository<T> where T : BaseEntity
-    {
-
-        #region Fields
-
-        protected DeathwatchDbContext DeathwatchDbContext;
-
-        #endregion
-
-        public AbstractRepository(DeathwatchDbContext deathwatchDbContext)
-        {
-            DeathwatchDbContext = deathwatchDbContext;
-        }
-
-        #region Public Methods
-
-        public async Task<T> GetById(int id)
-        {
-            return await DeathwatchDbContext.Set<T>().FindAsync(id);
-        }
-
-        public async Task<T> FirstOrDefault(Expression<Func<T, bool>> predicate)
-        {
-            return await DeathwatchDbContext.Set<T>().FirstOrDefaultAsync(predicate);
-        }
-
-        public async Task Add(T entity)
-        {
-            // await DeathwatchDbContext.AddAsync(entity);
-            await DeathwatchDbContext.Set<T>().AddAsync(entity);
-            await DeathwatchDbContext.SaveChangesAsync();
-        }
-
-        public Task Update(T entity)
-        {
-            // In case AsNoTracking is used
-            DeathwatchDbContext.Entry(entity).State = EntityState.Modified;
-            return DeathwatchDbContext.SaveChangesAsync();
-        }
-
-        public Task Remove(T entity)
-        {
-            DeathwatchDbContext.Set<T>().Remove(entity);
-            return DeathwatchDbContext.SaveChangesAsync();
-        }
-
-        public async Task<IEnumerable<T>> GetAll()
-        {
-            return await DeathwatchDbContext.Set<T>().ToListAsync();
-        }
-
-        public async Task<IEnumerable<T>> GetWhere(Expression<Func<T, bool>> predicate)
-        {
-            return await DeathwatchDbContext.Set<T>().Where(predicate).ToListAsync();
-        }
-
-        public Task<int> CountAll()
-        {
-            return DeathwatchDbContext.Set<T>().CountAsync();
-        }
-
-        public Task<int> CountWhere(Expression<Func<T, bool>> predicate)
-        {
-            return DeathwatchDbContext.Set<T>().CountAsync(predicate);
-        }
-
-        #endregion
-
-    }
-}

+ 0 - 46
Dotnet/Warhammer/DataLayer/DbContextInitializer.cs

@@ -1,46 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using Warhammer.Models;
-using Warhammer.Models.Weapons;
-
-namespace Warhammer.DataLayer
-{
-    public static class DbContextInitializer
-    {
-        public static void Initialize(DeathwatchDbContext context)
-        {
-            context.Database.EnsureCreated();
-
-            // Look for any students.
-            if (context.Players.Any()) return; // DB has been seeded
-
-            var weapon = new Weapon
-            {
-                At = "test",
-                Range = 30,
-                Attribute = "CT",
-                Type = "RANGE",
-            };
-
-            var players = new[]
-            {
-                new Player
-                {
-                    Experience = 17400,
-                    CC = 52,
-                    CT = 40,
-                    F = 46,
-                    E = 45,
-                    AG = 50,
-                    INT = 34,
-                    PER = 43,
-                    FM = 43,
-                    SOC = 40,
-                    Weapons = new List<Weapon>{ weapon }
-                },
-            };
-            foreach (var player in players) context.Players.Add(player);
-            context.SaveChanges();
-        }
-    }
-}

+ 0 - 26
Dotnet/Warhammer/DataLayer/DeathwatchDbContext.cs

@@ -1,26 +0,0 @@
-using Microsoft.EntityFrameworkCore;
-using Warhammer.Models;
-using Warhammer.Models.Weapons;
-
-namespace Warhammer.DataLayer
-{
-    public class DeathwatchDbContext : DbContext
-    {
-        public DeathwatchDbContext() : base()
-        {
-
-        }
-
-        public DeathwatchDbContext(DbContextOptions<DeathwatchDbContext> options) : base(options)
-        {
-        }
-
-        public DbSet<Player> Players { get; set; }
-
-        protected override void OnModelCreating(ModelBuilder modelBuilder)
-        {
-            modelBuilder.Entity<Player>().HasMany(s => s.Weapons);
-            modelBuilder.Entity<Weapon>().HasMany(w => w.Players);
-        }
-    }
-}

+ 0 - 26
Dotnet/Warhammer/DataLayer/Interfaces/IAbstractRepository.cs

@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Threading.Tasks;
-using Warhammer.Models;
-
-namespace Warhammer.DataLayer.Interfaces
-{
-    public interface IAbstractRepository<T> where T : BaseEntity
-    {
-        Task<T> GetById(int id);
-        Task<T> FirstOrDefault(Expression<Func<T, bool>> predicate);
-
-        Task Add(T entity);
-        Task Update(T entity);
-        Task Remove(T entity);
-
-        Task<IEnumerable<T>> GetAll();
-        Task<IEnumerable<T>> GetWhere(Expression<Func<T, bool>> predicate);
-
-        Task<int> CountAll();
-        Task<int> CountWhere(Expression<Func<T, bool>> predicate);
-
-
-    }
-}

+ 0 - 8
Dotnet/Warhammer/DataLayer/Interfaces/IPlayerRepository.cs

@@ -1,8 +0,0 @@
-using Warhammer.Models;
-
-namespace Warhammer.DataLayer.Interfaces
-{
-    public interface IPlayerRepository : IAbstractRepository<Player>
-    {
-    }
-}

+ 0 - 14
Dotnet/Warhammer/DataLayer/PlayerRepository.cs

@@ -1,14 +0,0 @@
-using Warhammer.DataLayer.Interfaces;
-using Warhammer.Models;
-
-namespace Warhammer.DataLayer
-{
-    public class PlayerRepository : AbstractRepository<Player>, IPlayerRepository
-    {
-        private readonly DeathwatchDbContext _deathwatchDbContext;
-
-        public PlayerRepository(DeathwatchDbContext deathwatchDbContext) : base(deathwatchDbContext)
-        {
-        }
-    }
-}

+ 0 - 102
Dotnet/Warhammer/Migrations/20220922082312_newMigration.cs

@@ -1,102 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-namespace Warhammer.Migrations
-{
-    public partial class newMigration : Migration
-    {
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-
-            migrationBuilder.CreateTable(
-                name: "Weapon",
-                columns: table => new
-                {
-                    Id = table.Column<int>(nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    CreatedDate = table.Column<DateTime>(nullable: false),
-                    ModifiedDate = table.Column<DateTime>(nullable: false),
-                    Range = table.Column<int>(nullable: false),
-                    Name = table.Column<string>(nullable: true),
-                    GPE = table.Column<string>(nullable: true),
-                    Type = table.Column<string>(nullable: true),
-                    Pene = table.Column<int>(nullable: false),
-                    Mode = table.Column<string>(nullable: true),
-                    At = table.Column<string>(nullable: true),
-                    Rch = table.Column<string>(nullable: true),
-                    Attribute = table.Column<string>(nullable: true),
-                    PlayerId = table.Column<int>(nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Weapon", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Players",
-                columns: table => new
-                {
-                    Id = table.Column<int>(nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    CreatedDate = table.Column<DateTime>(nullable: false),
-                    ModifiedDate = table.Column<DateTime>(nullable: false),
-                    Name = table.Column<string>(nullable: true),
-                    CharacterName = table.Column<string>(nullable: true),
-                    Background = table.Column<string>(nullable: true),
-                    Experience = table.Column<int>(nullable: false),
-                    CC = table.Column<int>(nullable: false),
-                    CT = table.Column<int>(nullable: false),
-                    F = table.Column<int>(nullable: false),
-                    E = table.Column<int>(nullable: false),
-                    AG = table.Column<int>(nullable: false),
-                    INT = table.Column<int>(nullable: false),
-                    PER = table.Column<int>(nullable: false),
-                    FM = table.Column<int>(nullable: false),
-                    SOC = table.Column<int>(nullable: false),
-                    MF = table.Column<int>(nullable: false),
-                    WeaponId = table.Column<int>(nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Players", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_Players_Weapon_WeaponId",
-                        column: x => x.WeaponId,
-                        principalTable: "Weapon",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Restrict);
-                });
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Players_WeaponId",
-                table: "Players",
-                column: "WeaponId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Weapon_PlayerId",
-                table: "Weapon",
-                column: "PlayerId");
-
-            migrationBuilder.AddForeignKey(
-                name: "FK_Weapon_Players_PlayerId",
-                table: "Weapon",
-                column: "PlayerId",
-                principalTable: "Players",
-                principalColumn: "Id",
-                onDelete: ReferentialAction.Restrict);
-        }
-
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropForeignKey(
-                name: "FK_Players_Weapon_WeaponId",
-                table: "Players");
-
-            migrationBuilder.DropTable(
-                name: "Weapon");
-
-            migrationBuilder.DropTable(
-                name: "Players");
-        }
-    }
-}

+ 0 - 14
Dotnet/Warhammer/Models/BaseEntity.cs

@@ -1,14 +0,0 @@
-using System;
-using System.ComponentModel.DataAnnotations;
-
-namespace Warhammer.Models
-{
-    public class BaseEntity
-    {
-        [Key]
-        public int Id { get; set; }
-        public DateTime CreatedDate { get; set; }
-        public DateTime ModifiedDate { get; set; }
-
-    }
-}

+ 0 - 39
Dotnet/Warhammer/Models/Enum/Enum.cs

@@ -1,39 +0,0 @@
-using System.ComponentModel;
-
-namespace Warhammer.Models.Enum
-{
-    public enum WeaponClass
-    {
-        [Description("Pistol")] PISTOL,
-        [Description("Basic")] BASIC,
-        [Description("Heavy")] HEAVY,
-        [Description("Thrown")] THROWN,
-        [Description("Melee")] MELEE
-    }
-
-    public enum ItemAvailibility
-    {
-        [Description("Automatic")] UBIQUITOUS = 100,
-        [Description("Easy")] ABUNDANT = 30,
-        [Description("Routine")] PLENTIFUL = 20,
-        [Description("Ordinary")] COMMON = 10,
-        [Description("Challenging")] AVERAGE = 0,
-        [Description("Difficult")] SCARCE = -10,
-        [Description("Hard")] RARE = -20,
-        [Description("Very Hard")] VERY_RARE = -30,
-        [Description("Arduous ")] EXTREMELY_RARE = -40,
-        [Description("Punishing ")] NEAR_UNIQUE = -50,
-        [Description("Hellish")] UNIQUE = -60
-    }
-
-    public enum OrganisationLevel
-    {
-        [Description("Local Influence")] LOCAL,
-        [Description("Regional Influence")] REGIONAL,
-        [Description("National Influence")] NATIONAL,
-        [Description("All the Planet")] PLANETARY,
-
-        [Description("All the galaxy & beyond")]
-        INTERGALACTICAL
-    }
-}

+ 5 - 6
Dotnet/Warhammer/Models/ErrorViewModel.cs

@@ -1,9 +1,8 @@
-namespace Warhammer.Models
+namespace Warhammer.Models;
+
+public class ErrorViewModel
 {
-    public class ErrorViewModel
-    {
-        public string RequestId { get; set; }
+    public string RequestId { get; set; }
 
-        public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
-    }
+    public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
 }

+ 0 - 45
Dotnet/Warhammer/Models/Player.cs

@@ -1,45 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using Warhammer.Models.Weapons;
-using Warhammer.Service;
-
-namespace Warhammer.Models
-{
-    public class Player : BaseEntity
-    {
-        public string Name { get; set; }
-        public string CharacterName { get; set; }
-        public string Background { get; set; }
-        public int Experience { get; set; }
-        public int CC { get; set; }
-        public int CT { get; set; }
-        public int F { get; set; }
-        public int E { get; set; }
-        public int AG { get; set; }
-        public int INT { get; set; }
-        public int PER { get; set; }
-        public int FM { get; set; }
-        public int SOC { get; set; }
-        public int MF { get; set; }
-
-        public ICollection<Weapon> Weapons { get; set; }
-
-        public int Initiative()
-        {
-            return DiceService.RollDices(1, 10) + DiceService.Bonus(AG);
-        }
-
-        public bool TestCC() { return DiceService.RollDices(1, 100) <= CC; }
-        public bool TestCT() { return DiceService.RollDices(1, 100) <= CT; }
-        public bool TestF() { return DiceService.RollDices(1, 100) <= F; }
-        public bool TestE() { return DiceService.RollDices(1, 100) <= E; }
-        public bool TestAG() { return DiceService.RollDices(1, 100) <= AG; }
-        public bool TestINT() { return DiceService.RollDices(1, 100) <= INT; }
-        public bool TestPER() { return DiceService.RollDices(1, 100) <= PER; }
-        public bool TestFM() { return DiceService.RollDices(1, 100) <= FM; }
-        public bool TestSOC() { return DiceService.RollDices(1, 100) <= SOC; }
-        public bool TestMF() { return DiceService.RollDices(1, 100) <= MF; }
-
-    }
-}

+ 0 - 17
Dotnet/Warhammer/Models/Utilities.cs

@@ -1,17 +0,0 @@
-using System;
-
-namespace Warhammer.Models
-{
-    public static class Utilities
-    {
-        public static int Round(int value, int dividedBy)
-        {
-            if (value < 0)
-            {
-                return (int)Math.Floor(value / (double)dividedBy);
-            }
-
-            return 0;
-        }
-    }
-}

+ 0 - 36
Dotnet/Warhammer/Models/Weapons/Bolter.cs

@@ -1,36 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Warhammer.Service;
-
-namespace Warhammer.Models.Weapons
-{
-    public class Bolter : Weapon
-    {
-        public override int DamageAmount(int successDegree)
-        {
-            var throws = new List<int>();
-            for (int i = 0; i < successDegree; i++)
-            {
-                var currentThrow = DiceService.RollDices(3, 10);
-                throws.Add(currentThrow);
-            }
-            return throws.Sum() + 5 * successDegree;
-        }
-
-        public override int Attack(int bonusCt, int ct, string amo = null, bool? isHorde = null)
-        {
-            int successDegree;
-            var ctDice = ct - DiceService.RollDices(1, 100) + bonusCt;
-            if (ctDice > 0)
-            {
-                successDegree = 1 + Utilities.Round(ctDice, 10);
-            }
-            else
-            {
-                successDegree = 0;
-            }
-            return DamageAmount(successDegree);
-        }
-    }
-}

+ 0 - 28
Dotnet/Warhammer/Models/Weapons/FlameThrower.cs

@@ -1,28 +0,0 @@
-using System;
-using Warhammer.Service;
-
-namespace Warhammer.Models.Weapons
-{
-    public class FlameThrower : Weapon
-    {
-        public FlameThrower()
-        {
-            Range = 30;
-        }
-
-        public override int DamageAmount(int successDegree)
-        {
-            throw new NotImplementedException();
-        }
-
-        public override int Attack(int bonusCt, int ct, string amo = null, bool? isHorde = null)
-        {
-            if (isHorde == true)
-            {
-                return DiceService.RollDices(1,5) + Utilities.Round(Range, 4);
-            }
-            return 0;
-        }
-
-    }
-}

+ 0 - 38
Dotnet/Warhammer/Models/Weapons/Sword.cs

@@ -1,38 +0,0 @@
-using System.Linq;
-using Warhammer.Service;
-
-namespace Warhammer.Models.Weapons
-{
-    public class Sword : Weapon
-    {
-
-        //public virtual object sword_damage()
-        //{
-        //    return this.RollDices(1, 10) + 3 + this.MF;
-        //}
-
-
-        public int FastAttack(int cc)
-        {
-            var damage = 0;
-            for (int i = 0; i < 2; i++)
-            {
-                if (DiceService.RollDices(1, 100) <= cc)
-                {
-                    damage += DiceService.RollDices(1, 10) + 3 + cc;
-                }
-            }
-            return damage;
-        }
-
-        public override int DamageAmount(int successDegree)
-        {
-            throw new System.NotImplementedException();
-        }
-
-        public override int Attack(int bonusCc, int cc, string amo = null, bool? isHorde = null)
-        {
-            return DiceService.RollDices(1, 10) + 3 + cc;
-        }
-    }
-}

+ 0 - 34
Dotnet/Warhammer/Models/Weapons/Weapon.cs

@@ -1,34 +0,0 @@
-using System.Collections.Generic;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
-using Warhammer.Service;
-
-namespace Warhammer.Models.Weapons
-{
-    public class Weapon : BaseEntity
-    {
-        public int Damage;
-        public int Range { get; set; }
-        public string Name { get; set; }
-        public string GPE { get; set; }
-        public string Type { get; set; }
-        public int Pene { get; set; }
-        public string Mode { get; set; }
-        public string At { get; set; }
-        public string Rch { get; set; }
-        public string Attribute { get; set; }
-
-        public ICollection<Player> Players { get; set; }
-
-        public virtual int Attack(int bonusStat, int stat, string amo = null, bool? isHorde = null)
-        {
-            var ctDice = DiceService.RollDices(1, 100);
-            return ctDice;
-        }
-
-        public virtual int DamageAmount(int successDegree)
-        {
-            return 0;
-        }
-
-    }
-}

+ 28 - 26
Dotnet/Warhammer/Program.cs

@@ -1,44 +1,46 @@
 using System;
+using System.Linq;
+using DataLayer;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
-using Warhammer.DataLayer;
 
-namespace Warhammer
+namespace Warhammer;
+
+public class Program
 {
-    public class Program
+    public static void Main(string[] args)
     {
-        public static void Main(string[] args)
-        {
-            var host = CreateHostBuilder(args).Build();
+        var host = CreateHostBuilder(args).Build();
 
-            CreateDbIfNotExists(host);
+        CreateDbIfNotExists(host);
 
-            host.Run();
-        }
+        host.Run();
+    }
 
-        public static IHostBuilder CreateHostBuilder(string[] args)
-        {
-            return Host.CreateDefaultBuilder(args)
-                .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
-        }
+    public static IHostBuilder CreateHostBuilder(string[] args)
+    {
+        return Host.CreateDefaultBuilder(args)
+            .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
+    }
 
-        private static void CreateDbIfNotExists(IHost host)
+    private static void CreateDbIfNotExists(IHost host)
+    {
+        using (var scope = host.Services.CreateScope())
         {
-            using (var scope = host.Services.CreateScope())
+            var services = scope.ServiceProvider;
+            try
             {
-                var services = scope.ServiceProvider;
-                try
-                {
-                    var context = services.GetRequiredService<DeathwatchDbContext>();
+                var context = services.GetRequiredService<DeathwatchDbContext>();
+                var playerCount = context.Players.Count();
+                if (!context.Players.Any())
                     DbContextInitializer.Initialize(context);
-                }
-                catch (Exception ex)
-                {
-                    var logger = services.GetRequiredService<ILogger<Program>>();
-                    logger.LogError(ex, "An error occurred creating the DB.");
-                }
+            }
+            catch (Exception ex)
+            {
+                var logger = services.GetRequiredService<ILogger<Program>>();
+                logger.LogError(ex, "An error occurred creating the DB.");
             }
         }
     }

+ 1 - 1
Dotnet/Warhammer/Properties/PublishProfiles/DeathwatchWebApp - Web Deploy.pubxml.user

@@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
   <PropertyGroup>
     <TimeStampOfAssociatedLegacyPublishXmlFile />
     <EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA3aukXzos7UmpDo1WnIZ1xAAAAAACAAAAAAADZgAAwAAAABAAAACnCoiGSbWN4HGb1PUIKKGPAAAAAASAAACgAAAAEAAAAIG73dxboIaK3CVSNKerN42AAAAA3LbNVHirj20WPofbvToIRGwRPHoijX74t4vOUZxDXEInDt0xUdMB4oZkV07T7GlntblCn4XNlSTnq0lRwIY13PwmpkiX9utIpM6ji386dxAgk8h5KztgX9hTEBdFjHFaBmTbm8zzSNMN16F83b57ZacyTfgqYQ+dLyMbZ4spf9EUAAAAgvEaFmvL4fAV0i0g/9K19hrwZ8A=</EncryptedPassword>
-    <History>True|2022-09-21T20:06:23.4478529Z;True|2022-09-21T21:17:52.2079741+02:00;</History>
+    <History>True|2022-10-28T14:33:35.9646620Z;True|2022-10-25T14:33:05.5306736+02:00;True|2022-10-25T14:31:13.4014701+02:00;True|2022-09-21T22:06:23.4478529+02:00;True|2022-09-21T21:17:52.2079741+02:00;</History>
   </PropertyGroup>
 </Project>

+ 84 - 0
Dotnet/Warhammer/Properties/ServiceDependencies/DeathwatchWebApp - Web Deploy/mssql1.arm.json

@@ -0,0 +1,84 @@
+{
+  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
+  "contentVersion": "1.0.0.0",
+  "parameters": {
+    "resourceGroupName": {
+      "type": "string",
+      "defaultValue": "Deathwatch",
+      "metadata": {
+        "_parameterType": "resourceGroup",
+        "description":
+          "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
+      }
+    },
+    "resourceGroupLocation": {
+      "type": "string",
+      "defaultValue": "ukwest",
+      "metadata": {
+        "_parameterType": "location",
+        "description": "Location of the resource group. Resource groups could have different location than resources."
+      }
+    },
+    "resourceLocation": {
+      "type": "string",
+      "defaultValue": "[parameters('resourceGroupLocation')]",
+      "metadata": {
+        "_parameterType": "location",
+        "description":
+          "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
+      }
+    }
+  },
+  "resources": [
+    {
+      "type": "Microsoft.Resources/resourceGroups",
+      "name": "[parameters('resourceGroupName')]",
+      "location": "[parameters('resourceGroupLocation')]",
+      "apiVersion": "2019-10-01"
+    },
+    {
+      "type": "Microsoft.Resources/deployments",
+      "name":
+        "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('DeathwatchDB', subscription().subscriptionId)))]",
+      "resourceGroup": "[parameters('resourceGroupName')]",
+      "apiVersion": "2019-10-01",
+      "dependsOn": [
+        "[parameters('resourceGroupName')]"
+      ],
+      "properties": {
+        "mode": "Incremental",
+        "template": {
+          "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+          "contentVersion": "1.0.0.0",
+          "resources": [
+            {
+              "kind": "v12.0",
+              "location": "[parameters('resourceLocation')]",
+              "name": "deathwatchserver",
+              "type": "Microsoft.Sql/servers",
+              "apiVersion": "2017-10-01-preview"
+            },
+            {
+              "sku": {
+                "name": "Free",
+                "tier": "Free",
+                "capacity": 5
+              },
+              "kind": "v12.0,user",
+              "location": "[parameters('resourceLocation')]",
+              "name": "deathwatchserver/DeathwatchDB",
+              "type": "Microsoft.Sql/servers/databases",
+              "apiVersion": "2017-10-01-preview",
+              "dependsOn": [
+                "deathwatchserver"
+              ]
+            }
+          ]
+        }
+      }
+    }
+  ],
+  "metadata": {
+    "_dependencyType": "mssql.azure"
+  }
+}

+ 12 - 6
Dotnet/Warhammer/Properties/ServiceDependencies/DeathwatchWebApp - Web Deploy/profile.arm.json

@@ -9,14 +9,16 @@
       "type": "string",
       "defaultValue": "Deathwatch",
       "metadata": {
-        "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
+        "description":
+          "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
       }
     },
     "resourceGroupLocation": {
       "type": "string",
       "defaultValue": "ukwest",
       "metadata": {
-        "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
+        "description":
+          "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
       }
     },
     "resourceName": {
@@ -30,13 +32,16 @@
       "type": "string",
       "defaultValue": "[parameters('resourceGroupLocation')]",
       "metadata": {
-        "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
+        "description":
+          "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
       }
     }
   },
   "variables": {
-    "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
-    "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
+    "appServicePlan_name":
+      "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+    "appServicePlan_ResourceId":
+      "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
   },
   "resources": [
     {
@@ -47,7 +52,8 @@
     },
     {
       "type": "Microsoft.Resources/deployments",
-      "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+      "name":
+        "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
       "resourceGroup": "[parameters('resourceGroupName')]",
       "apiVersion": "2019-10-01",
       "dependsOn": [

+ 11 - 0
Dotnet/Warhammer/Properties/serviceDependencies.DeathwatchWebApp - Web Deploy.json

@@ -0,0 +1,11 @@
+{
+  "dependencies": {
+    "mssql1": {
+      "secretStore": "AzureAppSettings",
+      "resourceId":
+        "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.Sql/servers/deathwatchserver/databases/DeathwatchDB",
+      "type": "mssql.azure",
+      "connectionId": "AzureDbConnectionStrings"
+    }
+  }
+}

+ 20 - 0
Dotnet/Warhammer/Properties/serviceDependencies.DeathwatchWebApp - Web Deploy.json.user

@@ -0,0 +1,20 @@
+{
+  "dependencies": {
+    "mssql1": {
+      "restored": true,
+      "restoreTime": "2022-10-28T14:32:45.0755335Z"
+    }
+  },
+  "parameters": {
+    "mssql1.subscriptionId": {
+      "Name": "mssql1.subscriptionId",
+      "Type": "subscription",
+      "Value": "b83edada-b419-4bc0-b626-7bd2c6e2a027"
+    },
+    "mssql1.resourceGroupName": {
+      "Name": "mssql1.resourceGroupName",
+      "Type": "resourceGroup",
+      "Value": "Deathwatch"
+    }
+  }
+}

+ 8 - 0
Dotnet/Warhammer/Properties/serviceDependencies.json

@@ -0,0 +1,8 @@
+{
+  "dependencies": {
+    "mssql1": {
+      "type": "mssql",
+      "connectionId": "AzureDbConnectionStrings"
+    }
+  }
+}

+ 0 - 30
Dotnet/Warhammer/Service/DiceService.cs

@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Warhammer.Models;
-
-namespace Warhammer.Service
-{
-    public static class DiceService
-    {
-        public static Random Random = new Random();
-
-        public static int Bonus(int statValue)
-        {
-            return Utilities.Round(statValue, 10);
-        }
-
-        public static int RollDices(int numberOfRoll, int diceValue)
-        {
-            var sum = 0;
-
-            for (int i = 0; i < numberOfRoll; i++)
-            {
-                sum += Random.Next(1, diceValue);
-            }
-
-            return sum;
-        }
-
-    }
-}

+ 0 - 24
Dotnet/Warhammer/Service/Interfaces/IPlayerService.cs

@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Threading.Tasks;
-using Warhammer.Models;
-
-namespace Warhammer.Service.Interfaces
-{
-    public interface IPlayerService
-    {
-        Task<Player> GetById(int id);
-        Task<Player> FirstOrDefault(Expression<Func<Player, bool>> predicate);
-
-        Task Add(Player entity);
-        Task Update(Player entity);
-        Task Remove(Player entity);
-
-        Task<IEnumerable<Player>> GetAll();
-        Task<IEnumerable<Player>> GetWhere(Expression<Func<Player, bool>> predicate);
-
-        Task<int> CountAll();
-        Task<int> CountWhere(Expression<Func<Player, bool>> predicate);
-    }
-}

+ 0 - 66
Dotnet/Warhammer/Service/PlayerService.cs

@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Threading.Tasks;
-using Warhammer.DataLayer.Interfaces;
-using Warhammer.Models;
-using Warhammer.Service.Interfaces;
-
-namespace Warhammer.Service
-{
-    public class PlayerService : IPlayerService
-    {
-        private readonly IPlayerRepository _playerRepository;
-
-        public PlayerService(IPlayerRepository playerRepository)
-        {
-            _playerRepository = playerRepository;
-        }
-
-        public Task Add(Player entity)
-        {
-            throw new NotImplementedException();
-        }
-
-        public Task<int> CountAll()
-        {
-            throw new NotImplementedException();
-        }
-
-        public Task<int> CountWhere(Expression<Func<Player, bool>> predicate)
-        {
-            throw new NotImplementedException();
-        }
-
-        public Task<Player> FirstOrDefault(Expression<Func<Player, bool>> predicate)
-        {
-            throw new NotImplementedException();
-        }
-
-        public async Task<IEnumerable<Player>> GetAll()
-        {
-            return await _playerRepository.GetAll();
-
-        }
-
-        public async Task<Player> GetById(int id)
-        {
-            return await _playerRepository.GetById(id);
-        }
-
-        public Task<IEnumerable<Player>> GetWhere(Expression<Func<Player, bool>> predicate)
-        {
-            throw new NotImplementedException();
-        }
-
-        public Task Remove(Player entity)
-        {
-            throw new NotImplementedException();
-        }
-
-        public Task Update(Player entity)
-        {
-            throw new NotImplementedException();
-        }
-    }
-}

+ 54 - 59
Dotnet/Warhammer/Startup.cs

@@ -1,79 +1,74 @@
+using DataLayer;
+using DataLayer.Interfaces;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Warhammer.DataLayer;
-using Warhammer.DataLayer.Interfaces;
-using Warhammer.Service;
-using Warhammer.Service.Interfaces;
+using Services;
+using Services.Interfaces;
+using Microsoft.EntityFrameworkCore;
 
-namespace Warhammer
+namespace Warhammer;
+
+public class Startup
 {
-    public class Startup
+    public Startup(IConfiguration configuration)
     {
-        public Startup(IConfiguration configuration)
-        {
-            Configuration = configuration;
-        }
-
-        public IConfiguration Configuration { get; }
-
-        // This method gets called by the runtime. Use this method to add services to the container.
-        public void ConfigureServices(IServiceCollection services)
-        {
-            //services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
-            //{
-            //    builder.AllowAnyOrigin()
-            //        .AllowAnyMethod()
-            //        .AllowAnyHeader();
-            //}));
-
-            services.AddMvc();
-            services.AddHttpClient();
-            services.AddControllersWithViews();
-            services.AddRazorPages();
+        Configuration = configuration;
+    }
 
-            services.AddDbContext<DeathwatchDbContext>(options =>
-                options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
+    public IConfiguration Configuration { get; }
 
-            services.AddTransient(typeof(IAbstractRepository<>), typeof(AbstractRepository<>));
-            services.AddTransient<IPlayerService, PlayerService>();
-            services.AddTransient<IPlayerRepository, PlayerRepository>();
+    // This method gets called by the runtime. Use this method to add services to the container.
+    public void ConfigureServices(IServiceCollection services)
+    {
+        //services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
+        //{
+        //    builder.AllowAnyOrigin()
+        //        .AllowAnyMethod()
+        //        .AllowAnyHeader();
+        //}));
 
+        services.AddMvc();
+        services.AddHttpClient();
+        services.AddControllersWithViews();
+        services.AddRazorPages();
 
-        }
+        services.AddDbContext<DeathwatchDbContext>(options =>
+            options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
 
-        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
-        {
-            if (env.IsDevelopment())
-            {
-                app.UseDeveloperExceptionPage();
-            }
-            else
-            {
-                app.UseExceptionHandler("/Home/Error");
-                //The default HSTS value is 30 days.You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
-            }
+        services.AddTransient(typeof(IAbstractRepository<>), typeof(AbstractRepository<>));
+        services.AddTransient<IPlayerService, PlayerService>();
+        services.AddTransient<IPlayerRepository, PlayerRepository>();
+    }
 
-            app.UseHttpsRedirection();
-            app.UseStaticFiles();
+    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+    {
+        //if (env.IsDevelopment())
+        //{
+        //    app.UseDeveloperExceptionPage();
+        //}
+        //else
+        //{
+        //    app.UseExceptionHandler("/Home/Error");
+        //    //The default HSTS value is 30 days.You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+        //}
 
-            app.UseRouting();
+        app.UseHttpsRedirection();
+        app.UseStaticFiles();
 
-            app.UseAuthorization();
+        app.UseRouting();
 
-            app.UseEndpoints(endpoints =>
-            {
-                endpoints.MapControllerRoute(
-                    "default",
-                    "{controller=Home}/{action=Index}/{id?}");
-                endpoints.MapRazorPages();
-            });
+        app.UseAuthorization();
 
-            app.UseHsts();
+        app.UseEndpoints(endpoints =>
+        {
+            endpoints.MapControllerRoute(
+                "default",
+                "{controller=Home}/{action=Index}/{id?}");
+            endpoints.MapRazorPages();
+        });
 
-        }
+        app.UseHsts();
     }
 }

+ 35 - 35
Dotnet/Warhammer/Views/Shared/Players/PlayerDetail.cshtml

@@ -1,105 +1,105 @@
-@model Warhammer.Models.Player
+@model Domain.Player
 @{
     ViewData["Title"] = "Detail";
 }
 <div>
     <h4>Player</h4>
-    <hr />
+    <hr/>
     <dl class="row">
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.Name)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.Name)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.CharacterName)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.CharacterName)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.Background)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.Background)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.Experience)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.Experience)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.CC)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.CC)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.CT)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.CT)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.F)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.F)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.E)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.E)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.AG)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.AG)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.INT)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.INT)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.PER)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.PER)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.FM)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.FM)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.SOC)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.SOC)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.MF)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.MF)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.CreatedDate)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.CreatedDate)
         </dd>
-        <dt class = "col-sm-2">
+        <dt class="col-sm-2">
             @Html.DisplayNameFor(model => model.ModifiedDate)
         </dt>
-        <dd class = "col-sm-10">
+        <dd class="col-sm-10">
             @Html.DisplayFor(model => model.ModifiedDate)
         </dd>
     </dl>
@@ -107,4 +107,4 @@
 <div>
     @*<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |*@
     <a asp-controller="Player" asp-action="Index">Back to List</a>
-</div>
+</div>

+ 84 - 83
Dotnet/Warhammer/Views/Shared/Players/PlayerListView.cshtml

@@ -1,4 +1,5 @@
-@model IEnumerable<Player>
+@using Microsoft.AspNetCore.Mvc.TagHelpers
+@model IEnumerable<Domain.Player>
 
 @{
     ViewData["Title"] = "View";
@@ -12,93 +13,93 @@
 
 <table class="table">
     <thead>
-        <tr>
-            <th>
-                @Html.DisplayNameFor(model => model.Id)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.Experience)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.CC)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.CT)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.F)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.E)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.AG)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.INT)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.PER)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.FM)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.SOC)
-            </th>
-            <th>
-                @Html.DisplayNameFor(model => model.MF)
-            </th>
-            <th></th>
-        </tr>
+    <tr>
+        <th>
+            @Html.DisplayNameFor(model => model.Id)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.Experience)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.CC)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.CT)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.F)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.E)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.AG)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.INT)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.PER)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.FM)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.SOC)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.MF)
+        </th>
+        <th></th>
+    </tr>
     </thead>
     <tbody>
-        @foreach (var item in Model)
-        {
-            <tr>
+    @foreach (var item in Model)
+    {
+        <tr>
 
-                <td>
-                    <a type="submit" asp-action="PlayerDetails" asp-controller="Player" class="btn-info" asp-route-id="@item.Id">@item.Id</a>
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.Experience)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.CC)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.CT)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.F)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.E)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.AG)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.INT)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.PER)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.FM)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.SOC)
-                </td>
-                <td>
-                    @Html.DisplayFor(modelItem => item.MF)
-                </td>
-                @*<td>
+            <td>
+                <a type="submit" asp-action="PlayerDetails" asp-controller="Player" class="btn-info" asp-route-id="@item.Id">@item.Id</a>
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.Experience)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.CC)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.CT)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.F)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.E)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.AG)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.INT)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.PER)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.FM)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.SOC)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.MF)
+            </td>
+            @*<td>
                     @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
                     @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
                     @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
                     </td>*@
-            </tr>
-        }
+        </tr>
+    }
     </tbody>
-</table>
+</table>

+ 15 - 9
Dotnet/Warhammer/Warhammer.csproj

@@ -1,26 +1,32 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <TargetFramework>net6.0</TargetFramework>
     <CopyRefAssembliesToPublishDirectory>false</CopyRefAssembliesToPublishDirectory>
     <StartupObject>Warhammer.Program</StartupObject>
   </PropertyGroup>
 
   <ItemGroup>
-    <Compile Remove="Migrations\20220922081842_newMigration.cs" />
-    <Compile Remove="Migrations\20220922081842_newMigration.Designer.cs" />
+    <Folder Include="DataLayer\Interfaces\" />
+    <Folder Include="Models\Enum\" />
+    <Folder Include="Models\Weapons\" />
+    <Folder Include="Service\" />
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" />
-    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
-    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
-    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
-    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Domain\Domain.csproj" />
+    <ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
+    <ProjectReference Include="..\Services\Services.csproj" />
   </ItemGroup>
 
 </Project>

+ 1 - 1
Dotnet/Warhammer/Warhammer.csproj.user

@@ -12,7 +12,7 @@
     <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
     <WebStackScaffolding_ControllerDialogWidth>650</WebStackScaffolding_ControllerDialogWidth>
     <ActiveDebugProfile>IIS Express</ActiveDebugProfile>
-    <NameOfLastUsedPublishProfile>C:\Repositories\Warhammer\Deathwatch\Dotnet\Warhammer\Properties\PublishProfiles\DeathwatchWebApp - Web Deploy.pubxml</NameOfLastUsedPublishProfile>
+    <NameOfLastUsedPublishProfile>C:\fmorel\Repositories\Warhammer\Deathwatch\Dotnet\Warhammer\Properties\PublishProfiles\DeathwatchWebApp - Web Deploy.pubxml</NameOfLastUsedPublishProfile>
     <WebStackScaffolding_DbContextTypeFullName>Warhammer.DataLayer.DeathwatchDbContext</WebStackScaffolding_DbContextTypeFullName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

+ 2 - 1
Dotnet/Warhammer/appsettings.json

@@ -1,6 +1,7 @@
 {
   "ConnectionStrings": {
-    "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=Warhammer;Trusted_Connection=True;MultipleActiveResultSets=true",
+    "DefaultConnection":
+      "Server=(localdb)\\MSSQLLocalDB;Database=Warhammer;Trusted_Connection=True;MultipleActiveResultSets=true"
   },
   "Logging": {
     "LogLevel": {