List of commits:
Subject Hash Author Date (UTC)
New vehicle model for context 1040629cd4f2931f0c4ebee6f5c505ebaff3d97b Antonio Calatayud 2018-11-26 17:43:04
Finish form 291cafcfa67fbfec687fc2d58e4fb70e8cb11975 Antonio Calatayud 2018-11-26 16:31:54
Merge services 385e874ea56eb15a14f983e94d5cbd444cc13ba7 Antonio Calatayud 2018-11-16 22:40:25
Populate feature checkboxes 1d31b1b0f70c96ceb04f375bb28affbdcc6bbf93 Antonio Calatayud 2018-11-16 22:30:32
Create Feature Service 83633fa68f9ceb113974f8cfa1cbad527dcb1730 Antonio Calatayud 2018-11-16 22:21:55
Add cascade dropdown for model 23a3a4509386c52d83df8e2742260b31d74d2c31 Antonio Calatayud 2018-11-16 22:14:27
Populate dropdown list of makes 2f990816aa06a5c1157792e7194118e8f27edd01 Antonio Calatayud 2018-11-16 21:57:05
Create service to bring makes 4392eaef90093371844491026c771439cb43907e Antonio Calatayud 2018-11-16 21:54:02
Start form 73244c2b63ba957d2a8212d32b7a18114a6a4e72 Antonio Calatayud 2018-11-16 21:52:19
Add routing to new component 51ae297856214503a62716a9fc841db611cb7b1e Antonio Calatayud 2018-11-16 21:22:58
Create new component for vehicle form 774a1e6105d82f115c5002db0b6a66429f7d7f04 Antonio Calatayud 2018-11-16 21:13:06
Add API with mapping e2a22c67e3d34c4125adf5bec2c3b1dd319b999b Antonio Calatayud 2018-11-13 18:14:15
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 1040629cd4f2931f0c4ebee6f5c505ebaff3d97b - New vehicle model for context
Author: Antonio Calatayud
Author date (UTC): 2018-11-26 17:43
Committer name: Antonio Calatayud
Committer date (UTC): 2018-11-26 17:43
Parent(s): 291cafcfa67fbfec687fc2d58e4fb70e8cb11975
Signer:
Signing key:
Signing status: N
Tree: e8f7cbe5271f4fb41d3be9846f41f074c201993a
File Lines added Lines deleted
Migrations/20181126174142_AddVehicleTable.Designer.cs 67 4
Migrations/20181126174142_AddVehicleTable.cs 89 0
Migrations/VegaDbContextModelSnapshot.cs 65 2
Models/Feature.cs 1 0
Models/Vehicle.cs 34 0
Models/VehicleFeature.cs 13 0
Persistence/VegaDbContext.cs 7 0
File Migrations/20181126174142_AddVehicleTable.Designer.cs copied from file Migrations/20181113173611_SeedFeatures.Designer.cs (similarity 55%) (mode: 100644) (index 01029bc..09d11be)
1 1 // <auto-generated /> // <auto-generated />
2 using System;
2 3 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
3 4 using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
4 5 using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
 
