Compare commits
No commits in common. "CarServiceDataBaseImplements" and "main" have entirely different histories.
CarService
...
main
@ -5,10 +5,6 @@ VisualStudioVersion = 17.6.33717.318
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleMainApp", "ConsoleMainApp\ConsoleMainApp.csproj", "{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleMainApp", "ConsoleMainApp\ConsoleMainApp.csproj", "{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarServiceDataBaseImplements", "CarServiceDataBaseImplements\CarServiceDataBaseImplements.csproj", "{48D159D4-7150-417E-BBE9-2B636E1EAFFB}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarServiceDataModels", "CarServiceDataModels\CarServiceDataModels.csproj", "{7E6DC5DC-32CA-464C-884C-D949742DBF07}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -19,14 +15,6 @@ Global
|
|||||||
{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}.Release|Any CPU.Build.0 = Release|Any CPU
|
{4121A5A1-68DA-4F32-B8D6-EE5BA60C6890}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{48D159D4-7150-417E-BBE9-2B636E1EAFFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{48D159D4-7150-417E-BBE9-2B636E1EAFFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{48D159D4-7150-417E-BBE9-2B636E1EAFFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{48D159D4-7150-417E-BBE9-2B636E1EAFFB}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{7E6DC5DC-32CA-464C-884C-D949742DBF07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{7E6DC5DC-32CA-464C-884C-D949742DBF07}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{7E6DC5DC-32CA-464C-884C-D949742DBF07}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{7E6DC5DC-32CA-464C-884C-D949742DBF07}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
using CarServiceDataBaseImplements.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements
|
|
||||||
{
|
|
||||||
public class CarServiceDataBase : DbContext
|
|
||||||
{
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
||||||
{
|
|
||||||
if (optionsBuilder.IsConfigured == false)
|
|
||||||
{
|
|
||||||
optionsBuilder.UseNpgsql("Host=localhost;Database=CarServiceDataBase;Username=postgres;Password=postgres");
|
|
||||||
}
|
|
||||||
base.OnConfiguring(optionsBuilder);
|
|
||||||
}
|
|
||||||
public virtual DbSet<Car> Cars { get; set; }
|
|
||||||
public virtual DbSet<Client> Clients { get; set; }
|
|
||||||
public virtual DbSet<Receipt> Receipts { get; set; }
|
|
||||||
public virtual DbSet<Service> Services { get; set; }
|
|
||||||
public virtual DbSet<Staff> Staffs { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.3" />
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.3">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.3" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\CarServiceDataModels\CarServiceDataModels.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.LogicContracts
|
|
||||||
{
|
|
||||||
internal interface ICarLogic
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.LogicContracts
|
|
||||||
{
|
|
||||||
internal interface IClientLogic
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.LogicContracts
|
|
||||||
{
|
|
||||||
internal interface IReceiptLogic
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.LogicContracts
|
|
||||||
{
|
|
||||||
internal interface IServiceLogic
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.LogicContracts
|
|
||||||
{
|
|
||||||
internal interface IStaffLogic
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using CarServiceDataModels.ModelsImplements;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.StorageContracts
|
|
||||||
{
|
|
||||||
internal interface ICarStorage
|
|
||||||
{
|
|
||||||
List<CarModel> GetFullList();
|
|
||||||
CarModel? GetElement(CarModel model);
|
|
||||||
CarModel? Insert(CarModel model);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.StorageContracts
|
|
||||||
{
|
|
||||||
internal interface IClientStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.StorageContracts
|
|
||||||
{
|
|
||||||
internal interface IReceiptStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.StorageContracts
|
|
||||||
{
|
|
||||||
internal interface IServiceStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Contracts.StorageContracts
|
|
||||||
{
|
|
||||||
internal interface IStaffStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.DataBaseImplements
|
|
||||||
{
|
|
||||||
internal class CarStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.DataBaseImplements
|
|
||||||
{
|
|
||||||
internal class ClientStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.DataBaseImplements
|
|
||||||
{
|
|
||||||
internal class ReceiptStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.DataBaseImplements
|
|
||||||
{
|
|
||||||
internal class ServiceStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.DataBaseImplements
|
|
||||||
{
|
|
||||||
internal class StaffStorage
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Logic
|
|
||||||
{
|
|
||||||
internal class CarLogic
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Logic
|
|
||||||
{
|
|
||||||
internal class ClientLogic
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,125 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using CarServiceDataBaseImplements;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(CarServiceDataBase))]
|
|
||||||
[Migration("20240505121028_InitMigration")]
|
|
||||||
partial class InitMigration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.3")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Car", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Brand")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Cars");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Client", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Clients");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Receipt", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfApplication")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Receipts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Service", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<double>("Price")
|
|
||||||
.HasColumnType("double precision");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Services");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Staff", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PositionAtWork")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Staffs");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,103 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class InitMigration : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Cars",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Brand = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Cars", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Clients",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Email = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Clients", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Receipts",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
DateOfApplication = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Receipts", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Services",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Price = table.Column<double>(type: "double precision", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Services", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Staffs",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
PositionAtWork = table.Column<string>(type: "text", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Staffs", x => x.Id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Cars");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Clients");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Receipts");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Services");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Staffs");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,122 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using CarServiceDataBaseImplements;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(CarServiceDataBase))]
|
|
||||||
partial class CarServiceDataBaseModelSnapshot : ModelSnapshot
|
|
||||||
{
|
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.3")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Car", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Brand")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Cars");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Client", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Clients");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Receipt", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfApplication")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Receipts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Service", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<double>("Price")
|
|
||||||
.HasColumnType("double precision");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Services");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CarServiceDataBaseImplements.Models.Staff", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("PositionAtWork")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Staffs");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using CarServiceDataModels.ModelsImplements;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Models
|
|
||||||
{
|
|
||||||
public class Car : ICar
|
|
||||||
{
|
|
||||||
[Required]
|
|
||||||
public string Brand {get; set;} = string.Empty;
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public static Car? Create(CarModel? model)
|
|
||||||
{
|
|
||||||
if (model == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new Car()
|
|
||||||
{
|
|
||||||
Id = model.Id,
|
|
||||||
Brand = model.Brand
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public void Update(CarModel? model) {
|
|
||||||
if (model == null) { return; }
|
|
||||||
Brand = model.Brand;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CarModel GetViewModel => new()
|
|
||||||
{
|
|
||||||
Brand = Brand,
|
|
||||||
Id = Id
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using CarServiceDataModels.ModelsImplements;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Models
|
|
||||||
{
|
|
||||||
public class Client : IClient
|
|
||||||
{
|
|
||||||
[Required]
|
|
||||||
public string Name { get; set; } = String.Empty;
|
|
||||||
[Required]
|
|
||||||
public string Email { get; set; } = String.Empty;
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public static Client? Create(ClientModel? model)
|
|
||||||
{
|
|
||||||
if (model == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new Client()
|
|
||||||
{
|
|
||||||
Id = model.Id,
|
|
||||||
Name = model.Name,
|
|
||||||
Email = model.Email
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public void Update(ClientModel? model)
|
|
||||||
{
|
|
||||||
if (model == null) { return; }
|
|
||||||
Name = model.Name;
|
|
||||||
Email = model.Email;
|
|
||||||
}
|
|
||||||
public ClientModel GetViewModel => new()
|
|
||||||
{
|
|
||||||
Name = Name,
|
|
||||||
Email = Email,
|
|
||||||
Id = Id
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using CarServiceDataModels.ModelsImplements;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Models
|
|
||||||
{
|
|
||||||
public class Receipt : IReceipt
|
|
||||||
{
|
|
||||||
[Required]
|
|
||||||
public DateTime DateOfApplication { get; set; } = DateTime.Now;
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public static Receipt? Create(ReceiptModel? model)
|
|
||||||
{
|
|
||||||
if (model == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new Receipt()
|
|
||||||
{
|
|
||||||
Id = model.Id,
|
|
||||||
DateOfApplication = model.DateOfApplication,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public void Update(ReceiptModel? model)
|
|
||||||
{
|
|
||||||
if (model == null) { return; }
|
|
||||||
DateOfApplication = model.DateOfApplication;
|
|
||||||
}
|
|
||||||
public ReceiptModel GetViewModel => new()
|
|
||||||
{
|
|
||||||
DateOfApplication = DateOfApplication,
|
|
||||||
Id = Id
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using CarServiceDataModels.ModelsImplements;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Models
|
|
||||||
{
|
|
||||||
public class Service : IService
|
|
||||||
{
|
|
||||||
[Required]
|
|
||||||
public string Name { get; set; }
|
|
||||||
[Required]
|
|
||||||
public double Price { get; set; }
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public static Service? Create(ServiceModel? model)
|
|
||||||
{
|
|
||||||
if (model == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new Service()
|
|
||||||
{
|
|
||||||
Id = model.Id,
|
|
||||||
Name = model.Name,
|
|
||||||
Price = model.Price
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public void Update(ServiceModel? model)
|
|
||||||
{
|
|
||||||
if (model == null) { return; }
|
|
||||||
Name = model.Name;
|
|
||||||
Price = model.Price;
|
|
||||||
}
|
|
||||||
public ServiceModel GetViewModel => new()
|
|
||||||
{
|
|
||||||
Name = Name,
|
|
||||||
Price = Price,
|
|
||||||
Id = Id
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using CarServiceDataModels.ModelsImplements;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataBaseImplements.Models
|
|
||||||
{
|
|
||||||
public class Staff : IStaff
|
|
||||||
{
|
|
||||||
[Required]
|
|
||||||
public string Name { get; set; } = string.Empty;
|
|
||||||
[Required]
|
|
||||||
public string PositionAtWork { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public static Staff? Create(StaffModel? model)
|
|
||||||
{
|
|
||||||
if (model == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new Staff()
|
|
||||||
{
|
|
||||||
Id = model.Id,
|
|
||||||
Name = model.Name,
|
|
||||||
PositionAtWork = model.PositionAtWork,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public void Update(StaffModel? model)
|
|
||||||
{
|
|
||||||
if (model == null) { return; }
|
|
||||||
Name = model.Name;
|
|
||||||
PositionAtWork = model.PositionAtWork;
|
|
||||||
}
|
|
||||||
public StaffModel GetViewModel => new()
|
|
||||||
{
|
|
||||||
Name = Name,
|
|
||||||
PositionAtWork = PositionAtWork,
|
|
||||||
Id = Id
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.Models
|
|
||||||
{
|
|
||||||
public interface ICar : Iid
|
|
||||||
{
|
|
||||||
string Brand { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IClient : Iid
|
|
||||||
{
|
|
||||||
string Name { get; }
|
|
||||||
string Email { get; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IReceipt : Iid
|
|
||||||
{
|
|
||||||
DateTime DateOfApplication { get; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IService : Iid
|
|
||||||
{
|
|
||||||
string Name { get; }
|
|
||||||
double Price { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IStaff : Iid
|
|
||||||
{
|
|
||||||
string Name { get; }
|
|
||||||
string PositionAtWork { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.Models
|
|
||||||
{
|
|
||||||
public interface Iid
|
|
||||||
{
|
|
||||||
int Id { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.ModelsImplements
|
|
||||||
{
|
|
||||||
public class CarModel : ICar
|
|
||||||
{
|
|
||||||
public string Brand {get; set;} = string.Empty;
|
|
||||||
|
|
||||||
public int Id { get; set;}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.ModelsImplements
|
|
||||||
{
|
|
||||||
public class ClientModel : IClient
|
|
||||||
{
|
|
||||||
public string Name {get;set;} = string.Empty;
|
|
||||||
|
|
||||||
public string Email { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.ModelsImplements
|
|
||||||
{
|
|
||||||
public class ReceiptModel : IReceipt
|
|
||||||
{
|
|
||||||
public DateTime DateOfApplication { get; set; } = DateTime.Now;
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.ModelsImplements
|
|
||||||
{
|
|
||||||
public class ServiceModel : IService
|
|
||||||
{
|
|
||||||
public string Name { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public double Price { get; set; }
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
using CarServiceDataModels.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CarServiceDataModels.ModelsImplements
|
|
||||||
{
|
|
||||||
public class StaffModel : IStaff
|
|
||||||
{
|
|
||||||
public string Name { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public string PositionAtWork { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public int Id { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
@ -7,16 +7,4 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.3">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Npgsql" Version="7.0.2" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\CarServiceDataBaseImplements\CarServiceDataBaseImplements.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,28 +1,10 @@
|
|||||||
using CarServiceDataBaseImplements;
|
namespace ConsoleMainApp
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Npgsql;
|
|
||||||
|
|
||||||
namespace ConsoleMainApp
|
|
||||||
{
|
{
|
||||||
internal class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
using var context = new CarServiceDataBase();
|
Console.WriteLine("Hello, World!");
|
||||||
try
|
|
||||||
{
|
|
||||||
context.Database.OpenConnection();
|
|
||||||
Console.WriteLine("Connect open");
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
Console.WriteLine("Connect error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
context.Database.CloseConnection();
|
|
||||||
if(context.Database.GetDbConnection().State == System.Data.ConnectionState.Open) {
|
|
||||||
Console.WriteLine("Connect still open");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user