diff --git a/VolunterSite.WebUI/Cozy.Service/Class1.cs b/VolunterSite.WebUI/Cozy.Service/Class1.cs new file mode 100644 index 0000000..e2f4757 --- /dev/null +++ b/VolunterSite.WebUI/Cozy.Service/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace Cozy.Service +{ + public class Class1 + { + } +} diff --git a/VolunterSite.WebUI/Cozy.Service/Cozy.Service.csproj b/VolunterSite.WebUI/Cozy.Service/Cozy.Service.csproj new file mode 100644 index 0000000..c16c6d5 --- /dev/null +++ b/VolunterSite.WebUI/Cozy.Service/Cozy.Service.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp2.2 + + + diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Context/VolunteerSiteDbContext.cs b/VolunterSite.WebUI/VolunteerSite.Data/Context/VolunteerSiteDbContext.cs new file mode 100644 index 0000000..9e75087 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Context/VolunteerSiteDbContext.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using VolunteerSite.Domain.Models; +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; + +namespace VolunteerSite.Data.Context +{ + public class VolunteerSiteDbContext : IdentityDbContext + { + //public DbSet Volunteers { get; set; } + + + public DbSet VolunteerGroups { get; set; } + public DbSet Organizations { get; set; } + public DbSet JobListings { get; set; } + public DbSet GroupMembers { get; set; } + + // Setting up the provider (SQL Server) and location of the Database + protected override void OnConfiguring(DbContextOptionsBuilder optionBuilder) + { + // bad way of providing the connection string + optionBuilder.UseSqlServer(@"Server=(localdb)\MSSQLLocalDB;Database=volunteersite;Trusted_Connection=True"); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.Entity() + .HasOne(g => g.GroupAdmin) + .WithMany(u => u.VolunteerGroups) + .HasForeignKey(g => g.GroupAdminId) + .HasConstraintName("ForeignKey_VolunteerGroup_AppUser"); + + modelBuilder.Entity() + .HasOne(o => o.OrganizationAdmin) + .WithMany(u => u.Organizations) + .HasForeignKey(o => o.OrganizationAdminId) + .HasConstraintName("ForeignKey_Organization_AppUser"); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreGroupMemberRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreGroupMemberRepository.cs new file mode 100644 index 0000000..2f584d6 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreGroupMemberRepository.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Context; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.EFCore +{ + public class EFCoreGroupMemberRepository : IGroupMemberRepository + { + public GroupMember Create(GroupMember newGroupMember) + { + using (var context = new VolunteerSiteDbContext()) + { + context.GroupMembers.Add(newGroupMember); + context.SaveChanges(); + + return newGroupMember; + } + } + + public bool DeleteById(int groupMemberId) + { + using (var context = new VolunteerSiteDbContext()) + { + var groupMemberToBeDeleted = GetById(groupMemberId); + context.Remove(groupMemberToBeDeleted); + context.SaveChanges(); + + if (GetById(groupMemberId) == null) + { + return true; + } + + return false; + } + } + + public ICollection GetByGroupId(string volunteerGroupId) + { + using (var context = new VolunteerSiteDbContext()) + { + return context.GroupMembers.Where(m => m.VolunteerGroupId == volunteerGroupId).ToList(); + } + } + + public GroupMember GetById(int groupMemberId) + { + using (var context = new VolunteerSiteDbContext()) + { + return context.GroupMembers.Single(m => m.Id == groupMemberId); + } + } + + public GroupMember Update(GroupMember updatedGroupMember) + { + using (var context = new VolunteerSiteDbContext()) + { + var existingGroupMember = GetById(updatedGroupMember.Id); + context.Entry(existingGroupMember).CurrentValues.SetValues(updatedGroupMember); + context.SaveChanges(); + + return existingGroupMember; + } + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreJobListingRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreJobListingRepository.cs new file mode 100644 index 0000000..f0070cb --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreJobListingRepository.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Context; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.EFCore +{ + public class EFCoreJobListingRepository : IJobListingRepository + { + public JobListing Create(JobListing newJobListing) + { + using (var context = new VolunteerSiteDbContext()) + { + context.JobListings.Add(newJobListing); + context.SaveChanges(); + + return newJobListing; + } + } + + public bool DeleteById(int jobListingId) + { + using (var context = new VolunteerSiteDbContext()) + { + var jobListingToBeDeleted = GetById(jobListingId); + context.Remove(jobListingToBeDeleted); + context.SaveChanges(); + + if (GetById(jobListingId) == null) + { + return true; + } + + return false; + } + } + + public JobListing GetById(int jobListingId) + { + using (var context = new VolunteerSiteDbContext()) + { + return context.JobListings.Single(j => j.Id == jobListingId); + } + } + + public ICollection GetByOrganizationId(string organizationId) + { + using (var context = new VolunteerSiteDbContext()) + { + return context.JobListings.Where(j => j.OrganizationId == organizationId).ToList(); + } + } + + public ICollection GetByTypeOfJob(string typeOfJob) + { + using (var context = new VolunteerSiteDbContext()) + { + return context.JobListings.Where(m => m.TypeOfJob == typeOfJob).ToList(); + } + } + + public JobListing Update(JobListing updatedJobListing) + { + using (var context = new VolunteerSiteDbContext()) + { + var existingJobListing = GetById(updatedJobListing.Id); + context.Entry(existingJobListing).CurrentValues.SetValues(updatedJobListing); + context.SaveChanges(); + + return existingJobListing; + } + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreOrganizationRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreOrganizationRepository.cs new file mode 100644 index 0000000..754def0 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreOrganizationRepository.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Context; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.EFCore +{ + public class EFCoreOrganizationRepository : IOrganizationRepository + { + public Organization Create(Organization newOrganization) + { + using (var context = new VolunteerSiteDbContext()) + { + context.Organizations.Add(newOrganization); + context.SaveChanges(); + + return newOrganization; + } + } + + public bool DeleteById(int organizationId) + { + using (var context = new VolunteerSiteDbContext()) + { + var organizationToBeDeleted = GetById(organizationId); + context.Remove(organizationToBeDeleted); + context.SaveChanges(); + + if (GetById(organizationId) == null) + { + return true; + } + + return false; + } + } + + public Organization GetById(int organizationId) + { + using (var context = new VolunteerSiteDbContext()) + { + return context.Organizations.Single(o => o.Id == organizationId); + } + } + + public Organization Update(Organization updatedOrganization) + { + using (var context = new VolunteerSiteDbContext()) + { + var existingOrganization = GetById(updatedOrganization.Id); + context.Entry(existingOrganization).CurrentValues.SetValues(updatedOrganization); + context.SaveChanges(); + + return existingOrganization; + } + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreVolunteerGroupRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreVolunteerGroupRepository.cs new file mode 100644 index 0000000..36686f2 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/EFCore/EFCoreVolunteerGroupRepository.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Context; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.EFCore +{ + public class EFCoreVolunteerGroupRepository : IVolunteerGroupRepository + { + public VolunteerGroup Create(VolunteerGroup newVolunteerGroup) + { + using (var context = new VolunteerSiteDbContext()) + { + context.VolunteerGroups.Add(newVolunteerGroup); + context.SaveChanges(); + + return newVolunteerGroup; + } + } + + public bool DeleteById(int volunteerGroupId) + { + using (var context = new VolunteerSiteDbContext()) + { + var volunteerGroupToBeDeleted = GetById(volunteerGroupId); + context.Remove(volunteerGroupToBeDeleted); + context.SaveChanges(); + + if (GetById(volunteerGroupId) == null) + { + return true; + } + + return false; + } + } + + public VolunteerGroup GetById(int volunteerGroupId) + { + using (var context = new VolunteerSiteDbContext()) + { + return context.VolunteerGroups.Single(v => v.Id == volunteerGroupId); + } + } + + public VolunteerGroup Update(VolunteerGroup updatedVolunteerGroup) + { + using (var context = new VolunteerSiteDbContext()) + { + var existingVolunteerGroup = GetById(updatedVolunteerGroup.Id); + context.Entry(existingVolunteerGroup).CurrentValues.SetValues(updatedVolunteerGroup); + context.SaveChanges(); + + return existingVolunteerGroup; + } + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockGroupMemberRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockGroupMemberRepository.cs new file mode 100644 index 0000000..a88335c --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockGroupMemberRepository.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.Mock +{ + public class MockGroupMemberRepository : IGroupMemberRepository + { + private List GroupMembers = new List() + { + + }; + + public GroupMember GetById(int groupMemberId) + { + return GroupMembers.Single(g => g.Id == groupMemberId); + } + + public GroupMember Create(GroupMember newHome) + { + newHome.Id = GroupMembers.OrderByDescending(g => g.Id).Single().Id + 1; + GroupMembers.Add(newHome); + + return newHome; + } + + public GroupMember Update(GroupMember updatedGroupMember) + { + DeleteById(updatedGroupMember.Id); // delete the existing home + GroupMembers.Add(updatedGroupMember); + + return updatedGroupMember; + } + + public bool DeleteById(int groupMemberId) + { + var GroupMember = GetById(groupMemberId); + GroupMembers.Remove(GroupMember); + return true; + } + + public ICollection GetByGroupId(string volunteerGroupId) + { + return GroupMembers.FindAll(m => m.VolunteerGroupId == volunteerGroupId); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockJobListingRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockJobListingRepository.cs new file mode 100644 index 0000000..6aef28a --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockJobListingRepository.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.Mock +{ + class MockJobListingRepository : IJobListingRepository + { + private List JobListings = new List() + { + + }; + + public JobListing GetById(int jobListingId) + { + return JobListings.Single(j => j.Id == jobListingId); + } + + public ICollection GetByOrganizationId(string organizationId) + { + return JobListings.FindAll(j => j.OrganizationId == organizationId); + } + + public ICollection GetByTypeOfJob(string typeOfJob) + { + return JobListings.FindAll(j => j.TypeOfJob == typeOfJob); + } + + public JobListing Create(JobListing newJobListing) + { + newJobListing.Id = JobListings.OrderByDescending(j => j.Id).Single().Id + 1; + JobListings.Add(newJobListing); + + return newJobListing; + } + + public JobListing Update(JobListing updatedJobListing) + { + DeleteById(updatedJobListing.Id); // delete the existing home + JobListings.Add(updatedJobListing); + + return updatedJobListing; + } + + public bool DeleteById(int jobListingId) + { + var JobListing = GetById(jobListingId); + JobListings.Remove(JobListing); + return true; + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockOrganizationRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockOrganizationRepository.cs new file mode 100644 index 0000000..7f1740c --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockOrganizationRepository.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.Mock +{ + class MockOrganizationRepository : IOrganizationRepository + { + private List Organizations = new List() + { + + }; + + public Organization Create(Organization newOrganization) + { + newOrganization.Id = Organizations.OrderByDescending(h => h.Id).Single().Id + 1; + Organizations.Add(newOrganization); + + return newOrganization; + } + + public bool DeleteById(int organizationId) + { + var organization = GetById(organizationId); + Organizations.Remove(organization); + return true; + } + + public Organization GetById(int organizationId) + { + return Organizations.Single(h => h.Id == organizationId); + } + + public Organization Update(Organization updatedOrganization) + { + DeleteById(updatedOrganization.Id); + Organizations.Add(updatedOrganization); + + return updatedOrganization; + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockVolunteerGroupRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockVolunteerGroupRepository.cs new file mode 100644 index 0000000..1e7b624 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockVolunteerGroupRepository.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.Mock +{ + public class MockVolunteerGroupRepository : IVolunteerGroupRepository + { + private List VolunteerGroups = new List() + { + + }; + + public VolunteerGroup Create(VolunteerGroup newVolunteerGroup) + { + newVolunteerGroup.Id = VolunteerGroups.OrderByDescending(v => v.Id).Single().Id + 1; + VolunteerGroups.Add(newVolunteerGroup); + + return newVolunteerGroup; + } + + public bool DeleteById(int volunteerGroupId) + { + var home = GetById(volunteerGroupId); + VolunteerGroups.Remove(home); + return true; + } + + public VolunteerGroup GetById(int volunteerGroupId) + { + return VolunteerGroups.Single(v => v.Id == volunteerGroupId); + } + + public VolunteerGroup Update(VolunteerGroup updatedVolunteerGroup) + { + DeleteById(updatedVolunteerGroup.Id); + VolunteerGroups.Add(updatedVolunteerGroup); + + return updatedVolunteerGroup; + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockVolunteerRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockVolunteerRepository.cs new file mode 100644 index 0000000..1e893cf --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Implementation/Mock/MockVolunteerRepository.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Implementation.Mock +{ + class MockVolunteerRepository : IVolunteerRepository + { + private List Volunteers = new List() + { + + }; + + public Volunteer Create(Volunteer newVolunteer) + { + newVolunteer.Id = Volunteers.OrderByDescending(h => h.Id).Single().Id + 1; + Volunteers.Add(newVolunteer); + + return newVolunteer; + } + + public bool DeleteById(int volunteerId) + { + var home = GetById(volunteerId); + Volunteers.Remove(home); + return true; + } + + public Volunteer GetById(int volunteerId) + { + return Volunteers.Single(h => h.Id == volunteerId); + } + + public Volunteer Update(Volunteer updatedVolunteer) + { + DeleteById(updatedVolunteer.Id); + Volunteers.Add(updatedVolunteer); + + return updatedVolunteer; + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IGroupMemberRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IGroupMemberRepository.cs new file mode 100644 index 0000000..a5b239e --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IGroupMemberRepository.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Interfaces +{ + public interface IGroupMemberRepository + { + //read + GroupMember GetById(int groupMemberId); + ICollection GetByGroupId(string volunteerGroupId); + + //create + GroupMember Create(GroupMember newGroupMember); + + //Update + GroupMember Update(GroupMember UpdatedGroupMember); + + //Delete + bool DeleteById(int groupMemberId); + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IJobListingRepository - Copy.cs b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IJobListingRepository - Copy.cs new file mode 100644 index 0000000..9e219ef --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IJobListingRepository - Copy.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Interfaces +{ + public interface IJobListingRepository + { + //Read + JobListing GetById(int jobListingId); + ICollection GetByOrganizationId(string organizationId); + ICollection GetByTypeOfJob(string typeOfJob); + + // Create + JobListing Create(JobListing newJobListing); + + //Update + JobListing Update(JobListing updatedJobListing); + + //Delete + bool DeleteById(int jobListingId); + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IOrganizationRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IOrganizationRepository.cs new file mode 100644 index 0000000..f72de84 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IOrganizationRepository.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Interfaces +{ + public interface IOrganizationRepository + { + //Read + Organization GetById(int organizationId); + + // Create + Organization Create(Organization newOrganization); + + //Update + Organization Update(Organization updatedOrganization); + + //Delete + bool DeleteById(int organizationId); + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IVolunteerGroupRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IVolunteerGroupRepository.cs new file mode 100644 index 0000000..c8204a4 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IVolunteerGroupRepository.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Interfaces +{ + public interface IVolunteerGroupRepository + { + //Read + VolunteerGroup GetById(int volunteerGroupId); + + // Create + VolunteerGroup Create(VolunteerGroup newVolunteerGroup); + + //Update + VolunteerGroup Update(VolunteerGroup updatedVolunteerGroup); + + //Delete + bool DeleteById(int volunteerGroupId); + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IVolunteerRepository.cs b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IVolunteerRepository.cs new file mode 100644 index 0000000..786de15 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Interfaces/IVolunteerRepository.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; + +namespace VolunteerSite.Data.Interfaces +{ + public interface IVolunteerRepository + { + //Read + Volunteer GetById(int volunteerId); + + // Create + Volunteer Create(Volunteer newVolunteer); + + //Update + Volunteer Update(Volunteer updatedVolunteer); + + //Delete + bool DeleteById(int volunteerId); + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190204080041_initial.Designer.cs b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190204080041_initial.Designer.cs new file mode 100644 index 0000000..d5218b7 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190204080041_initial.Designer.cs @@ -0,0 +1,168 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using VolunteerSite.Data.Context; + +namespace VolunteerSite.Data.Migrations +{ + [DbContext(typeof(VolunteerSiteDbContext))] + [Migration("20190204080041_initial")] + partial class initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.1-servicing-10028") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Email"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("PhoneNumber"); + + b.Property("TotalHours"); + + b.Property("VolunteerGroupId"); + + b.Property("VolunteerGroupId1"); + + b.HasKey("Id"); + + b.HasIndex("VolunteerGroupId1"); + + b.ToTable("GroupMembers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("City"); + + b.Property("Date"); + + b.Property("Description"); + + b.Property("OrganizationId"); + + b.Property("OrganizationId1"); + + b.Property("PositionsAvailable"); + + b.Property("State"); + + b.Property("TypeOfJob"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId1"); + + b.ToTable("JobListings"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("City"); + + b.Property("CompanyName"); + + b.Property("Email"); + + b.Property("PhoneNumber"); + + b.Property("State"); + + b.HasKey("Id"); + + b.ToTable("Organizations"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Volunteer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Email"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("PhoneNumber"); + + b.Property("SkillsAndExperience"); + + b.HasKey("Id"); + + b.ToTable("Volunteers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("GroupName"); + + b.Property("GroupOwnerId"); + + b.Property("GroupOwnerId1"); + + b.HasKey("Id"); + + b.HasIndex("GroupOwnerId1"); + + b.ToTable("VolunteerGroups"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.HasOne("VolunteerSite.Domain.Models.VolunteerGroup", "VolunteerGroup") + .WithMany("GroupMembers") + .HasForeignKey("VolunteerGroupId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.HasOne("VolunteerSite.Domain.Models.Organization", "Organization") + .WithMany("JobListings") + .HasForeignKey("OrganizationId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.HasOne("VolunteerSite.Domain.Models.Volunteer", "GroupOwner") + .WithMany("VolunteerGroups") + .HasForeignKey("GroupOwnerId1"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190204080041_initial.cs b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190204080041_initial.cs new file mode 100644 index 0000000..3bee4d1 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190204080041_initial.cs @@ -0,0 +1,153 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace VolunteerSite.Data.Migrations +{ + public partial class initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Organizations", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + CompanyName = table.Column(nullable: true), + Address = table.Column(nullable: true), + City = table.Column(nullable: true), + State = table.Column(nullable: true), + Email = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Organizations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Volunteers", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + FirstName = table.Column(nullable: true), + LastName = table.Column(nullable: true), + Email = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true), + SkillsAndExperience = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Volunteers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "JobListings", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Address = table.Column(nullable: true), + City = table.Column(nullable: true), + State = table.Column(nullable: true), + PositionsAvailable = table.Column(nullable: false), + Description = table.Column(nullable: true), + TypeOfJob = table.Column(nullable: true), + Date = table.Column(nullable: false), + OrganizationId = table.Column(nullable: true), + OrganizationId1 = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_JobListings", x => x.Id); + table.ForeignKey( + name: "FK_JobListings_Organizations_OrganizationId1", + column: x => x.OrganizationId1, + principalTable: "Organizations", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "VolunteerGroups", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + GroupName = table.Column(nullable: true), + GroupOwnerId = table.Column(nullable: true), + GroupOwnerId1 = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_VolunteerGroups", x => x.Id); + table.ForeignKey( + name: "FK_VolunteerGroups_Volunteers_GroupOwnerId1", + column: x => x.GroupOwnerId1, + principalTable: "Volunteers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "GroupMembers", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + FirstName = table.Column(nullable: true), + LastName = table.Column(nullable: true), + Email = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true), + TotalHours = table.Column(nullable: false), + VolunteerGroupId = table.Column(nullable: true), + VolunteerGroupId1 = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_GroupMembers", x => x.Id); + table.ForeignKey( + name: "FK_GroupMembers_VolunteerGroups_VolunteerGroupId1", + column: x => x.VolunteerGroupId1, + principalTable: "VolunteerGroups", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_GroupMembers_VolunteerGroupId1", + table: "GroupMembers", + column: "VolunteerGroupId1"); + + migrationBuilder.CreateIndex( + name: "IX_JobListings_OrganizationId1", + table: "JobListings", + column: "OrganizationId1"); + + migrationBuilder.CreateIndex( + name: "IX_VolunteerGroups_GroupOwnerId1", + table: "VolunteerGroups", + column: "GroupOwnerId1"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "GroupMembers"); + + migrationBuilder.DropTable( + name: "JobListings"); + + migrationBuilder.DropTable( + name: "VolunteerGroups"); + + migrationBuilder.DropTable( + name: "Organizations"); + + migrationBuilder.DropTable( + name: "Volunteers"); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410044449_identity-provider.Designer.cs b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410044449_identity-provider.Designer.cs new file mode 100644 index 0000000..047adc0 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410044449_identity-provider.Designer.cs @@ -0,0 +1,399 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using VolunteerSite.Data.Context; + +namespace VolunteerSite.Data.Migrations +{ + [DbContext(typeof(VolunteerSiteDbContext))] + [Migration("20190410044449_identity-provider")] + partial class identityprovider + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.3-servicing-35854") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.AppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityStamp"); + + b.Property("SkillsAndExperience"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Email"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("PhoneNumber"); + + b.Property("TotalHours"); + + b.Property("VolunteerGroupId"); + + b.Property("VolunteerGroupId1"); + + b.HasKey("Id"); + + b.HasIndex("VolunteerGroupId1"); + + b.ToTable("GroupMembers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("City"); + + b.Property("Date"); + + b.Property("Description"); + + b.Property("OrganizationId"); + + b.Property("OrganizationId1"); + + b.Property("PositionsAvailable"); + + b.Property("State"); + + b.Property("TypeOfJob"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId1"); + + b.ToTable("JobListings"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("AppUserId"); + + b.Property("City"); + + b.Property("CompanyName"); + + b.Property("Email"); + + b.Property("PhoneNumber"); + + b.Property("State"); + + b.HasKey("Id"); + + b.HasIndex("AppUserId"); + + b.ToTable("Organizations"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Volunteer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Email"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("PhoneNumber"); + + b.Property("SkillsAndExperience"); + + b.HasKey("Id"); + + b.ToTable("Volunteer"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("AppUserId"); + + b.Property("GroupName"); + + b.Property("GroupOwnerId"); + + b.Property("GroupOwnerId1"); + + b.HasKey("Id"); + + b.HasIndex("AppUserId"); + + b.HasIndex("GroupOwnerId1"); + + b.ToTable("VolunteerGroups"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.HasOne("VolunteerSite.Domain.Models.VolunteerGroup", "VolunteerGroup") + .WithMany("GroupMembers") + .HasForeignKey("VolunteerGroupId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.HasOne("VolunteerSite.Domain.Models.Organization", "Organization") + .WithMany("JobListings") + .HasForeignKey("OrganizationId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Organization", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany("Organizations") + .HasForeignKey("AppUserId"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany("VolunteerGroups") + .HasForeignKey("AppUserId"); + + b.HasOne("VolunteerSite.Domain.Models.Volunteer", "GroupOwner") + .WithMany("VolunteerGroups") + .HasForeignKey("GroupOwnerId1"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410044449_identity-provider.cs b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410044449_identity-provider.cs new file mode 100644 index 0000000..6caccc8 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410044449_identity-provider.cs @@ -0,0 +1,333 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace VolunteerSite.Data.Migrations +{ + public partial class identityprovider : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_VolunteerGroups_Volunteers_GroupOwnerId1", + table: "VolunteerGroups"); + + migrationBuilder.DropPrimaryKey( + name: "PK_Volunteers", + table: "Volunteers"); + + migrationBuilder.RenameTable( + name: "Volunteers", + newName: "Volunteer"); + + migrationBuilder.AddColumn( + name: "AppUserId", + table: "VolunteerGroups", + nullable: true); + + migrationBuilder.AddColumn( + name: "AppUserId", + table: "Organizations", + nullable: true); + + migrationBuilder.AddPrimaryKey( + name: "PK_Volunteer", + table: "Volunteer", + column: "Id"); + + migrationBuilder.CreateTable( + name: "AspNetRoles", + columns: table => new + { + Id = table.Column(nullable: false), + Name = table.Column(maxLength: 256, nullable: true), + NormalizedName = table.Column(maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AspNetUsers", + columns: table => new + { + Id = table.Column(nullable: false), + UserName = table.Column(maxLength: 256, nullable: true), + NormalizedUserName = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: true), + NormalizedEmail = table.Column(maxLength: 256, nullable: true), + EmailConfirmed = table.Column(nullable: false), + PasswordHash = table.Column(nullable: true), + SecurityStamp = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true), + PhoneNumberConfirmed = table.Column(nullable: false), + TwoFactorEnabled = table.Column(nullable: false), + LockoutEnd = table.Column(nullable: true), + LockoutEnabled = table.Column(nullable: false), + AccessFailedCount = table.Column(nullable: false), + FirstName = table.Column(nullable: true), + LastName = table.Column(nullable: true), + SkillsAndExperience = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AspNetRoleClaims", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + RoleId = table.Column(nullable: false), + ClaimType = table.Column(nullable: true), + ClaimValue = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserClaims", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + ClaimType = table.Column(nullable: true), + ClaimValue = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetUserClaims_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserLogins", + columns: table => new + { + LoginProvider = table.Column(nullable: false), + ProviderKey = table.Column(nullable: false), + ProviderDisplayName = table.Column(nullable: true), + UserId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); + table.ForeignKey( + name: "FK_AspNetUserLogins_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserRoles", + columns: table => new + { + UserId = table.Column(nullable: false), + RoleId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserTokens", + columns: table => new + { + UserId = table.Column(nullable: false), + LoginProvider = table.Column(nullable: false), + Name = table.Column(nullable: false), + Value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AspNetUserTokens_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_VolunteerGroups_AppUserId", + table: "VolunteerGroups", + column: "AppUserId"); + + migrationBuilder.CreateIndex( + name: "IX_Organizations_AppUserId", + table: "Organizations", + column: "AppUserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetRoleClaims_RoleId", + table: "AspNetRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "AspNetRoles", + column: "NormalizedName", + unique: true, + filter: "[NormalizedName] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserClaims_UserId", + table: "AspNetUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserLogins_UserId", + table: "AspNetUserLogins", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserRoles_RoleId", + table: "AspNetUserRoles", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "EmailIndex", + table: "AspNetUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "UserNameIndex", + table: "AspNetUsers", + column: "NormalizedUserName", + unique: true, + filter: "[NormalizedUserName] IS NOT NULL"); + + migrationBuilder.AddForeignKey( + name: "FK_Organizations_AspNetUsers_AppUserId", + table: "Organizations", + column: "AppUserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_VolunteerGroups_AspNetUsers_AppUserId", + table: "VolunteerGroups", + column: "AppUserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_VolunteerGroups_Volunteer_GroupOwnerId1", + table: "VolunteerGroups", + column: "GroupOwnerId1", + principalTable: "Volunteer", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Organizations_AspNetUsers_AppUserId", + table: "Organizations"); + + migrationBuilder.DropForeignKey( + name: "FK_VolunteerGroups_AspNetUsers_AppUserId", + table: "VolunteerGroups"); + + migrationBuilder.DropForeignKey( + name: "FK_VolunteerGroups_Volunteer_GroupOwnerId1", + table: "VolunteerGroups"); + + migrationBuilder.DropTable( + name: "AspNetRoleClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserLogins"); + + migrationBuilder.DropTable( + name: "AspNetUserRoles"); + + migrationBuilder.DropTable( + name: "AspNetUserTokens"); + + migrationBuilder.DropTable( + name: "AspNetRoles"); + + migrationBuilder.DropTable( + name: "AspNetUsers"); + + migrationBuilder.DropIndex( + name: "IX_VolunteerGroups_AppUserId", + table: "VolunteerGroups"); + + migrationBuilder.DropIndex( + name: "IX_Organizations_AppUserId", + table: "Organizations"); + + migrationBuilder.DropPrimaryKey( + name: "PK_Volunteer", + table: "Volunteer"); + + migrationBuilder.DropColumn( + name: "AppUserId", + table: "VolunteerGroups"); + + migrationBuilder.DropColumn( + name: "AppUserId", + table: "Organizations"); + + migrationBuilder.RenameTable( + name: "Volunteer", + newName: "Volunteers"); + + migrationBuilder.AddPrimaryKey( + name: "PK_Volunteers", + table: "Volunteers", + column: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_VolunteerGroups_Volunteers_GroupOwnerId1", + table: "VolunteerGroups", + column: "GroupOwnerId1", + principalTable: "Volunteers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410054223_identity-provider2.Designer.cs b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410054223_identity-provider2.Designer.cs new file mode 100644 index 0000000..7dde391 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410054223_identity-provider2.Designer.cs @@ -0,0 +1,370 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using VolunteerSite.Data.Context; + +namespace VolunteerSite.Data.Migrations +{ + [DbContext(typeof(VolunteerSiteDbContext))] + [Migration("20190410054223_identity-provider2")] + partial class identityprovider2 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.3-servicing-35854") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.AppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityStamp"); + + b.Property("SkillsAndExperience"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Email"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("PhoneNumber"); + + b.Property("TotalHours"); + + b.Property("VolunteerGroupId"); + + b.Property("VolunteerGroupId1"); + + b.HasKey("Id"); + + b.HasIndex("VolunteerGroupId1"); + + b.ToTable("GroupMembers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("City"); + + b.Property("Date"); + + b.Property("Description"); + + b.Property("OrganizationId"); + + b.Property("OrganizationId1"); + + b.Property("PositionsAvailable"); + + b.Property("State"); + + b.Property("TypeOfJob"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId1"); + + b.ToTable("JobListings"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("City"); + + b.Property("CompanyName"); + + b.Property("Email"); + + b.Property("OrganizationAdminId"); + + b.Property("PhoneNumber"); + + b.Property("State"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationAdminId"); + + b.ToTable("Organizations"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("GroupAdminId"); + + b.Property("GroupName"); + + b.HasKey("Id"); + + b.HasIndex("GroupAdminId"); + + b.ToTable("VolunteerGroups"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.HasOne("VolunteerSite.Domain.Models.VolunteerGroup", "VolunteerGroup") + .WithMany("GroupMembers") + .HasForeignKey("VolunteerGroupId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.HasOne("VolunteerSite.Domain.Models.Organization", "Organization") + .WithMany("JobListings") + .HasForeignKey("OrganizationId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Organization", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser", "OrganizationAdmin") + .WithMany("Organizations") + .HasForeignKey("OrganizationAdminId") + .HasConstraintName("ForeignKey_Organization_AppUser"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser", "GroupAdmin") + .WithMany("VolunteerGroups") + .HasForeignKey("GroupAdminId") + .HasConstraintName("ForeignKey_VolunteerGroup_AppUser"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410054223_identity-provider2.cs b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410054223_identity-provider2.cs new file mode 100644 index 0000000..af20339 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/20190410054223_identity-provider2.cs @@ -0,0 +1,183 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace VolunteerSite.Data.Migrations +{ + public partial class identityprovider2 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Organizations_AspNetUsers_AppUserId", + table: "Organizations"); + + migrationBuilder.DropForeignKey( + name: "FK_VolunteerGroups_AspNetUsers_AppUserId", + table: "VolunteerGroups"); + + migrationBuilder.DropForeignKey( + name: "FK_VolunteerGroups_Volunteer_GroupOwnerId1", + table: "VolunteerGroups"); + + migrationBuilder.DropTable( + name: "Volunteer"); + + migrationBuilder.DropIndex( + name: "IX_VolunteerGroups_AppUserId", + table: "VolunteerGroups"); + + migrationBuilder.DropIndex( + name: "IX_VolunteerGroups_GroupOwnerId1", + table: "VolunteerGroups"); + + migrationBuilder.DropColumn( + name: "AppUserId", + table: "VolunteerGroups"); + + migrationBuilder.DropColumn( + name: "GroupOwnerId1", + table: "VolunteerGroups"); + + migrationBuilder.RenameColumn( + name: "GroupOwnerId", + table: "VolunteerGroups", + newName: "GroupAdminId"); + + migrationBuilder.RenameColumn( + name: "AppUserId", + table: "Organizations", + newName: "OrganizationAdminId"); + + migrationBuilder.RenameIndex( + name: "IX_Organizations_AppUserId", + table: "Organizations", + newName: "IX_Organizations_OrganizationAdminId"); + + migrationBuilder.AlterColumn( + name: "GroupAdminId", + table: "VolunteerGroups", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.CreateIndex( + name: "IX_VolunteerGroups_GroupAdminId", + table: "VolunteerGroups", + column: "GroupAdminId"); + + migrationBuilder.AddForeignKey( + name: "ForeignKey_Organization_AppUser", + table: "Organizations", + column: "OrganizationAdminId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "ForeignKey_VolunteerGroup_AppUser", + table: "VolunteerGroups", + column: "GroupAdminId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "ForeignKey_Organization_AppUser", + table: "Organizations"); + + migrationBuilder.DropForeignKey( + name: "ForeignKey_VolunteerGroup_AppUser", + table: "VolunteerGroups"); + + migrationBuilder.DropIndex( + name: "IX_VolunteerGroups_GroupAdminId", + table: "VolunteerGroups"); + + migrationBuilder.RenameColumn( + name: "GroupAdminId", + table: "VolunteerGroups", + newName: "GroupOwnerId"); + + migrationBuilder.RenameColumn( + name: "OrganizationAdminId", + table: "Organizations", + newName: "AppUserId"); + + migrationBuilder.RenameIndex( + name: "IX_Organizations_OrganizationAdminId", + table: "Organizations", + newName: "IX_Organizations_AppUserId"); + + migrationBuilder.AlterColumn( + name: "GroupOwnerId", + table: "VolunteerGroups", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AddColumn( + name: "AppUserId", + table: "VolunteerGroups", + nullable: true); + + migrationBuilder.AddColumn( + name: "GroupOwnerId1", + table: "VolunteerGroups", + nullable: true); + + migrationBuilder.CreateTable( + name: "Volunteer", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Email = table.Column(nullable: true), + FirstName = table.Column(nullable: true), + LastName = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true), + SkillsAndExperience = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Volunteer", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_VolunteerGroups_AppUserId", + table: "VolunteerGroups", + column: "AppUserId"); + + migrationBuilder.CreateIndex( + name: "IX_VolunteerGroups_GroupOwnerId1", + table: "VolunteerGroups", + column: "GroupOwnerId1"); + + migrationBuilder.AddForeignKey( + name: "FK_Organizations_AspNetUsers_AppUserId", + table: "Organizations", + column: "AppUserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_VolunteerGroups_AspNetUsers_AppUserId", + table: "VolunteerGroups", + column: "AppUserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_VolunteerGroups_Volunteer_GroupOwnerId1", + table: "VolunteerGroups", + column: "GroupOwnerId1", + principalTable: "Volunteer", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/Migrations/VolunteerSiteDbContextModelSnapshot.cs b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/VolunteerSiteDbContextModelSnapshot.cs new file mode 100644 index 0000000..0be7697 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/Migrations/VolunteerSiteDbContextModelSnapshot.cs @@ -0,0 +1,368 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using VolunteerSite.Data.Context; + +namespace VolunteerSite.Data.Migrations +{ + [DbContext(typeof(VolunteerSiteDbContext))] + partial class VolunteerSiteDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.3-servicing-35854") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.AppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityStamp"); + + b.Property("SkillsAndExperience"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Email"); + + b.Property("FirstName"); + + b.Property("LastName"); + + b.Property("PhoneNumber"); + + b.Property("TotalHours"); + + b.Property("VolunteerGroupId"); + + b.Property("VolunteerGroupId1"); + + b.HasKey("Id"); + + b.HasIndex("VolunteerGroupId1"); + + b.ToTable("GroupMembers"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("City"); + + b.Property("Date"); + + b.Property("Description"); + + b.Property("OrganizationId"); + + b.Property("OrganizationId1"); + + b.Property("PositionsAvailable"); + + b.Property("State"); + + b.Property("TypeOfJob"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId1"); + + b.ToTable("JobListings"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address"); + + b.Property("City"); + + b.Property("CompanyName"); + + b.Property("Email"); + + b.Property("OrganizationAdminId"); + + b.Property("PhoneNumber"); + + b.Property("State"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationAdminId"); + + b.ToTable("Organizations"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("GroupAdminId"); + + b.Property("GroupName"); + + b.HasKey("Id"); + + b.HasIndex("GroupAdminId"); + + b.ToTable("VolunteerGroups"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.GroupMember", b => + { + b.HasOne("VolunteerSite.Domain.Models.VolunteerGroup", "VolunteerGroup") + .WithMany("GroupMembers") + .HasForeignKey("VolunteerGroupId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.JobListing", b => + { + b.HasOne("VolunteerSite.Domain.Models.Organization", "Organization") + .WithMany("JobListings") + .HasForeignKey("OrganizationId1"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.Organization", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser", "OrganizationAdmin") + .WithMany("Organizations") + .HasForeignKey("OrganizationAdminId") + .HasConstraintName("ForeignKey_Organization_AppUser"); + }); + + modelBuilder.Entity("VolunteerSite.Domain.Models.VolunteerGroup", b => + { + b.HasOne("VolunteerSite.Domain.Models.AppUser", "GroupAdmin") + .WithMany("VolunteerGroups") + .HasForeignKey("GroupAdminId") + .HasConstraintName("ForeignKey_VolunteerGroup_AppUser"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Data/VolunteerSite.Data.csproj b/VolunterSite.WebUI/VolunteerSite.Data/VolunteerSite.Data.csproj new file mode 100644 index 0000000..b1b0004 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Data/VolunteerSite.Data.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp2.2 + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/Models/AppUser.cs b/VolunterSite.WebUI/VolunteerSite.Domain/Models/AppUser.cs new file mode 100644 index 0000000..350820c --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/Models/AppUser.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.Identity; +using System; +using System.Collections.Generic; +using System.Text; + +namespace VolunteerSite.Domain.Models +{ + public class AppUser : IdentityUser + { + //All Users + public string FirstName { get; set; } + public string LastName { get; set; } + + //Volunteers + public string SkillsAndExperience { get; set; } + + //Navigation Properties + public ICollection Organizations { get; set; } //Organization Admin + public ICollection VolunteerGroups { get; set; } //Volunteer Group Admin + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/Models/ErrorViewModel.cs b/VolunterSite.WebUI/VolunteerSite.Domain/Models/ErrorViewModel.cs new file mode 100644 index 0000000..8167476 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/Models/ErrorViewModel.cs @@ -0,0 +1,11 @@ +using System; + +namespace VolunterSite.WebUI.Models +{ + public class ErrorViewModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/Models/GroupMember.cs b/VolunterSite.WebUI/VolunteerSite.Domain/Models/GroupMember.cs new file mode 100644 index 0000000..748aa57 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/Models/GroupMember.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace VolunteerSite.Domain.Models +{ + public class GroupMember + { + public int Id { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } + public string PhoneNumber { get; set; } + public int TotalHours { get; set; } + + public string VolunteerGroupId { get; set; } + public VolunteerGroup VolunteerGroup { get; set; } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/Models/JobListing.cs b/VolunterSite.WebUI/VolunteerSite.Domain/Models/JobListing.cs new file mode 100644 index 0000000..915d6e1 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/Models/JobListing.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace VolunteerSite.Domain.Models +{ + public class JobListing + { + public int Id { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string State { get; set; } + public int PositionsAvailable { get; set; } + public string Description { get; set; } + public string TypeOfJob { get; set; } + public DateTime Date { get; set; } + + public string OrganizationId { get; set; } + public Organization Organization { get; set; } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/Models/Organization.cs b/VolunterSite.WebUI/VolunteerSite.Domain/Models/Organization.cs new file mode 100644 index 0000000..0d03cd4 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/Models/Organization.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunterSite.WebUI.Models; + +namespace VolunteerSite.Domain.Models +{ + public class Organization + { + public int Id { get; set; } + public string CompanyName { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string State { get; set; } + public string Email { get; set; } + public string PhoneNumber { get; set; } + + public string OrganizationAdminId { get; set; } + public AppUser OrganizationAdmin { get; set; } + + public ICollection JobListings { get; set; } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/Models/Volunteer.cs b/VolunterSite.WebUI/VolunteerSite.Domain/Models/Volunteer.cs new file mode 100644 index 0000000..bda03d0 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/Models/Volunteer.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace VolunteerSite.Domain.Models +{ + public class Volunteer + { + public int Id { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } + public string PhoneNumber { get; set; } + public string SkillsAndExperience { get; set; } + + // Navigation Collection + public IEnumerable VolunteerGroups { get; set; } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/Models/VolunteerGroup.cs b/VolunterSite.WebUI/VolunteerSite.Domain/Models/VolunteerGroup.cs new file mode 100644 index 0000000..9b29070 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/Models/VolunteerGroup.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace VolunteerSite.Domain.Models +{ + public class VolunteerGroup + { + public int Id { get; set; } + public string GroupName { get; set; } + + public string GroupAdminId { get; set; } + public AppUser GroupAdmin { get; set; } + + public IEnumerable GroupMembers { get; set; } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Domain/VolunteerSite.Domain.csproj b/VolunterSite.WebUI/VolunteerSite.Domain/VolunteerSite.Domain.csproj new file mode 100644 index 0000000..9c2c478 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Domain/VolunteerSite.Domain.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp2.2 + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + diff --git a/VolunterSite.WebUI/VolunteerSite.Service/Services/IGroupMemberService.cs b/VolunterSite.WebUI/VolunteerSite.Service/Services/IGroupMemberService.cs new file mode 100644 index 0000000..2925893 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Service/Services/IGroupMemberService.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; +using VolunteerSite.Data.Interfaces; + +namespace VolunteerSite.Service.Services +{ + public interface IGroupMemberService + { + GroupMember GetById(int groupMemberId); + ICollection GetByGroupId(string volunteerGroupId); + GroupMember Create(GroupMember newGroupMember); + GroupMember Update(GroupMember UpdatedGroupMember); + bool DeleteById(int groupMemberId); + } + public class GroupMemberService : IGroupMemberService + { + private readonly IGroupMemberRepository _groupMemberRepository; + + public GroupMemberService(IGroupMemberRepository groupMemberRepository) + { + _groupMemberRepository = groupMemberRepository; + } + + public GroupMember Create(GroupMember newGroupMember) + { + return _groupMemberRepository.Create(newGroupMember); + } + + public bool DeleteById(int groupMemberId) + { + return _groupMemberRepository.DeleteById(groupMemberId); + } + + public ICollection GetByGroupId(string volunteerGroupId) + { + return _groupMemberRepository.GetByGroupId(volunteerGroupId); + } + + public GroupMember GetById(int groupMemberId) + { + return _groupMemberRepository.GetById(groupMemberId); + } + + public GroupMember Update(GroupMember UpdatedGroupMember) + { + return _groupMemberRepository.Update(UpdatedGroupMember); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Service/Services/IJobListingService.cs b/VolunterSite.WebUI/VolunteerSite.Service/Services/IJobListingService.cs new file mode 100644 index 0000000..0aa53cf --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Service/Services/IJobListingService.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; +using VolunteerSite.Data.Interfaces; + + +namespace VolunteerSite.Service.Services +{ + public interface IJobListingService + { + JobListing GetById(int jobListingId); + ICollection GetByOrganizationId(string organizationId); + ICollection GetByTypeOfJob(string typeOfJob); + JobListing Create(JobListing newJobListing); + JobListing Update(JobListing updatedJobListing); + bool DeleteById(int jobListingId); + } + + public class JobListingService : IJobListingService + { + private readonly IJobListingRepository _jobListingRepository; + + public JobListingService(IJobListingRepository jobListingRepository) + { + _jobListingRepository = jobListingRepository; + } + + public JobListing Create(JobListing newJobListing) + { + return _jobListingRepository.Create(newJobListing); + } + + public bool DeleteById(int jobListingId) + { + return _jobListingRepository.DeleteById(jobListingId); + } + + public JobListing GetById(int jobListingId) + { + return _jobListingRepository.GetById(jobListingId); + } + + public ICollection GetByOrganizationId(string organizationId) + { + return _jobListingRepository.GetByOrganizationId(organizationId); + } + + public ICollection GetByTypeOfJob(string typeOfJob) + { + return _jobListingRepository.GetByTypeOfJob(typeOfJob); + } + + public JobListing Update(JobListing updatedJobListing) + { + return _jobListingRepository.Update(updatedJobListing); + } + } +} + diff --git a/VolunterSite.WebUI/VolunteerSite.Service/Services/IOrganizationSevice.cs b/VolunterSite.WebUI/VolunteerSite.Service/Services/IOrganizationSevice.cs new file mode 100644 index 0000000..412f3d2 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Service/Services/IOrganizationSevice.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; +using VolunteerSite.Data.Interfaces; + +namespace VolunteerSite.Service.Services +{ + public interface IOrganizationService + { + Organization GetById(int organizationId); + Organization Create(Organization newOrganization); + Organization Update(Organization updatedOrganization); + bool DeleteById(int organizationId); + } + + public class OrganizationService : IOrganizationService + { + private readonly IOrganizationRepository _organizationRepository; + + public OrganizationService(IOrganizationRepository organizationRepository) + { + _organizationRepository = organizationRepository; + } + + public Organization Create(Organization newOrganization) + { + return _organizationRepository.Create(newOrganization); + } + + public bool DeleteById(int organizationId) + { + return _organizationRepository.DeleteById(organizationId); + } + + public Organization GetById(int organizationId) + { + return _organizationRepository.GetById(organizationId); + } + + public Organization Update(Organization updatedOrganization) + { + return _organizationRepository.Update(updatedOrganization); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Service/Services/IVolunteerGroupService.cs b/VolunterSite.WebUI/VolunteerSite.Service/Services/IVolunteerGroupService.cs new file mode 100644 index 0000000..0dfda2a --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Service/Services/IVolunteerGroupService.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; +using VolunteerSite.Data.Interfaces; + +namespace VolunteerSite.Service.Services +{ + public interface IVolunteerGroupService + { + VolunteerGroup GetById(int volunteerGroupId); + VolunteerGroup Create(VolunteerGroup newVolunteerGroup); + VolunteerGroup Update(VolunteerGroup updatedVolunteerGroup); + bool DeleteById(int volunteerGroupId); + } + public class VolunteerGroupService : IVolunteerGroupService + { + private readonly IVolunteerGroupRepository _volunteerGroupRepository; + + public VolunteerGroupService(IVolunteerGroupRepository volunteerGroupRepository) + { + _volunteerGroupRepository = volunteerGroupRepository; + } + public VolunteerGroup Create(VolunteerGroup newVolunteerGroup) + { + return _volunteerGroupRepository.Create(newVolunteerGroup); + } + + public bool DeleteById(int volunteerGroupId) + { + return _volunteerGroupRepository.DeleteById(volunteerGroupId); + } + + public VolunteerGroup GetById(int volunteerGroupId) + { + return _volunteerGroupRepository.GetById(volunteerGroupId); + } + + public VolunteerGroup Update(VolunteerGroup updatedVolunteerGroup) + { + return _volunteerGroupRepository.Update(updatedVolunteerGroup); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Service/Services/IVolunteerService.cs b/VolunterSite.WebUI/VolunteerSite.Service/Services/IVolunteerService.cs new file mode 100644 index 0000000..01f350a --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Service/Services/IVolunteerService.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VolunteerSite.Domain.Models; +using VolunteerSite.Data.Interfaces; + +namespace VolunteerSite.Service.Services +{ + public interface IVolunteerService + { + Volunteer GetById(int volunteerId); + Volunteer Create(Volunteer newVolunteer); + Volunteer Update(Volunteer updatedVolunteer); + bool DeleteById(int volunteerId); + } + public class VolunteerService : IVolunteerService + { + private readonly IVolunteerRepository _volunteerRepository; + + public VolunteerService(IVolunteerRepository volunteerRepository) + { + _volunteerRepository = volunteerRepository; + } + public Volunteer Create(Volunteer newVolunteer) + { + return _volunteerRepository.Create(newVolunteer); + } + + public bool DeleteById(int volunteerId) + { + return _volunteerRepository.DeleteById(volunteerId); + } + + public Volunteer GetById(int volunteerId) + { + return _volunteerRepository.GetById(volunteerId); + } + + public Volunteer Update(Volunteer updatedVolunteer) + { + return _volunteerRepository.Update(updatedVolunteer); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.Service/VolunteerSite.Service.csproj b/VolunterSite.WebUI/VolunteerSite.Service/VolunteerSite.Service.csproj new file mode 100644 index 0000000..c829ea4 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.Service/VolunteerSite.Service.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp2.2 + + + + + + + + diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Controllers/HomeController.cs b/VolunterSite.WebUI/VolunteerSite.WebUI/Controllers/HomeController.cs new file mode 100644 index 0000000..092f3c8 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Controllers/HomeController.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using VolunteerSite.WebUI.Models; + +namespace VolunteerSite.WebUI.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult Privacy() + { + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Controllers/VolunteerController.cs b/VolunterSite.WebUI/VolunteerSite.WebUI/Controllers/VolunteerController.cs new file mode 100644 index 0000000..b221282 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Controllers/VolunteerController.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace VolunteerSite.WebUI.Controllers +{ + [Authorize] + public class VolunteerController : Controller + { + public IActionResult Index() + { + return View(); + } + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Models/ErrorViewModel.cs b/VolunterSite.WebUI/VolunteerSite.WebUI/Models/ErrorViewModel.cs new file mode 100644 index 0000000..2205216 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Models/ErrorViewModel.cs @@ -0,0 +1,11 @@ +using System; + +namespace VolunteerSite.WebUI.Models +{ + public class ErrorViewModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Program.cs b/VolunterSite.WebUI/VolunteerSite.WebUI/Program.cs new file mode 100644 index 0000000..e0b7d22 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/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 VolunteerSite.WebUI +{ + 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/VolunterSite.WebUI/VolunteerSite.WebUI/Properties/launchSettings.json b/VolunterSite.WebUI/VolunteerSite.WebUI/Properties/launchSettings.json new file mode 100644 index 0000000..2b54a80 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:55530", + "sslPort": 44312 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "VolunteerSite.WebUI": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Startup.cs b/VolunterSite.WebUI/VolunteerSite.WebUI/Startup.cs new file mode 100644 index 0000000..d63c79d --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Startup.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using VolunteerSite.Data.Context; +using VolunteerSite.Data.Implementation.EFCore; +using VolunteerSite.Data.Interfaces; +using VolunteerSite.Domain.Models; +using VolunteerSite.Service.Services; + +namespace VolunteerSite.WebUI +{ + 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.Configure(options => + { + // This lambda determines whether user consent for non-essential cookies is needed for a given request. + options.CheckConsentNeeded = context => true; + options.MinimumSameSitePolicy = SameSiteMode.None; + }); + + GetDependencyResolvedForEFCoreLayer(services); + + //GetDependencyResolvedForMockRepositoryLayer(services); + + GetDependencyResolvedForServiceLayer(services); + + services.AddDbContext(); + services.AddDefaultIdentity() + .AddEntityFrameworkStores(); + + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + } + + // 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.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseAuthentication(); + app.UseCookiePolicy(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + }); + } + + private void GetDependencyResolvedForMockRepositoryLayer(IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + private void GetDependencyResolvedForEFCoreLayer(IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + + private void GetDependencyResolvedForServiceLayer(IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Home/Index.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Home/Index.cshtml new file mode 100644 index 0000000..d2d19bd --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Home/Index.cshtml @@ -0,0 +1,8 @@ +@{ + ViewData["Title"] = "Home Page"; +} + +
+

Welcome

+

Learn about building Web apps with ASP.NET Core.

+
diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Home/Privacy.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Home/Privacy.cshtml new file mode 100644 index 0000000..af4fb19 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Home/Privacy.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Privacy Policy"; +} +

@ViewData["Title"]

+ +

Use this page to detail your site's privacy policy.

diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/Error.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/Error.cshtml new file mode 100644 index 0000000..a1e0478 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/Error.cshtml @@ -0,0 +1,25 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ +@if (Model.ShowRequestId) +{ +

+ Request ID: @Model.RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_CookieConsentPartial.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_CookieConsentPartial.cshtml new file mode 100644 index 0000000..a535ea4 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_CookieConsentPartial.cshtml @@ -0,0 +1,25 @@ +@using Microsoft.AspNetCore.Http.Features + +@{ + var consentFeature = Context.Features.Get(); + var showBanner = !consentFeature?.CanTrack ?? false; + var cookieString = consentFeature?.CreateConsentCookie(); +} + +@if (showBanner) +{ + + +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_Layout.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..d9a0579 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_Layout.cshtml @@ -0,0 +1,77 @@ + + + + + + @ViewData["Title"] - VolunteerSite.WebUI + + + + + + + + + + +
+ +
+
+ +
+ @RenderBody() +
+
+ +
+
+ © 2019 - VolunteerSite.WebUI - Privacy +
+
+ + + + + + + + + + + + @RenderSection("Scripts", required: false) + + diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml new file mode 100644 index 0000000..3c0e077 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/_ViewImports.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/_ViewImports.cshtml new file mode 100644 index 0000000..94c63b5 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using VolunteerSite.WebUI +@using VolunteerSite.WebUI.Models +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/Views/_ViewStart.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/_ViewStart.cshtml new file mode 100644 index 0000000..a5f1004 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/VolunteerSite.WebUI.csproj b/VolunterSite.WebUI/VolunteerSite.WebUI/VolunteerSite.WebUI.csproj new file mode 100644 index 0000000..985ae8e --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/VolunteerSite.WebUI.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp2.2 + InProcess + + + + + + + + + + + + + + + + diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/appsettings.Development.json b/VolunterSite.WebUI/VolunteerSite.WebUI/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/appsettings.json b/VolunterSite.WebUI/VolunteerSite.WebUI/appsettings.json new file mode 100644 index 0000000..def9159 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/css/site.css b/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/css/site.css new file mode 100644 index 0000000..c486131 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/css/site.css @@ -0,0 +1,56 @@ +/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification +for details on configuring this project to bundle and minify static web assets. */ + +a.navbar-brand { + white-space: normal; + text-align: center; + word-break: break-all; +} + +/* Sticky footer styles +-------------------------------------------------- */ +html { + font-size: 14px; +} +@media (min-width: 768px) { + html { + font-size: 16px; + } +} + +.border-top { + border-top: 1px solid #e5e5e5; +} +.border-bottom { + border-bottom: 1px solid #e5e5e5; +} + +.box-shadow { + box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); +} + +button.accept-policy { + font-size: 1rem; + line-height: inherit; +} + +/* Sticky footer styles +-------------------------------------------------- */ +html { + position: relative; + min-height: 100%; +} + +body { + /* Margin bottom by footer height */ + margin-bottom: 60px; +} +.footer { + position: absolute; + bottom: 0; + width: 100%; + white-space: nowrap; + /* Set the fixed height of the footer here */ + height: 60px; + line-height: 60px; /* Vertically center the text there */ +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/favicon.ico b/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/favicon.ico new file mode 100644 index 0000000..a3a7999 Binary files /dev/null and b/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/favicon.ico differ diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/js/site.js b/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/js/site.js new file mode 100644 index 0000000..ac49c18 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI/wwwroot/js/site.js @@ -0,0 +1,4 @@ +// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification +// for details on configuring this project to bundle and minify static web assets. + +// Write your JavaScript code. diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Controllers/HomeController.cs b/VolunterSite.WebUI/VolunteerSite.WebUI2/Controllers/HomeController.cs new file mode 100644 index 0000000..9d98871 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Controllers/HomeController.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using VolunteerSite.WebUI2.Models; + +namespace VolunteerSite.WebUI2.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult Privacy() + { + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Models/ErrorViewModel.cs b/VolunterSite.WebUI/VolunteerSite.WebUI2/Models/ErrorViewModel.cs new file mode 100644 index 0000000..76b0e79 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Models/ErrorViewModel.cs @@ -0,0 +1,11 @@ +using System; + +namespace VolunteerSite.WebUI2.Models +{ + public class ErrorViewModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Program.cs b/VolunterSite.WebUI/VolunteerSite.WebUI2/Program.cs new file mode 100644 index 0000000..07d96c0 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/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 VolunteerSite.WebUI2 +{ + 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/VolunterSite.WebUI/VolunteerSite.WebUI2/Properties/launchSettings.json b/VolunterSite.WebUI/VolunteerSite.WebUI2/Properties/launchSettings.json new file mode 100644 index 0000000..5168021 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:55509", + "sslPort": 44376 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "VolunteerSite.WebUI2": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Startup.cs b/VolunterSite.WebUI/VolunteerSite.WebUI2/Startup.cs new file mode 100644 index 0000000..1718a40 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Startup.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace VolunteerSite.WebUI2 +{ + 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.Configure(options => + { + // This lambda determines whether user consent for non-essential cookies is needed for a given request. + options.CheckConsentNeeded = context => true; + options.MinimumSameSitePolicy = SameSiteMode.None; + }); + + + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + } + + // 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.UseExceptionHandler("/Home/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseCookiePolicy(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Home/Index.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Home/Index.cshtml new file mode 100644 index 0000000..d2d19bd --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Home/Index.cshtml @@ -0,0 +1,8 @@ +@{ + ViewData["Title"] = "Home Page"; +} + +
+

Welcome

+

Learn about building Web apps with ASP.NET Core.

+
diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Home/Privacy.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Home/Privacy.cshtml new file mode 100644 index 0000000..af4fb19 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Home/Privacy.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Privacy Policy"; +} +

@ViewData["Title"]

+ +

Use this page to detail your site's privacy policy.

diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/Error.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/Error.cshtml new file mode 100644 index 0000000..a1e0478 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/Error.cshtml @@ -0,0 +1,25 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ +@if (Model.ShowRequestId) +{ +

+ Request ID: @Model.RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_CookieConsentPartial.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_CookieConsentPartial.cshtml new file mode 100644 index 0000000..a535ea4 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_CookieConsentPartial.cshtml @@ -0,0 +1,25 @@ +@using Microsoft.AspNetCore.Http.Features + +@{ + var consentFeature = Context.Features.Get(); + var showBanner = !consentFeature?.CanTrack ?? false; + var cookieString = consentFeature?.CreateConsentCookie(); +} + +@if (showBanner) +{ + + +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_Layout.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..5075eab --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_Layout.cshtml @@ -0,0 +1,77 @@ + + + + + + @ViewData["Title"] - VolunteerSite.WebUI2 + + + + + + + + + + +
+ +
+
+ +
+ @RenderBody() +
+
+ +
+
+ © 2019 - VolunteerSite.WebUI2 - Privacy +
+
+ + + + + + + + + + + + @RenderSection("Scripts", required: false) + + diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_ValidationScriptsPartial.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_ValidationScriptsPartial.cshtml new file mode 100644 index 0000000..3c0e077 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/Shared/_ValidationScriptsPartial.cshtml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/_ViewImports.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/_ViewImports.cshtml new file mode 100644 index 0000000..fe7cfb0 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using VolunteerSite.WebUI2 +@using VolunteerSite.WebUI2.Models +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/_ViewStart.cshtml b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/_ViewStart.cshtml new file mode 100644 index 0000000..a5f1004 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/VolunteerSite.WebUI2.csproj b/VolunterSite.WebUI/VolunteerSite.WebUI2/VolunteerSite.WebUI2.csproj new file mode 100644 index 0000000..8b11822 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/VolunteerSite.WebUI2.csproj @@ -0,0 +1,14 @@ + + + + netcoreapp2.2 + InProcess + + + + + + + + + diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/appsettings.Development.json b/VolunterSite.WebUI/VolunteerSite.WebUI2/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/appsettings.json b/VolunterSite.WebUI/VolunteerSite.WebUI2/appsettings.json new file mode 100644 index 0000000..def9159 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/css/site.css b/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/css/site.css new file mode 100644 index 0000000..c486131 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/css/site.css @@ -0,0 +1,56 @@ +/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification +for details on configuring this project to bundle and minify static web assets. */ + +a.navbar-brand { + white-space: normal; + text-align: center; + word-break: break-all; +} + +/* Sticky footer styles +-------------------------------------------------- */ +html { + font-size: 14px; +} +@media (min-width: 768px) { + html { + font-size: 16px; + } +} + +.border-top { + border-top: 1px solid #e5e5e5; +} +.border-bottom { + border-bottom: 1px solid #e5e5e5; +} + +.box-shadow { + box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); +} + +button.accept-policy { + font-size: 1rem; + line-height: inherit; +} + +/* Sticky footer styles +-------------------------------------------------- */ +html { + position: relative; + min-height: 100%; +} + +body { + /* Margin bottom by footer height */ + margin-bottom: 60px; +} +.footer { + position: absolute; + bottom: 0; + width: 100%; + white-space: nowrap; + /* Set the fixed height of the footer here */ + height: 60px; + line-height: 60px; /* Vertically center the text there */ +} diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/favicon.ico b/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/favicon.ico new file mode 100644 index 0000000..a3a7999 Binary files /dev/null and b/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/favicon.ico differ diff --git a/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/js/site.js b/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/js/site.js new file mode 100644 index 0000000..ac49c18 --- /dev/null +++ b/VolunterSite.WebUI/VolunteerSite.WebUI2/wwwroot/js/site.js @@ -0,0 +1,4 @@ +// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification +// for details on configuring this project to bundle and minify static web assets. + +// Write your JavaScript code. diff --git a/VolunterSite.WebUI/VolunterSite.WebUI.sln b/VolunterSite.WebUI/VolunterSite.WebUI.sln new file mode 100644 index 0000000..58dae2d --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.271 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VolunteerSite.Domain", "VolunteerSite.Domain\VolunteerSite.Domain.csproj", "{2A3E4DBA-D5C8-4DA4-90F4-B360DF1056CC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VolunteerSite.Data", "VolunteerSite.Data\VolunteerSite.Data.csproj", "{00FA4408-CCC8-40A2-9DBD-328DD023DCF6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VolunteerSite.WebUI", "VolunteerSite.WebUI\VolunteerSite.WebUI.csproj", "{EDB8DF3C-02C9-4BBB-B71C-F99302C99583}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VolunteerSite.Service", "VolunteerSite.Service\VolunteerSite.Service.csproj", "{50AEEEF3-1ED5-433A-BD1D-A641F34A5E17}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2A3E4DBA-D5C8-4DA4-90F4-B360DF1056CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A3E4DBA-D5C8-4DA4-90F4-B360DF1056CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A3E4DBA-D5C8-4DA4-90F4-B360DF1056CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A3E4DBA-D5C8-4DA4-90F4-B360DF1056CC}.Release|Any CPU.Build.0 = Release|Any CPU + {00FA4408-CCC8-40A2-9DBD-328DD023DCF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00FA4408-CCC8-40A2-9DBD-328DD023DCF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00FA4408-CCC8-40A2-9DBD-328DD023DCF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00FA4408-CCC8-40A2-9DBD-328DD023DCF6}.Release|Any CPU.Build.0 = Release|Any CPU + {EDB8DF3C-02C9-4BBB-B71C-F99302C99583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDB8DF3C-02C9-4BBB-B71C-F99302C99583}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDB8DF3C-02C9-4BBB-B71C-F99302C99583}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDB8DF3C-02C9-4BBB-B71C-F99302C99583}.Release|Any CPU.Build.0 = Release|Any CPU + {50AEEEF3-1ED5-433A-BD1D-A641F34A5E17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50AEEEF3-1ED5-433A-BD1D-A641F34A5E17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50AEEEF3-1ED5-433A-BD1D-A641F34A5E17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50AEEEF3-1ED5-433A-BD1D-A641F34A5E17}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {13551898-03AC-4F66-8AA6-9A5FCB40892F} + EndGlobalSection +EndGlobal diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Controllers/HomeController.cs b/VolunterSite.WebUI/VolunterSite.WebUI/Controllers/HomeController.cs new file mode 100644 index 0000000..cbd245b --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Controllers/HomeController.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using VolunterSite.WebUI.Models; + +namespace VolunterSite.WebUI.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult About() + { + ViewData["Message"] = "Your application description page."; + + return View(); + } + + public IActionResult Contact() + { + ViewData["Message"] = "Your contact page."; + + return View(); + } + + public IActionResult Privacy() + { + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } +} diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Models/ErrorViewModel.cs b/VolunterSite.WebUI/VolunterSite.WebUI/Models/ErrorViewModel.cs new file mode 100644 index 0000000..8167476 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Models/ErrorViewModel.cs @@ -0,0 +1,11 @@ +using System; + +namespace VolunterSite.WebUI.Models +{ + public class ErrorViewModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Program.cs b/VolunterSite.WebUI/VolunterSite.WebUI/Program.cs new file mode 100644 index 0000000..13daccf --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/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 VolunterSite.WebUI +{ + 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/VolunterSite.WebUI/VolunterSite.WebUI/Properties/launchSettings.json b/VolunterSite.WebUI/VolunterSite.WebUI/Properties/launchSettings.json new file mode 100644 index 0000000..e92f707 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60571", + "sslPort": 44345 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "VolunterSite.WebUI": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Startup.cs b/VolunterSite.WebUI/VolunterSite.WebUI/Startup.cs new file mode 100644 index 0000000..b7fb12e --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Startup.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace VolunterSite.WebUI +{ + 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) + { + // bad way of adding connection string + //TODO: fix later + var connectionString = "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"; + services.AddDbContext + + services.Configure(options => + { + // This lambda determines whether user consent for non-essential cookies is needed for a given request. + options.CheckConsentNeeded = context => true; + options.MinimumSameSitePolicy = SameSiteMode.None; + }); + + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + } + + // 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.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseCookiePolicy(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/About.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/About.cshtml new file mode 100644 index 0000000..3674e37 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/About.cshtml @@ -0,0 +1,7 @@ +@{ + ViewData["Title"] = "About"; +} +

@ViewData["Title"]

+

@ViewData["Message"]

+ +

Use this area to provide additional information.

diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Contact.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Contact.cshtml new file mode 100644 index 0000000..a11a186 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Contact.cshtml @@ -0,0 +1,17 @@ +@{ + ViewData["Title"] = "Contact"; +} +

@ViewData["Title"]

+

@ViewData["Message"]

+ +
+ One Microsoft Way
+ Redmond, WA 98052-6399
+ P: + 425.555.0100 +
+ +
+ Support: Support@example.com
+ Marketing: Marketing@example.com +
diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Index.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Index.cshtml new file mode 100644 index 0000000..f42d2a0 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Index.cshtml @@ -0,0 +1,94 @@ +@{ + ViewData["Title"] = "Home Page"; +} + + + + diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Privacy.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Privacy.cshtml new file mode 100644 index 0000000..7bd3861 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Home/Privacy.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Privacy Policy"; +} +

@ViewData["Title"]

+ +

Use this page to detail your site's privacy policy.

diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/Error.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/Error.cshtml new file mode 100644 index 0000000..ec2ea6b --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/Error.cshtml @@ -0,0 +1,22 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ +@if (Model.ShowRequestId) +{ +

+ Request ID: @Model.RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. +

diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_CookieConsentPartial.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_CookieConsentPartial.cshtml new file mode 100644 index 0000000..bbfbb09 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_CookieConsentPartial.cshtml @@ -0,0 +1,41 @@ +@using Microsoft.AspNetCore.Http.Features + +@{ + var consentFeature = Context.Features.Get(); + var showBanner = !consentFeature?.CanTrack ?? false; + var cookieString = consentFeature?.CreateConsentCookie(); +} + +@if (showBanner) +{ + + +} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_Layout.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..43e56e5 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_Layout.cshtml @@ -0,0 +1,74 @@ + + + + + + @ViewData["Title"] - VolunterSite.WebUI + + + + + + + + + + + + + + + +
+ @RenderBody() +
+
+

© 2019 - VolunterSite.WebUI

+
+
+ + + + + + + + + + + + + @RenderSection("Scripts", required: false) + + diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml new file mode 100644 index 0000000..2a9241f --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/_ViewImports.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/_ViewImports.cshtml new file mode 100644 index 0000000..8c97aa0 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using VolunterSite.WebUI +@using VolunterSite.WebUI.Models +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/Views/_ViewStart.cshtml b/VolunterSite.WebUI/VolunterSite.WebUI/Views/_ViewStart.cshtml new file mode 100644 index 0000000..a5f1004 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/VolunterSite.WebUI.csproj b/VolunterSite.WebUI/VolunterSite.WebUI/VolunterSite.WebUI.csproj new file mode 100644 index 0000000..efb8edb --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/VolunterSite.WebUI.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp2.1 + + + + + + + + diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/appsettings.Development.json b/VolunterSite.WebUI/VolunterSite.WebUI/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/appsettings.json b/VolunterSite.WebUI/VolunterSite.WebUI/appsettings.json new file mode 100644 index 0000000..def9159 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/css/site.css b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/css/site.css new file mode 100644 index 0000000..e89c781 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/css/site.css @@ -0,0 +1,37 @@ +/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ +for details on configuring this project to bundle and minify static web assets. */ +body { + padding-top: 50px; + padding-bottom: 20px; +} + +/* Wrapping element */ +/* Set some basic padding to keep content from hitting the edges */ +.body-content { + padding-left: 15px; + padding-right: 15px; +} + +/* Carousel */ +.carousel-caption p { + font-size: 20px; + line-height: 1.4; +} + +/* Make .svg files in the carousel display properly in older browsers */ +.carousel-inner .item img[src$=".svg"] { + width: 100%; +} + +/* QR code generator */ +#qrCode { + margin: 15px; +} + +/* Hide/rearrange for smaller screens */ +@media screen and (max-width: 767px) { + /* Hide captions */ + .carousel-caption { + display: none; + } +} diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/css/site.min.css b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/css/site.min.css new file mode 100644 index 0000000..5e93e30 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/css/site.min.css @@ -0,0 +1 @@ +body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/favicon.ico b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/favicon.ico new file mode 100644 index 0000000..a3a7999 Binary files /dev/null and b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/favicon.ico differ diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner1.svg b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner1.svg new file mode 100644 index 0000000..1ab32b6 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner2.svg b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner2.svg new file mode 100644 index 0000000..9679c60 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner3.svg b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner3.svg new file mode 100644 index 0000000..38b3d7c --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/images/banner3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/js/site.js b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/js/site.js new file mode 100644 index 0000000..ac49c18 --- /dev/null +++ b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/js/site.js @@ -0,0 +1,4 @@ +// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification +// for details on configuring this project to bundle and minify static web assets. + +// Write your JavaScript code. diff --git a/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/js/site.min.js b/VolunterSite.WebUI/VolunterSite.WebUI/wwwroot/js/site.min.js new file mode 100644 index 0000000..e69de29