... ... using vega.Persistence;
9 10 namespace vega.Migrations namespace vega.Migrations
10 11 { {
11 12 [DbContext(typeof(VegaDbContext))] [DbContext(typeof(VegaDbContext))]
12 [Migration("20181113173611_SeedFeatures")]
13 partial class SeedFeatures
13 [Migration("20181126174142_AddVehicleTable")]
14 partial class AddVehicleTable
14 15 { {
15 16 protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
16 17 { {
 
... ... namespace vega.Migrations
26 27 .ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
27 28 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
28 29
29 b.Property<int>("MyProperty");
30
31 30 b.Property<string>("Name") b.Property<string>("Name")
32 31 .IsRequired() .IsRequired()
33 32 .HasMaxLength(255); .HasMaxLength(255);
 
... ... namespace vega.Migrations
71 70 b.ToTable("Models"); b.ToTable("Models");
72 71 }); });
73 72
73 modelBuilder.Entity("vega.Models.Vehicle", b =>
74 {
75 b.Property<int>("Id")
76 .ValueGeneratedOnAdd()
77 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
78
79 b.Property<string>("ContactEmail")
80 .HasMaxLength(255);
81
82 b.Property<string>("ContactName")
83 .IsRequired()
84 .HasMaxLength(255);
85
86 b.Property<string>("ContactPhone")
87 .IsRequired()
88 .HasMaxLength(255);
89
90 b.Property<bool>("IsRegistered");
91
92 b.Property<DateTime>("LastUpdate");
93
94 b.Property<int>("ModelId");
95
96 b.HasKey("Id");
97
98 b.HasIndex("ModelId");
99
100 b.ToTable("Vehicles");
101 });
102
103 modelBuilder.Entity("vega.Models.VehicleFeature", b =>
104 {
105 b.Property<int>("VehicleId");
106
107 b.Property<int>("FeatureId");
108
109 b.HasKey("VehicleId", "FeatureId");
110
111 b.HasIndex("FeatureId");
112
113 b.ToTable("VehicleFeatures");
114 });
115
74 116 modelBuilder.Entity("vega.Models.Model", b => modelBuilder.Entity("vega.Models.Model", b =>
75 117 { {
76 118 b.HasOne("vega.Models.Make", "Make") b.HasOne("vega.Models.Make", "Make")
 
... ... namespace vega.Migrations
78 120 .HasForeignKey("MakeId") .HasForeignKey("MakeId")
79 121 .OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
80 122 }); });
123
124 modelBuilder.Entity("vega.Models.Vehicle", b =>
125 {
126 b.HasOne("vega.Models.Model", "Model")
127 .WithMany()
128 .HasForeignKey("ModelId")
129 .OnDelete(DeleteBehavior.Cascade);
130 });
131
132 modelBuilder.Entity("vega.Models.VehicleFeature", b =>
133 {
134 b.HasOne("vega.Models.Feature", "Feature")
135 .WithMany()
136 .HasForeignKey("FeatureId")
137 .OnDelete(DeleteBehavior.Cascade);
138
139 b.HasOne("vega.Models.Vehicle", "Vehicle")
140 .WithMany("Features")
141 .HasForeignKey("VehicleId")
142 .OnDelete(DeleteBehavior.Cascade);
143 });
81 144 #pragma warning restore 612, 618 #pragma warning restore 612, 618
82 145 } }
83 146 } }
File Migrations/20181126174142_AddVehicleTable.cs added (mode: 100644) (index 0000000..2e046c0)
1 using System;
2 using Microsoft.EntityFrameworkCore.Metadata;
3 using Microsoft.EntityFrameworkCore.Migrations;
4
5 namespace vega.Migrations
6 {
7 public partial class AddVehicleTable : Migration
8 {
9 protected override void Up(MigrationBuilder migrationBuilder)
10 {
11 migrationBuilder.DropColumn(
12 name: "MyProperty",
13 table: "Features");
14
15 migrationBuilder.CreateTable(
16 name: "Vehicles",
17 columns: table => new
18 {
19 Id = table.Column<int>(nullable: false)
20 .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
21 ModelId = table.Column<int>(nullable: false),
22 IsRegistered = table.Column<bool>(nullable: false),
23 ContactName = table.Column<string>(maxLength: 255, nullable: false),
24 ContactPhone = table.Column<string>(maxLength: 255, nullable: false),
25 ContactEmail = table.Column<string>(maxLength: 255, nullable: true),
26 LastUpdate = table.Column<DateTime>(nullable: false)
27 },
28 constraints: table =>
29 {
30 table.PrimaryKey("PK_Vehicles", x => x.Id);
31 table.ForeignKey(
32 name: "FK_Vehicles_Models_ModelId",
33 column: x => x.ModelId,
34 principalTable: "Models",
35 principalColumn: "id",
36 onDelete: ReferentialAction.Cascade);
37 });
38
39 migrationBuilder.CreateTable(
40 name: "VehicleFeatures",
41 columns: table => new
42 {
43 VehicleId = table.Column<int>(nullable: false),
44 FeatureId = table.Column<int>(nullable: false)
45 },
46 constraints: table =>
47 {
48 table.PrimaryKey("PK_VehicleFeatures", x => new { x.VehicleId, x.FeatureId });
49 table.ForeignKey(
50 name: "FK_VehicleFeatures_Features_FeatureId",
51 column: x => x.FeatureId,
52 principalTable: "Features",
53 principalColumn: "Id",
54 onDelete: ReferentialAction.Cascade);
55 table.ForeignKey(
56 name: "FK_VehicleFeatures_Vehicles_VehicleId",
57 column: x => x.VehicleId,
58 principalTable: "Vehicles",
59 principalColumn: "Id",
60 onDelete: ReferentialAction.Cascade);
61 });
62
63 migrationBuilder.CreateIndex(
64 name: "IX_VehicleFeatures_FeatureId",
65 table: "VehicleFeatures",
66 column: "FeatureId");
67
68 migrationBuilder.CreateIndex(
69 name: "IX_Vehicles_ModelId",
70 table: "Vehicles",
71 column: "ModelId");
72 }
73
74 protected override void Down(MigrationBuilder migrationBuilder)
75 {
76 migrationBuilder.DropTable(
77 name: "VehicleFeatures");
78
79 migrationBuilder.DropTable(
80 name: "Vehicles");
81
82 migrationBuilder.AddColumn<int>(
83 name: "MyProperty",
84 table: "Features",
85 nullable: false,
86 defaultValue: 0);
87 }
88 }
89 }
File Migrations/VegaDbContextModelSnapshot.cs changed (mode: 100644) (index acfa742..d6e5dd5)
1 1 // <auto-generated /> // <auto-generated />
2 using System;
2 3 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
3 4 using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
4 5 using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
 
... ... namespace vega.Migrations
24 25 .ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
25 26 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26 27
27 b.Property<int>("MyProperty");
28
29 28 b.Property<string>("Name") b.Property<string>("Name")
30 29 .IsRequired() .IsRequired()
31 30 .HasMaxLength(255); .HasMaxLength(255);
 
