-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5109d70
commit d08716c
Showing
14 changed files
with
358 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Conferences.Api/Conferences.Api/Controllers/ConferencesController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Conferences.Api.Controllers | ||
{ | ||
[Route("api/v1/[controller]")] | ||
[ApiController] | ||
public class ConferencesController : ControllerBase | ||
{ | ||
[HttpGet("")] | ||
public async Task<IActionResult> GetConferences() | ||
{ | ||
return Ok(); | ||
} | ||
} | ||
} |
45 changes: 0 additions & 45 deletions
45
Conferences.Api/Conferences.Api/Controllers/ValuesController.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Conferences.Api.Domain | ||
{ | ||
public class Conference | ||
{ | ||
public int Id { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public string State { get; set; } | ||
|
||
public string City { get; set; } | ||
|
||
public DateTime StartDate { get; set; } | ||
|
||
public DateTime EndDate { get; set; } | ||
|
||
public bool Attending { get; set; } | ||
|
||
public bool Speaking { get; set; } | ||
|
||
public Topic FocusTopic { get; set; } | ||
} | ||
|
||
public class Topic | ||
{ | ||
public int Id { get; set; } | ||
|
||
public string Name { get; set; } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Conferences.Api/Conferences.Api/Domain/ConferenceDataContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Conferences.Api.Domain | ||
{ | ||
public class ConferenceDataContext : DbContext | ||
{ | ||
public ConferenceDataContext(DbContextOptions<ConferenceDataContext> ctx) : base(ctx) { } | ||
|
||
public virtual DbSet<Conference> Conferences { get; set; } | ||
|
||
public virtual DbSet<Topic> Topics { get; set; } | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
Conferences.Api/Conferences.Api/Migrations/20190928183702_InitialMigration.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
Conferences.Api/Conferences.Api/Migrations/20190928183702_InitialMigration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace Conferences.Api.Migrations | ||
{ | ||
public partial class InitialMigration : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "Topics", | ||
columns: table => new | ||
{ | ||
Id = table.Column<int>(nullable: false) | ||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), | ||
Name = table.Column<string>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Topics", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "Conferences", | ||
columns: table => new | ||
{ | ||
Id = table.Column<int>(nullable: false) | ||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), | ||
Name = table.Column<string>(nullable: true), | ||
State = table.Column<string>(nullable: true), | ||
City = table.Column<string>(nullable: true), | ||
StartDate = table.Column<DateTime>(nullable: false), | ||
EndDate = table.Column<DateTime>(nullable: false), | ||
Attending = table.Column<bool>(nullable: false), | ||
Speaking = table.Column<bool>(nullable: false), | ||
FocusTopicId = table.Column<int>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Conferences", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_Conferences_Topics_FocusTopicId", | ||
column: x => x.FocusTopicId, | ||
principalTable: "Topics", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Restrict); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Conferences_FocusTopicId", | ||
table: "Conferences", | ||
column: "FocusTopicId"); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Conferences"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "Topics"); | ||
} | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
Conferences.Api/Conferences.Api/Migrations/ConferenceDataContextModelSnapshot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// <auto-generated /> | ||
using System; | ||
using Conferences.Api.Domain; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||
|
||
namespace Conferences.Api.Migrations | ||
{ | ||
[DbContext(typeof(ConferenceDataContext))] | ||
partial class ConferenceDataContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
#pragma warning disable 612, 618 | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079") | ||
.HasAnnotation("Relational:MaxIdentifierLength", 128) | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
|
||
modelBuilder.Entity("Conferences.Api.Domain.Conference", b => | ||
{ | ||
b.Property<int>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
b.Property<bool>("Attending"); | ||
b.Property<string>("City"); | ||
b.Property<DateTime>("EndDate"); | ||
b.Property<int?>("FocusTopicId"); | ||
b.Property<string>("Name"); | ||
b.Property<bool>("Speaking"); | ||
b.Property<DateTime>("StartDate"); | ||
b.Property<string>("State"); | ||
b.HasKey("Id"); | ||
b.HasIndex("FocusTopicId"); | ||
b.ToTable("Conferences"); | ||
}); | ||
|
||
modelBuilder.Entity("Conferences.Api.Domain.Topic", b => | ||
{ | ||
b.Property<int>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
b.Property<string>("Name"); | ||
b.HasKey("Id"); | ||
b.ToTable("Topics"); | ||
}); | ||
|
||
modelBuilder.Entity("Conferences.Api.Domain.Conference", b => | ||
{ | ||
b.HasOne("Conferences.Api.Domain.Topic", "FocusTopic") | ||
.WithMany() | ||
.HasForeignKey("FocusTopicId"); | ||
}); | ||
#pragma warning restore 612, 618 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.