Skip to content

Instantly share code, notes, and snippets.

<configuration>
<runtime>
<gcServer enabled="true" />
<gcConcurrent enabled="true" />
</runtime>
</configuration>
class Personne
{
public string Nom;
public Personne(string nom)
{
Nom = nom;
}
}
class Program
{
CREATE TABLE [dbo].[Metiers](
[MetierID] [int] IDENTITY(1,1) NOT NULL,
[Libelle] [varchar](100) NULL,
CONSTRAINT [PK_Metiers] PRIMARY KEY CLUSTERED
(
[MetierID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, AL-LOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[Utilisateurs](
INSERT INTO Metiers (Libelle) VALUES ('Developpeur informatique');
INSERT INTO Metiers (Libelle) VALUES ('Administrateur reseau');
INSERT INTO Metiers (Libelle) VALUES ('Commercial');
INSERT INTO Utilisateurs (Nom, Prenom, Email, MetierID) VALUES ('Elijah', 'Holmes', 'eholmes@outlook.com', 5);
INSERT INTO Utilisateurs (Nom, Prenom, Email, MetierID) VALUES ('Mia', 'Hoff-man','miahoofman@gmail.com', 5);
INSERT INTO Utilisateurs (Nom, Prenom, Email, MetierID) VALUES ('Victor', 'Simp-son','victor.simpson85@gmail.com', 5);
INSERT INTO Utilisateurs (Nom, Prenom, Email, MetierID) VALUES ('Kaiden', 'Woods','kaiden.woods@hotmail.com', 5);
INSERT INTO Utilisateurs (Nom, Prenom, Email, MetierID) VALUES ('Jack', 'Thomas', 'king68@goyette.info', 6);
INSERT INTO Utilisateurs (Nom, Prenom, Email, MetierID) VALUES ('Tyson', 'Bates', 'tbates20@gmail.com', 7);
INSERT INTO Utilisateurs (Nom, Prenom, Email, MetierID) VALUES ('Jason', 'Green', 'j.green@gmail.com', 7);
Install-Package Microsoft.EntityFrameworkCore.Tools
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Server=SQLINSTANCE;Database=DBNAME;user=USERNAME;password=USERPASSWORD;
TrustServerCertificate=true; Trusted_Connection=True;
Server=MSSQLSERVER;Database=WebApp;Trusted_Connection=True;user=sa;password=admin*=;TrustServerCertificate=true;
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"WebAppDB": "Ser-ver=MSSQLSERVER;Database=WebApp;Trusted_Connection=True;user=sa;password=admin;TrustServerCertificate=true;"
Scaffold-DbContext -Connection Name=WebAppDB -Provider
Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -DataAnnotations
-NoOnConfiguring
public partial class Metier
{
[Key]
[Column("MetierID")]
public int MetierId { get; set; }
[StringLength(100)]
[Unicode(false)]
public string? Libelle { get; set; }