... ... namespace vega.Migrations
69 68 b.ToTable("Models"); b.ToTable("Models");
70 69 }); });
71 70
71 modelBuilder.Entity("vega.Models.Vehicle", b =>
72 {
73 b.Property<int>("Id")
74 .ValueGeneratedOnAdd()
75 .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
76
77 b.Property<string>("ContactEmail")
78 .HasMaxLength(255);
79
80 b.Property<string>("ContactName")
81 .IsRequired()
82 .HasMaxLength(255);
83
84 b.Property<string>("ContactPhone")
85 .IsRequired()
86 .HasMaxLength(255);
87
88 b.Property<bool>("IsRegistered");
89
90 b.Property<DateTime>("LastUpdate");
91
92 b.Property<int>("ModelId");
93
94 b.HasKey("Id");
95
96 b.HasIndex("ModelId");
97
98 b.ToTable("Vehicles");
99 });
100
101 modelBuilder.Entity("vega.Models.VehicleFeature", b =>
102 {
103 b.Property<int>("VehicleId");
104
105 b.Property<int>("FeatureId");
106
107 b.HasKey("VehicleId", "FeatureId");
108
109 b.HasIndex("FeatureId");
110
111 b.ToTable("VehicleFeatures");
112 });
113
72 114 modelBuilder.Entity("vega.Models.Model", b => modelBuilder.Entity("vega.Models.Model", b =>
73 115 { {
74 116 b.HasOne("vega.Models.Make", "Make") b.HasOne("vega.Models.Make", "Make")
 
... ... namespace vega.Migrations
76 118 .HasForeignKey("MakeId") .HasForeignKey("MakeId")
77 119 .OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
78 120 }); });
121
122 modelBuilder.Entity("vega.Models.Vehicle", b =>
123 {
124 b.HasOne("vega.Models.Model", "Model")
125 .WithMany()
126 .HasForeignKey("ModelId")
127 .OnDelete(DeleteBehavior.Cascade);
128 });
129
130 modelBuilder.Entity("vega.Models.VehicleFeature", b =>
131 {
132 b.HasOne("vega.Models.Feature", "Feature")
133 .WithMany()
134 .HasForeignKey("FeatureId")
135 .OnDelete(DeleteBehavior.Cascade);
136
137 b.HasOne("vega.Models.Vehicle", "Vehicle")
138 .WithMany("Features")
139 .HasForeignKey("VehicleId")
140 .OnDelete(DeleteBehavior.Cascade);
141 });
79 142 #pragma warning restore 612, 618 #pragma warning restore 612, 618
80 143 } }
81 144 } }
File Models/Feature.cs changed (mode: 100644) (index 327e731..21e3ec4)
1 using System.Collections.Generic;
1 2 using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
2 3 using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
3 4
File Models/Vehicle.cs added (mode: 100644) (index 0000000..05beab4)
1 using System;
2 using System.Collections.Generic;
3 using System.Collections.ObjectModel;
4 using System.ComponentModel.DataAnnotations;
5 using System.ComponentModel.DataAnnotations.Schema;
6
7 namespace vega.Models
8 {
9 [Table("Vehicles")]
10 public class Vehicle
11 {
12 public Vehicle()
13 {
14 Features = new Collection<VehicleFeature>();
15 }
16 public int Id { get; set; }
17 [Required]
18 public int ModelId { get; set; }
19 public Model Model { get; set; }
20 public bool IsRegistered { get; set; }
21 public ICollection<VehicleFeature> Features { get; set;}
22
23 [Required]
24 [StringLength(255)]
25 public string ContactName { get; set; }
26
27 [Required]
28 [StringLength(255)]
29 public string ContactPhone { get; set; }
30
31 [StringLength(255)]
32 public string ContactEmail { get; set; } public DateTime LastUpdate { get; set; }
33 }
34 }
File Models/VehicleFeature.cs added (mode: 100644) (index 0000000..a8b26f6)
1 using System.ComponentModel.DataAnnotations.Schema;
2
3 namespace vega.Models
4 {
5 [Table("VehicleFeatures")]
6 public class VehicleFeature
7 {
8 public int VehicleId { get; set; }
9 public int FeatureId { get; set; }
10 public Vehicle Vehicle { get; set; }
11 public Feature Feature { get; set; }
12 }
13 }
File Persistence/VegaDbContext.cs changed (mode: 100644) (index 3e98e87..ed25d99)
... ... namespace vega.Persistence
15 15
16 16 public DbSet<Make> Makes { get; set; } public DbSet<Make> Makes { get; set; }
17 17 public DbSet<Feature> Features { get; set; } public DbSet<Feature> Features { get; set; }
18 protected override void OnModelCreating(ModelBuilder modelBuilder)
19 {
20 modelBuilder.Entity<VehicleFeature>().HasKey(
21 vf => new { vf.VehicleId, vf.FeatureId }
22 );
23 }
24
18 25 } }
19 26 } }
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