From 23e518d225c2cf78e5875fc802a4552ecbe2d0a4 Mon Sep 17 00:00:00 2001 From: Giovani Date: Sun, 5 May 2019 18:37:22 -0500 Subject: [PATCH] Started to create authorization portion pt.2 --- BrightGlimmer.Api/appsettings.json | 7 -- BrightGlimmer.Auth/BrightGlimmer.Auth.csproj | 21 ++++++ .../Controllers/UserController.cs | 45 +++++++++++++ BrightGlimmer.Auth/Program.cs | 24 +++++++ .../Properties/launchSettings.json | 30 +++++++++ BrightGlimmer.Auth/Startup.cs | 61 ++++++++++++++++++ .../appsettings.Development.json | 9 +++ BrightGlimmer.Auth/appsettings.json | 13 ++++ BrightGlimmer.Data/AuthContext.cs | 25 +++++++ BrightGlimmer.Data/BgContext.cs | 7 +- ...20190505233325_Create-Database.Designer.cs | 57 ++++++++++++++++ .../Auth/20190505233325_Create-Database.cs | 40 ++++++++++++ .../Auth/AuthContextModelSnapshot.cs | 55 ++++++++++++++++ .../Repositories/StudentQueryRepository.cs | 2 +- BrightGlimmer.Data/Services/UserService.cs | 10 +++ BrightGlimmer.Data/bright_glimmer_auth.db | Bin 0 -> 20480 bytes BrightGlimmer.Domain/Auth/User.cs | 19 ++++++ BrightGlimmer.Domain/Entity.cs | 1 + BrightGlimmer.Domain/{ => Service}/Address.cs | 2 +- .../{ => Service}/AssignedCourse.cs | 2 +- BrightGlimmer.Domain/{ => Service}/Course.cs | 2 +- BrightGlimmer.Domain/{ => Service}/Phone.cs | 2 +- .../{ => Service}/PhoneType.cs | 2 +- BrightGlimmer.Domain/{ => Service}/Student.cs | 2 +- .../Commands/CreateStudentCommand.cs | 2 +- .../Commands/UpdateStudentCommand.cs | 2 +- .../CreateStudentCommandHandler.cs | 2 +- .../DeleteStudentCommandHandler.cs | 2 +- .../UpdateStudentCommandHandler.cs | 2 +- .../QueryHandlers/GetStudentQueryHandler.cs | 2 +- .../QueryHandlers/GetStudentsQueryHandler.cs | 2 +- .../Queries/GetStudentQuery.cs | 2 +- .../Queries/GetStudentsQuery.cs | 2 +- BrightGlimmer.sln | 6 ++ 34 files changed, 435 insertions(+), 27 deletions(-) create mode 100644 BrightGlimmer.Auth/BrightGlimmer.Auth.csproj create mode 100644 BrightGlimmer.Auth/Controllers/UserController.cs create mode 100644 BrightGlimmer.Auth/Program.cs create mode 100644 BrightGlimmer.Auth/Properties/launchSettings.json create mode 100644 BrightGlimmer.Auth/Startup.cs create mode 100644 BrightGlimmer.Auth/appsettings.Development.json create mode 100644 BrightGlimmer.Auth/appsettings.json create mode 100644 BrightGlimmer.Data/AuthContext.cs create mode 100644 BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.Designer.cs create mode 100644 BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.cs create mode 100644 BrightGlimmer.Data/Migrations/Auth/AuthContextModelSnapshot.cs create mode 100644 BrightGlimmer.Data/Services/UserService.cs create mode 100644 BrightGlimmer.Data/bright_glimmer_auth.db create mode 100644 BrightGlimmer.Domain/Auth/User.cs rename BrightGlimmer.Domain/{ => Service}/Address.cs (98%) rename BrightGlimmer.Domain/{ => Service}/AssignedCourse.cs (96%) rename BrightGlimmer.Domain/{ => Service}/Course.cs (94%) rename BrightGlimmer.Domain/{ => Service}/Phone.cs (96%) rename BrightGlimmer.Domain/{ => Service}/PhoneType.cs (79%) rename BrightGlimmer.Domain/{ => Service}/Student.cs (98%) diff --git a/BrightGlimmer.Api/appsettings.json b/BrightGlimmer.Api/appsettings.json index 28234fd..36161fc 100644 --- a/BrightGlimmer.Api/appsettings.json +++ b/BrightGlimmer.Api/appsettings.json @@ -9,12 +9,5 @@ }, "ConnectionStrings": { "DefaultConnection": "Filename=../BrightGlimmer.Data/bright_glimmer.db" - }, - "amqp": { - "username": "guest", - "password": "guest", - "hostname": "localhost", - "uri": "amqp://localhost:5672/", - "virtualhost": "/" } } \ No newline at end of file diff --git a/BrightGlimmer.Auth/BrightGlimmer.Auth.csproj b/BrightGlimmer.Auth/BrightGlimmer.Auth.csproj new file mode 100644 index 0000000..29d06c1 --- /dev/null +++ b/BrightGlimmer.Auth/BrightGlimmer.Auth.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp2.2 + + + + + + + + + + + + + + + + + diff --git a/BrightGlimmer.Auth/Controllers/UserController.cs b/BrightGlimmer.Auth/Controllers/UserController.cs new file mode 100644 index 0000000..9356e7e --- /dev/null +++ b/BrightGlimmer.Auth/Controllers/UserController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace BrightGlimmer.Auth.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class UserController : ControllerBase + { + // GET api/values + [HttpGet] + public ActionResult> Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public ActionResult Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/BrightGlimmer.Auth/Program.cs b/BrightGlimmer.Auth/Program.cs new file mode 100644 index 0000000..1974c3b --- /dev/null +++ b/BrightGlimmer.Auth/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace BrightGlimmer.Auth +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/BrightGlimmer.Auth/Properties/launchSettings.json b/BrightGlimmer.Auth/Properties/launchSettings.json new file mode 100644 index 0000000..03abfa9 --- /dev/null +++ b/BrightGlimmer.Auth/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53671", + "sslPort": 44369 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "BrightGlimmer.Auth": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/BrightGlimmer.Auth/Startup.cs b/BrightGlimmer.Auth/Startup.cs new file mode 100644 index 0000000..59ca676 --- /dev/null +++ b/BrightGlimmer.Auth/Startup.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using BrightGlimmer.Data; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace BrightGlimmer.Auth +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + + /* Configure EF Core DbContext */ + services.AddDbContext(options => options.UseLazyLoadingProxies() + .UseSqlite(Configuration.GetConnectionString("DefaultConnection"))); + services.AddTransient(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseMvc(); + + // Makes sure that the database is in fact created + using (var serviceScope = app.ApplicationServices.GetService().CreateScope()) + { + var context = serviceScope.ServiceProvider.GetRequiredService(); + context.Database.EnsureCreated(); + } + } + } +} diff --git a/BrightGlimmer.Auth/appsettings.Development.json b/BrightGlimmer.Auth/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/BrightGlimmer.Auth/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/BrightGlimmer.Auth/appsettings.json b/BrightGlimmer.Auth/appsettings.json new file mode 100644 index 0000000..e7fe71f --- /dev/null +++ b/BrightGlimmer.Auth/appsettings.json @@ -0,0 +1,13 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + }, + "ConnectionStrings": { + "DefaultConnection": "Filename=../BrightGlimmer.Data/bright_glimmer_auth.db" + } +} diff --git a/BrightGlimmer.Data/AuthContext.cs b/BrightGlimmer.Data/AuthContext.cs new file mode 100644 index 0000000..3cabe61 --- /dev/null +++ b/BrightGlimmer.Data/AuthContext.cs @@ -0,0 +1,25 @@ +using BrightGlimmer.Data.Interfaces; +using BrightGlimmer.Domain.Auth; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BrightGlimmer.Data +{ + public class AuthContext : DbContext, IUnitOfWork + { + public AuthContext(DbContextOptions options) + : base(options) + { + } + + // dotnet ef migrations add NAME --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Auth --context AuthContext + // dotnet ef database update --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Auth --context AuthContext + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + } + + public DbSet Users { get; set; } + } +} diff --git a/BrightGlimmer.Data/BgContext.cs b/BrightGlimmer.Data/BgContext.cs index a5a6b60..1cb4796 100644 --- a/BrightGlimmer.Data/BgContext.cs +++ b/BrightGlimmer.Data/BgContext.cs @@ -1,5 +1,5 @@ using BrightGlimmer.Data.Interfaces; -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; @@ -15,9 +15,8 @@ namespace BrightGlimmer.Data { } - - // dotnet ef migrations add NAME --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Api - // dotnet ef database update --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Api + // dotnet ef migrations add NAME --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Api --context BgContext + // dotnet ef database update --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Api --context BgContext protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => diff --git a/BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.Designer.cs b/BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.Designer.cs new file mode 100644 index 0000000..b80e546 --- /dev/null +++ b/BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.Designer.cs @@ -0,0 +1,57 @@ +// +using System; +using BrightGlimmer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace BrightGlimmer.Data.Migrations.Auth +{ + [DbContext(typeof(AuthContext))] + [Migration("20190505233325_Create-Database")] + partial class CreateDatabase + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062"); + + modelBuilder.Entity("BrightGlimmer.Domain.Auth.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccountLocked"); + + b.Property("CreatedDate"); + + b.Property("Email"); + + b.Property("EmailConfirmed"); + + b.Property("FirstName"); + + b.Property("IsDeleted"); + + b.Property("LastName"); + + b.Property("MiddleName"); + + b.Property("ModifiedDate"); + + b.Property("PasswordHash"); + + b.Property("RetryAttempts"); + + b.Property("Username"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.cs b/BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.cs new file mode 100644 index 0000000..9b530f5 --- /dev/null +++ b/BrightGlimmer.Data/Migrations/Auth/20190505233325_Create-Database.cs @@ -0,0 +1,40 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace BrightGlimmer.Data.Migrations.Auth +{ + public partial class CreateDatabase : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(nullable: false), + IsDeleted = table.Column(nullable: false), + CreatedDate = table.Column(nullable: false), + ModifiedDate = table.Column(nullable: false), + Username = table.Column(nullable: true), + Email = table.Column(nullable: true), + FirstName = table.Column(nullable: true), + MiddleName = table.Column(nullable: true), + LastName = table.Column(nullable: true), + PasswordHash = table.Column(nullable: true), + EmailConfirmed = table.Column(nullable: false), + AccountLocked = table.Column(nullable: false), + RetryAttempts = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Users"); + } + } +} diff --git a/BrightGlimmer.Data/Migrations/Auth/AuthContextModelSnapshot.cs b/BrightGlimmer.Data/Migrations/Auth/AuthContextModelSnapshot.cs new file mode 100644 index 0000000..8e0bdd1 --- /dev/null +++ b/BrightGlimmer.Data/Migrations/Auth/AuthContextModelSnapshot.cs @@ -0,0 +1,55 @@ +// +using System; +using BrightGlimmer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace BrightGlimmer.Data.Migrations.Auth +{ + [DbContext(typeof(AuthContext))] + partial class AuthContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062"); + + modelBuilder.Entity("BrightGlimmer.Domain.Auth.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccountLocked"); + + b.Property("CreatedDate"); + + b.Property("Email"); + + b.Property("EmailConfirmed"); + + b.Property("FirstName"); + + b.Property("IsDeleted"); + + b.Property("LastName"); + + b.Property("MiddleName"); + + b.Property("ModifiedDate"); + + b.Property("PasswordHash"); + + b.Property("RetryAttempts"); + + b.Property("Username"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BrightGlimmer.Data/Repositories/StudentQueryRepository.cs b/BrightGlimmer.Data/Repositories/StudentQueryRepository.cs index eacca84..5047987 100644 --- a/BrightGlimmer.Data/Repositories/StudentQueryRepository.cs +++ b/BrightGlimmer.Data/Repositories/StudentQueryRepository.cs @@ -1,5 +1,5 @@ using BrightGlimmer.Data.Interfaces; -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using System; diff --git a/BrightGlimmer.Data/Services/UserService.cs b/BrightGlimmer.Data/Services/UserService.cs new file mode 100644 index 0000000..7cef23b --- /dev/null +++ b/BrightGlimmer.Data/Services/UserService.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BrightGlimmer.Data.Services +{ + public class UserService + { + } +} diff --git a/BrightGlimmer.Data/bright_glimmer_auth.db b/BrightGlimmer.Data/bright_glimmer_auth.db new file mode 100644 index 0000000000000000000000000000000000000000..26f45947a896a62d6ecbe9933de904338cda5805 GIT binary patch literal 20480 zcmeI&&vKJM90zbn(pED~(;L^7lbvZY39-#Mjx&;!TBhWWlsfIfVQ3(A#{?8MYLDu{ zNAcvf&*0ey@HsrX&=UIxa@Njw2MBC_`zN1W4lFr%VNm9gaS%=&Mq0wUAd12>LIgo5 z@O_EzX^O8)=>`83ubk(d7KHlduu}aklvdA$wV&1RtLJOq@`8~M0SG_<0uX=z1Rwwb z2teSrz!$%`B1w|?^$BxMCf;G>g;8=SbxlpRG-9b8LnCsMCzFSjGT}+qU72)@L5K7Q z7U>@v2I&s^2bQVoeT&G$efu(gXzD%HJSO|v@n%{y+VLhH^LPzBSbMIS^Gec?Zs<8Y zV22-MVrfUbiOXivh+g2*FwS#gP53jb?aWw^Twe^E-AqPr>C=(8BDLG%=RqGrP#|seAE#RpGl>{UPuT2?7v+00bZa0SG_<0uX=z1Rwx`e_UW&Eb48g(R|$4 zYHTU3R!iBkFBYU~d_l@NaUxHtEA>Y;zP|LHj;McHYc?9&N}2yIvHDBk8xjN{009U< z00Izz00bZa0SG_<0{^AJgQ9+a@uEQd{-6Kp9|-~wfB*y_009U<00Izz00bZafjcY^ izyHVc{~aD+{4@wa00Izz00bZa0SG_<0uX=z7x)7tXB=|? literal 0 HcmV?d00001 diff --git a/BrightGlimmer.Domain/Auth/User.cs b/BrightGlimmer.Domain/Auth/User.cs new file mode 100644 index 0000000..cd400a6 --- /dev/null +++ b/BrightGlimmer.Domain/Auth/User.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BrightGlimmer.Domain.Auth +{ + public class User : Entity + { + public string Username { get; private set; } + public string Email { get; private set; } + public string FirstName { get; private set; } + public string MiddleName { get; private set; } + public string LastName { get; private set; } + public string PasswordHash { get; private set; } + public bool EmailConfirmed { get; private set; } + public bool AccountLocked { get; private set; } + public int RetryAttempts { get; private set; } + } +} diff --git a/BrightGlimmer.Domain/Entity.cs b/BrightGlimmer.Domain/Entity.cs index 1caf729..fedac3f 100644 --- a/BrightGlimmer.Domain/Entity.cs +++ b/BrightGlimmer.Domain/Entity.cs @@ -29,6 +29,7 @@ namespace BrightGlimmer.Domain IsDeleted = true; } + /* TODO: Currently not working when entities modified */ protected void MarkModified() { ModifiedDate = DateTime.UtcNow; diff --git a/BrightGlimmer.Domain/Address.cs b/BrightGlimmer.Domain/Service/Address.cs similarity index 98% rename from BrightGlimmer.Domain/Address.cs rename to BrightGlimmer.Domain/Service/Address.cs index cd1098c..4f918f5 100644 --- a/BrightGlimmer.Domain/Address.cs +++ b/BrightGlimmer.Domain/Service/Address.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text; -namespace BrightGlimmer.Domain +namespace BrightGlimmer.Domain.Service { [Table("Addresses")] public class Address : Entity diff --git a/BrightGlimmer.Domain/AssignedCourse.cs b/BrightGlimmer.Domain/Service/AssignedCourse.cs similarity index 96% rename from BrightGlimmer.Domain/AssignedCourse.cs rename to BrightGlimmer.Domain/Service/AssignedCourse.cs index 7aec573..1f18697 100644 --- a/BrightGlimmer.Domain/AssignedCourse.cs +++ b/BrightGlimmer.Domain/Service/AssignedCourse.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text; -namespace BrightGlimmer.Domain +namespace BrightGlimmer.Domain.Service { [Table("AssignedCourses")] public class AssignedCourse : Entity diff --git a/BrightGlimmer.Domain/Course.cs b/BrightGlimmer.Domain/Service/Course.cs similarity index 94% rename from BrightGlimmer.Domain/Course.cs rename to BrightGlimmer.Domain/Service/Course.cs index 05fc513..7c6fe4f 100644 --- a/BrightGlimmer.Domain/Course.cs +++ b/BrightGlimmer.Domain/Service/Course.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text; -namespace BrightGlimmer.Domain +namespace BrightGlimmer.Domain.Service { [Table("Courses")] public class Course : Entity diff --git a/BrightGlimmer.Domain/Phone.cs b/BrightGlimmer.Domain/Service/Phone.cs similarity index 96% rename from BrightGlimmer.Domain/Phone.cs rename to BrightGlimmer.Domain/Service/Phone.cs index 3fda723..0c012b2 100644 --- a/BrightGlimmer.Domain/Phone.cs +++ b/BrightGlimmer.Domain/Service/Phone.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text; -namespace BrightGlimmer.Domain +namespace BrightGlimmer.Domain.Service { [Table("Phones")] public class Phone : Entity diff --git a/BrightGlimmer.Domain/PhoneType.cs b/BrightGlimmer.Domain/Service/PhoneType.cs similarity index 79% rename from BrightGlimmer.Domain/PhoneType.cs rename to BrightGlimmer.Domain/Service/PhoneType.cs index 405a3b1..b21e399 100644 --- a/BrightGlimmer.Domain/PhoneType.cs +++ b/BrightGlimmer.Domain/Service/PhoneType.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace BrightGlimmer.Domain +namespace BrightGlimmer.Domain.Service { public enum PhoneType { diff --git a/BrightGlimmer.Domain/Student.cs b/BrightGlimmer.Domain/Service/Student.cs similarity index 98% rename from BrightGlimmer.Domain/Student.cs rename to BrightGlimmer.Domain/Service/Student.cs index 280d377..bc71151 100644 --- a/BrightGlimmer.Domain/Student.cs +++ b/BrightGlimmer.Domain/Service/Student.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; -namespace BrightGlimmer.Domain +namespace BrightGlimmer.Domain.Service { [Table("Students")] public class Student : Entity diff --git a/BrightGlimmer.Service/Commands/CreateStudentCommand.cs b/BrightGlimmer.Service/Commands/CreateStudentCommand.cs index e0204c1..9f4045a 100644 --- a/BrightGlimmer.Service/Commands/CreateStudentCommand.cs +++ b/BrightGlimmer.Service/Commands/CreateStudentCommand.cs @@ -1,4 +1,4 @@ -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using MediatR; using System.Collections.Generic; diff --git a/BrightGlimmer.Service/Commands/UpdateStudentCommand.cs b/BrightGlimmer.Service/Commands/UpdateStudentCommand.cs index 464d110..6bc6fb2 100644 --- a/BrightGlimmer.Service/Commands/UpdateStudentCommand.cs +++ b/BrightGlimmer.Service/Commands/UpdateStudentCommand.cs @@ -1,4 +1,4 @@ -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using MediatR; using System; using System.Collections.Generic; diff --git a/BrightGlimmer.Service/Handlers/CommandHandlers/CreateStudentCommandHandler.cs b/BrightGlimmer.Service/Handlers/CommandHandlers/CreateStudentCommandHandler.cs index 6623bdd..581dc1b 100644 --- a/BrightGlimmer.Service/Handlers/CommandHandlers/CreateStudentCommandHandler.cs +++ b/BrightGlimmer.Service/Handlers/CommandHandlers/CreateStudentCommandHandler.cs @@ -1,5 +1,5 @@ using BrightGlimmer.Data.Interfaces; -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using BrightGlimmer.Service.Commands; using MediatR; using System.Threading; diff --git a/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs b/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs index 278a03c..5988cda 100644 --- a/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs +++ b/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs @@ -1,5 +1,5 @@ using BrightGlimmer.Data.Interfaces; -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using BrightGlimmer.Service.Commands; using MediatR; using System; diff --git a/BrightGlimmer.Service/Handlers/CommandHandlers/UpdateStudentCommandHandler.cs b/BrightGlimmer.Service/Handlers/CommandHandlers/UpdateStudentCommandHandler.cs index 98395bb..14537a1 100644 --- a/BrightGlimmer.Service/Handlers/CommandHandlers/UpdateStudentCommandHandler.cs +++ b/BrightGlimmer.Service/Handlers/CommandHandlers/UpdateStudentCommandHandler.cs @@ -1,5 +1,5 @@ using BrightGlimmer.Data.Interfaces; -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using BrightGlimmer.Service.Commands; using MediatR; using System; diff --git a/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentQueryHandler.cs b/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentQueryHandler.cs index 5e8c69e..6170eba 100644 --- a/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentQueryHandler.cs +++ b/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentQueryHandler.cs @@ -1,5 +1,5 @@ using BrightGlimmer.Data.Interfaces; -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using BrightGlimmer.Service.Queries; using MediatR; using System.Threading; diff --git a/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentsQueryHandler.cs b/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentsQueryHandler.cs index 0fd9281..61589b5 100644 --- a/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentsQueryHandler.cs +++ b/BrightGlimmer.Service/Handlers/QueryHandlers/GetStudentsQueryHandler.cs @@ -1,5 +1,5 @@ using BrightGlimmer.Data.Interfaces; -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using BrightGlimmer.Service.Queries; using MediatR; using Microsoft.EntityFrameworkCore; diff --git a/BrightGlimmer.Service/Queries/GetStudentQuery.cs b/BrightGlimmer.Service/Queries/GetStudentQuery.cs index 0d8642e..69a2618 100644 --- a/BrightGlimmer.Service/Queries/GetStudentQuery.cs +++ b/BrightGlimmer.Service/Queries/GetStudentQuery.cs @@ -1,4 +1,4 @@ -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using MediatR; using System; diff --git a/BrightGlimmer.Service/Queries/GetStudentsQuery.cs b/BrightGlimmer.Service/Queries/GetStudentsQuery.cs index e91181c..62992ad 100644 --- a/BrightGlimmer.Service/Queries/GetStudentsQuery.cs +++ b/BrightGlimmer.Service/Queries/GetStudentsQuery.cs @@ -1,4 +1,4 @@ -using BrightGlimmer.Domain; +using BrightGlimmer.Domain.Service; using MediatR; using System.Collections.Generic; diff --git a/BrightGlimmer.sln b/BrightGlimmer.sln index 354b3b1..3e9e9ef 100644 --- a/BrightGlimmer.sln +++ b/BrightGlimmer.sln @@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrightGlimmer.Service", "Br EndProject Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "BrightGlimmer.Client", "BrightGlimmer.Client\BrightGlimmer.Client.njsproj", "{6971AB72-FBC2-4F3F-A59C-319E377A9A51}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightGlimmer.Auth", "BrightGlimmer.Auth\BrightGlimmer.Auth.csproj", "{E3265892-2D6C-4D51-A7A4-DF845C17CF49}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,6 +41,10 @@ Global {6971AB72-FBC2-4F3F-A59C-319E377A9A51}.Debug|Any CPU.Build.0 = Debug|Any CPU {6971AB72-FBC2-4F3F-A59C-319E377A9A51}.Release|Any CPU.ActiveCfg = Release|Any CPU {6971AB72-FBC2-4F3F-A59C-319E377A9A51}.Release|Any CPU.Build.0 = Release|Any CPU + {E3265892-2D6C-4D51-A7A4-DF845C17CF49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E3265892-2D6C-4D51-A7A4-DF845C17CF49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E3265892-2D6C-4D51-A7A4-DF845C17CF49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E3265892-2D6C-4D51-A7A4-DF845C17CF49}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE