List of commits:
Subject Hash Author Date (UTC)
Add feature Model and seed 83b852e4e3e045b110d412d4c072cffdd43b5015 Antonio Calatayud 2018-11-13 17:56:09
Create api for makes with mapping 0090cccd2af8016cc3d8ebe0c690ec9c8be1f9ba Antonio Calatayud 2018-11-13 17:16:29
Seed DB with test records 290f03be73cde265adeb436d9083f848e335d0ad Antonio Calatayud 2018-11-13 13:00:38
Add first Migration f7dbe278633d37cb84371ff9872f2999d1551d23 Antonio Calatayud 2018-11-13 11:18:29
Add DbContext 63523201e374cd186a873d405395cec6eefd989d Antonio Calatayud 2018-11-13 11:13:33
Add models 10cb5370ddb34a9afdaa0ae964c2ee540821462b Antonio Calatayud 2018-11-09 18:11:22
First commit 3033c730b731b08ad5198975d238635007575714 Antonio Calatayud 2018-11-09 17:09:28
Commit 83b852e4e3e045b110d412d4c072cffdd43b5015 - Add feature Model and seed
Author: Antonio Calatayud
Author date (UTC): 2018-11-13 17:56
Committer name: Antonio Calatayud
Committer date (UTC): 2018-11-13 17:56
Parent(s): 0090cccd2af8016cc3d8ebe0c690ec9c8be1f9ba
Signer:
Signing key:
Signing status: N
Tree: 3fb6dddfc5115a9750fdbe8a402797644edfd529
File Lines added Lines deleted
Migrations/20181113173536_ListFeature.Designer.cs 19 2
Migrations/20181113173536_ListFeature.cs 30 0
Migrations/20181113173611_SeedFeatures.Designer.cs 19 2
Migrations/20181113173611_SeedFeatures.cs 19 0
Migrations/VegaDbContextModelSnapshot.cs 17 0
Models/Feature.cs 4 6
Persistence/VegaDbContext.cs 1 0
File Migrations/20181113173536_ListFeature.Designer.cs copied from file Migrations/20181113111657_FirstMigrationAgain.Designer.cs (similarity 77%) (mode: 100644) (index 6aa9183..1945cda)
... ... using vega.Persistence;
9 9 namespace vega.Migrations namespace vega.Migrations
10 10 { {
11 11 [DbContext(typeof(VegaDbContext))] [DbContext(typeof(VegaDbContext))]
12 [Migration("20181113111657_FirstMigrationAgain")]
13 partial class FirstMigrationAgain
12 [Migration("20181113173536_ListFeature")]
13 partial class ListFeature
14 14 { {
15 15 protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
16 16 { {
 
... ... namespace vega.Migrations
20 20 .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
21 21 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
22 22
23 modelBuilder.Entity("vega.Models.Feature", b =>
24 {
25 b.Property<int>("Id")
26 .ValueGeneratedOnAdd()
27 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
28
29 b.Property<int>("MyProperty");
30
31 b.Property<string>("Name")
32 .IsRequired()
33 .HasMaxLength(255);
34
35 b.HasKey("Id");
36
37 b.ToTable("Features");
38 });
39
23 40 modelBuilder.Entity("vega.Models.Make", b => modelBuilder.Entity("vega.Models.Make", b =>
24 41 { {
25 42 b.Property<int>("id") b.Property<int>("id")
File Migrations/20181113173536_ListFeature.cs added (mode: 100644) (index 0000000..35d9e59)
1 using Microsoft.EntityFrameworkCore.Metadata;
2 using Microsoft.EntityFrameworkCore.Migrations;
3
4 namespace vega.Migrations
5 {
6 public partial class ListFeature : Migration
7 {
8 protected override void Up(MigrationBuilder migrationBuilder)
9 {
10 migrationBuilder.CreateTable(
11 name: "Features",
12 columns: table => new
13 {
14 Id = table.Column<int>(nullable: false)
15 .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
16 Name = table.Column<string>(maxLength: 255, nullable: false)
17 },
18 constraints: table =>
19 {
20 table.PrimaryKey("PK_Features", x => x.Id);
21 });
22 }
23
24 protected override void Down(MigrationBuilder migrationBuilder)
25 {
26 migrationBuilder.DropTable(
27 name: "Features");
28 }
29 }
30 }
File Migrations/20181113173611_SeedFeatures.Designer.cs copied from file Migrations/20181113111657_FirstMigrationAgain.Designer.cs (similarity 77%) (mode: 100644) (index 6aa9183..01029bc)
... ... using vega.Persistence;
9 9 namespace vega.Migrations namespace vega.Migrations
10 10 { {
11 11 [DbContext(typeof(VegaDbContext))] [DbContext(typeof(VegaDbContext))]
12 [Migration("20181113111657_FirstMigrationAgain")]
13 partial class FirstMigrationAgain
12 [Migration("20181113173611_SeedFeatures")]
13 partial class SeedFeatures
14 14 { {
15 15 protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
16 16 { {
 
... ... namespace vega.Migrations
20 20 .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
21 21 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
22 22
23 modelBuilder.Entity("vega.Models.Feature", b =>
24 {
25 b.Property<int>("Id")
26 .ValueGeneratedOnAdd()
27 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
28
29 b.Property<int>("MyProperty");
30
31 b.Property<string>("Name")
32 .IsRequired()
33 .HasMaxLength(255);
34
35 b.HasKey("Id");
36
37 b.ToTable("Features");
38 });
39
23 40 modelBuilder.Entity("vega.Models.Make", b => modelBuilder.Entity("vega.Models.Make", b =>
24 41 { {
25 42 b.Property<int>("id") b.Property<int>("id")
File Migrations/20181113173611_SeedFeatures.cs added (mode: 100644) (index 0000000..d4cf1fd)
1 using Microsoft.EntityFrameworkCore.Migrations;
2
3 namespace vega.Migrations
4 {
5 public partial class SeedFeatures : Migration
6 {
7 protected override void Up(MigrationBuilder migrationBuilder)
8 {
9 migrationBuilder.Sql("Insert into Features (Name) Values ('Feature1')");
10 migrationBuilder.Sql("Insert into Features (Name) Values ('Feature3')");
11 migrationBuilder.Sql("Insert into Features (Name) Values ('Feature3')");
12 }
13
14 protected override void Down(MigrationBuilder migrationBuilder)
15 {
16 migrationBuilder.Sql("Delete from Features where Name in ('Feature1', 'Feature2', 'Feature3'");
17 }
18 }
19 }
File Migrations/VegaDbContextModelSnapshot.cs changed (mode: 100644) (index d23a255..acfa742)
... ... namespace vega.Migrations
18 18 .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
19 19 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
20 20
21 modelBuilder.Entity("vega.Models.Feature", b =>
22 {
23 b.Property<int>("Id")
24 .ValueGeneratedOnAdd()
25 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26
27 b.Property<int>("MyProperty");
28
29 b.Property<string>("Name")
30 .IsRequired()
31 .HasMaxLength(255);
32
33 b.HasKey("Id");
34
35 b.ToTable("Features");
36 });
37
21 38 modelBuilder.Entity("vega.Models.Make", b => modelBuilder.Entity("vega.Models.Make", b =>
22 39 { {
23 40 b.Property<int>("id") b.Property<int>("id")
File Models/Feature.cs copied from file Models/Model.cs (similarity 56%) (mode: 100644) (index 99d5a1d..327e731)
... ... using System.ComponentModel.DataAnnotations.Schema;
3 3
4 4 namespace vega.Models namespace vega.Models
5 5 { {
6 [Table("Models")]
7 public class Model
6 [Table("Features")]
7 public class Feature
8 8 { {
9 public int id { get; set; }
9 public int Id { get; set; }
10 10
11 11 [Required] [Required]
12 12 [StringLength(255)] [StringLength(255)]
13 13 public string Name { get; set; } public string Name { get; set; }
14 public Make Make { get; set; }
15 public int MakeId { get; set; }
16 }
14 }
17 15 } }
File Persistence/VegaDbContext.cs changed (mode: 100644) (index ef48bc5..3e98e87)
... ... namespace vega.Persistence
14 14 } }
15 15
16 16 public DbSet<Make> Makes { get; set; } public DbSet<Make> Makes { get; set; }
17 public DbSet<Feature> Features { get; set; }
17 18 } }
18 19 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/antcalatayud/vega

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/antcalatayud/vega

Clone this repository using git:
git clone git://git.rocketgit.com/user/antcalatayud/vega

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main