update startup for migrations and add cors

master
dan 2019-07-22 21:48:15 -06:00
parent e59325daf9
commit f00a03647a
8 changed files with 35 additions and 929 deletions

View File

@ -16,10 +16,18 @@ namespace OFBButte.Api
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
CreateWebHostBuilder(args).Run(); CreateWebHostBuilder(args, false).Run();
} }
/// <summary>
public static IWebHost CreateWebHostBuilder(string[] args) /// This method is for entity framework
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public static IWebHost BuildWebHost(string[] args)
{
return CreateWebHostBuilder(args, true);
}
public static IWebHost CreateWebHostBuilder(string[] args, bool fromEF)
{ {
var hostBuilder = WebHost.CreateDefaultBuilder(args) var hostBuilder = WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>(); .UseStartup<Startup>();
@ -31,7 +39,10 @@ namespace OFBButte.Api
var host = hostBuilder.Build(); var host = hostBuilder.Build();
using(var scope = host.Services.CreateScope()) if (fromEF)
return host;
using (var scope = host.Services.CreateScope())
{ {
var db = scope.ServiceProvider.GetService<Database.OFBContext>(); var db = scope.ServiceProvider.GetService<Database.OFBContext>();
db.Database.Migrate(); db.Database.Migrate();

View File

@ -18,6 +18,8 @@ namespace OFBButte.Api
{ {
public class Startup public class Startup
{ {
private readonly string CorsPolicy = "OFBCorsPolicy";
public Startup(IConfiguration configuration) public Startup(IConfiguration configuration)
{ {
Configuration = configuration; Configuration = configuration;
@ -28,6 +30,18 @@ namespace OFBButte.Api
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
// CORS - This needs to be before services.AddMvc
services.AddCors(options =>
{
options.AddPolicy(CorsPolicy, policy =>
{
policy.WithOrigins("http://localhost:4200", "https://test.ofbbutte.com", "https://ofbbutte.com")
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
// App Settings // App Settings
@ -53,7 +67,7 @@ namespace OFBButte.Api
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. // 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.UseHsts();
} }
app.UseCors(CorsPolicy);
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.UseMvc(); app.UseMvc();
} }

View File

@ -1,318 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using OFBButte.Database;
namespace OFBButte.Database.Migrations
{
[DbContext(typeof(OFBContext))]
[Migration("20190717032510_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("OFBButte.Entities.EmailVerificationCode", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Code");
b.Property<DateTime>("CreatedDate");
b.HasKey("Id");
b.ToTable("EmailVerificationCodes");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryChild", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("MissionarySupportId");
b.Property<string>("Name");
b.HasKey("Id");
b.HasIndex("MissionarySupportId");
b.ToTable("MissionaryChild");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryCollegeRecommendation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("MissionarySupportId");
b.Property<string>("Name");
b.HasKey("Id");
b.HasIndex("MissionarySupportId");
b.ToTable("MissionaryCollegeRecommendation");
});
modelBuilder.Entity("OFBButte.Entities.MissionarySupport", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("AdmittedWrong");
b.Property<bool>("Alcohol");
b.Property<string>("AloneOrTeam");
b.Property<string>("BibleVersionOpinion");
b.Property<string>("BibleVersionsUsed");
b.Property<string>("BillsOnTime");
b.Property<string>("CallToField");
b.Property<string>("CellPhone");
b.Property<string>("Charasmaticism");
b.Property<int>("ChildrenSchool");
b.Property<bool>("ContemporaryMusic");
b.Property<string>("CorrectWrongOfAnotherMissionary");
b.Property<decimal>("CurrentMonthlySupport");
b.Property<int>("DailyBible");
b.Property<bool>("Dance");
b.Property<bool>("Divorced");
b.Property<string>("EvaluationOfNationals");
b.Property<string>("FellowshipAssociation");
b.Property<bool>("FemaleDressStandard");
b.Property<int>("FemaleShorts");
b.Property<int>("FemaleSlacks");
b.Property<string>("FieldOfService");
b.Property<string>("FieldPhone");
b.Property<string>("FinancialStatementPrevYear");
b.Property<bool>("Fundamentalist");
b.Property<bool>("GroundsForRemarry");
b.Property<string>("HomePhone");
b.Property<string>("LateBillActionTaken");
b.Property<string>("LateBills");
b.Property<bool>("MaleHair");
b.Property<bool>("MarryADivorcee");
b.Property<bool>("MasonicLodge");
b.Property<decimal>("MonthlySupportNeeded");
b.Property<bool>("MovieTheaters");
b.Property<string>("Name");
b.Property<double>("NumberLedToChrist");
b.Property<double>("NumberWeeklyTracts");
b.Property<double>("NumberWitnessedTo");
b.Property<string>("Plans");
b.Property<string>("PotentialHarvest");
b.Property<string>("Predestination");
b.Property<string>("RateOfSuccess");
b.Property<string>("RepentanceDefinition");
b.Property<bool>("RepentanceNecessary");
b.Property<string>("RestAndRelaxation");
b.Property<string>("SendingChurch");
b.Property<bool>("Smoking");
b.Property<string>("SwimmingClothing");
b.Property<string>("Television");
b.Property<string>("Testimony");
b.Property<string>("TimeInCountry");
b.Property<bool>("Tongues");
b.Property<string>("WifesName");
b.Property<bool>("WorldlyMusic");
b.HasKey("Id");
b.ToTable("MissionarySupportForms");
});
modelBuilder.Entity("OFBButte.Entities.PasswordResetCode", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Code");
b.Property<DateTime>("CreatedDate");
b.HasKey("Id");
b.ToTable("PasswordResetCodes");
});
modelBuilder.Entity("OFBButte.Entities.Profile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("City");
b.Property<string>("Country");
b.Property<string>("FirstName");
b.Property<string>("LastName");
b.Property<DateTime>("ModifiedDate");
b.Property<int?>("ProfileFederationCodeId");
b.Property<string>("State");
b.Property<string>("Street");
b.Property<string>("Zip");
b.HasKey("Id");
b.HasIndex("ProfileFederationCodeId");
b.ToTable("Profiles");
});
modelBuilder.Entity("OFBButte.Entities.ProfileFederationCode", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Code");
b.Property<DateTime>("CreatedDate");
b.HasKey("Id");
b.ToTable("ProfileFederationCodes");
});
modelBuilder.Entity("OFBButte.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDate");
b.Property<DateTime?>("DeletedDate");
b.Property<string>("Email")
.IsRequired();
b.Property<int?>("EmailVerificationCodeId");
b.Property<DateTime?>("EmailVerifiedDate");
b.Property<int?>("PassswordResetCodeId");
b.Property<string>("Password")
.IsRequired();
b.Property<int?>("ProfileId");
b.HasKey("Id");
b.HasIndex("Email");
b.HasIndex("EmailVerificationCodeId");
b.HasIndex("PassswordResetCodeId");
b.HasIndex("ProfileId");
b.ToTable("Users");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryChild", b =>
{
b.HasOne("OFBButte.Entities.MissionarySupport")
.WithMany("Children")
.HasForeignKey("MissionarySupportId");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryCollegeRecommendation", b =>
{
b.HasOne("OFBButte.Entities.MissionarySupport")
.WithMany("CollegeRecommendations")
.HasForeignKey("MissionarySupportId");
});
modelBuilder.Entity("OFBButte.Entities.Profile", b =>
{
b.HasOne("OFBButte.Entities.ProfileFederationCode", "ProfileFederationCode")
.WithMany()
.HasForeignKey("ProfileFederationCodeId");
});
modelBuilder.Entity("OFBButte.Entities.User", b =>
{
b.HasOne("OFBButte.Entities.EmailVerificationCode", "EmailVerificationCode")
.WithMany()
.HasForeignKey("EmailVerificationCodeId");
b.HasOne("OFBButte.Entities.PasswordResetCode", "PassswordResetCode")
.WithMany()
.HasForeignKey("PassswordResetCodeId");
b.HasOne("OFBButte.Entities.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,287 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace OFBButte.Database.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "EmailVerificationCodes",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Code = table.Column<string>(nullable: true),
CreatedDate = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmailVerificationCodes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MissionarySupportForms",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true),
HomePhone = table.Column<string>(nullable: true),
CellPhone = table.Column<string>(nullable: true),
FieldPhone = table.Column<string>(nullable: true),
WifesName = table.Column<string>(nullable: true),
Testimony = table.Column<string>(nullable: true),
CallToField = table.Column<string>(nullable: true),
SendingChurch = table.Column<string>(nullable: true),
FieldOfService = table.Column<string>(nullable: true),
Plans = table.Column<string>(nullable: true),
EvaluationOfNationals = table.Column<string>(nullable: true),
TimeInCountry = table.Column<string>(nullable: true),
CorrectWrongOfAnotherMissionary = table.Column<string>(nullable: true),
FinancialStatementPrevYear = table.Column<string>(nullable: true),
CurrentMonthlySupport = table.Column<decimal>(nullable: false),
MonthlySupportNeeded = table.Column<decimal>(nullable: false),
RestAndRelaxation = table.Column<string>(nullable: true),
AloneOrTeam = table.Column<string>(nullable: true),
ChildrenSchool = table.Column<int>(nullable: false),
Dance = table.Column<bool>(nullable: false),
WorldlyMusic = table.Column<bool>(nullable: false),
MovieTheaters = table.Column<bool>(nullable: false),
Alcohol = table.Column<bool>(nullable: false),
Smoking = table.Column<bool>(nullable: false),
MaleHair = table.Column<bool>(nullable: false),
FemaleSlacks = table.Column<int>(nullable: false),
FemaleShorts = table.Column<int>(nullable: false),
FemaleDressStandard = table.Column<bool>(nullable: false),
SwimmingClothing = table.Column<string>(nullable: true),
Television = table.Column<string>(nullable: true),
DailyBible = table.Column<int>(nullable: false),
NumberLedToChrist = table.Column<double>(nullable: false),
NumberWitnessedTo = table.Column<double>(nullable: false),
NumberWeeklyTracts = table.Column<double>(nullable: false),
RateOfSuccess = table.Column<string>(nullable: true),
Predestination = table.Column<string>(nullable: true),
FellowshipAssociation = table.Column<string>(nullable: true),
AdmittedWrong = table.Column<string>(nullable: true),
Divorced = table.Column<bool>(nullable: false),
GroundsForRemarry = table.Column<bool>(nullable: false),
MarryADivorcee = table.Column<bool>(nullable: false),
MasonicLodge = table.Column<bool>(nullable: false),
BibleVersionsUsed = table.Column<string>(nullable: true),
BibleVersionOpinion = table.Column<string>(nullable: true),
ContemporaryMusic = table.Column<bool>(nullable: false),
Charasmaticism = table.Column<string>(nullable: true),
Tongues = table.Column<bool>(nullable: false),
RepentanceNecessary = table.Column<bool>(nullable: false),
RepentanceDefinition = table.Column<string>(nullable: true),
Fundamentalist = table.Column<bool>(nullable: false),
BillsOnTime = table.Column<string>(nullable: true),
LateBills = table.Column<string>(nullable: true),
LateBillActionTaken = table.Column<string>(nullable: true),
PotentialHarvest = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MissionarySupportForms", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PasswordResetCodes",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Code = table.Column<string>(nullable: true),
CreatedDate = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PasswordResetCodes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ProfileFederationCodes",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Code = table.Column<string>(nullable: true),
CreatedDate = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProfileFederationCodes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MissionaryChild",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true),
MissionarySupportId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MissionaryChild", x => x.Id);
table.ForeignKey(
name: "FK_MissionaryChild_MissionarySupportForms_MissionarySupportId",
column: x => x.MissionarySupportId,
principalTable: "MissionarySupportForms",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "MissionaryCollegeRecommendation",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true),
MissionarySupportId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MissionaryCollegeRecommendation", x => x.Id);
table.ForeignKey(
name: "FK_MissionaryCollegeRecommendation_MissionarySupportForms_Missi~",
column: x => x.MissionarySupportId,
principalTable: "MissionarySupportForms",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Profiles",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDate = table.Column<DateTime>(nullable: false),
FirstName = table.Column<string>(nullable: true),
LastName = table.Column<string>(nullable: true),
Street = table.Column<string>(nullable: true),
City = table.Column<string>(nullable: true),
State = table.Column<string>(nullable: true),
Zip = table.Column<string>(nullable: true),
Country = table.Column<string>(nullable: true),
ProfileFederationCodeId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Profiles", x => x.Id);
table.ForeignKey(
name: "FK_Profiles_ProfileFederationCodes_ProfileFederationCodeId",
column: x => x.ProfileFederationCodeId,
principalTable: "ProfileFederationCodes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Email = table.Column<string>(nullable: false),
Password = table.Column<string>(nullable: false),
EmailVerifiedDate = table.Column<DateTime>(nullable: true),
CreatedDate = table.Column<DateTime>(nullable: false),
DeletedDate = table.Column<DateTime>(nullable: true),
ProfileId = table.Column<int>(nullable: true),
EmailVerificationCodeId = table.Column<int>(nullable: true),
PassswordResetCodeId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
table.ForeignKey(
name: "FK_Users_EmailVerificationCodes_EmailVerificationCodeId",
column: x => x.EmailVerificationCodeId,
principalTable: "EmailVerificationCodes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Users_PasswordResetCodes_PassswordResetCodeId",
column: x => x.PassswordResetCodeId,
principalTable: "PasswordResetCodes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Users_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_MissionaryChild_MissionarySupportId",
table: "MissionaryChild",
column: "MissionarySupportId");
migrationBuilder.CreateIndex(
name: "IX_MissionaryCollegeRecommendation_MissionarySupportId",
table: "MissionaryCollegeRecommendation",
column: "MissionarySupportId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_ProfileFederationCodeId",
table: "Profiles",
column: "ProfileFederationCodeId");
migrationBuilder.CreateIndex(
name: "IX_Users_Email",
table: "Users",
column: "Email");
migrationBuilder.CreateIndex(
name: "IX_Users_EmailVerificationCodeId",
table: "Users",
column: "EmailVerificationCodeId");
migrationBuilder.CreateIndex(
name: "IX_Users_PassswordResetCodeId",
table: "Users",
column: "PassswordResetCodeId");
migrationBuilder.CreateIndex(
name: "IX_Users_ProfileId",
table: "Users",
column: "ProfileId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "MissionaryChild");
migrationBuilder.DropTable(
name: "MissionaryCollegeRecommendation");
migrationBuilder.DropTable(
name: "Users");
migrationBuilder.DropTable(
name: "MissionarySupportForms");
migrationBuilder.DropTable(
name: "EmailVerificationCodes");
migrationBuilder.DropTable(
name: "PasswordResetCodes");
migrationBuilder.DropTable(
name: "Profiles");
migrationBuilder.DropTable(
name: "ProfileFederationCodes");
}
}
}

View File

@ -1,316 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using OFBButte.Database;
namespace OFBButte.Database.Migrations
{
[DbContext(typeof(OFBContext))]
partial class OFBContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("OFBButte.Entities.EmailVerificationCode", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Code");
b.Property<DateTime>("CreatedDate");
b.HasKey("Id");
b.ToTable("EmailVerificationCodes");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryChild", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("MissionarySupportId");
b.Property<string>("Name");
b.HasKey("Id");
b.HasIndex("MissionarySupportId");
b.ToTable("MissionaryChild");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryCollegeRecommendation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("MissionarySupportId");
b.Property<string>("Name");
b.HasKey("Id");
b.HasIndex("MissionarySupportId");
b.ToTable("MissionaryCollegeRecommendation");
});
modelBuilder.Entity("OFBButte.Entities.MissionarySupport", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("AdmittedWrong");
b.Property<bool>("Alcohol");
b.Property<string>("AloneOrTeam");
b.Property<string>("BibleVersionOpinion");
b.Property<string>("BibleVersionsUsed");
b.Property<string>("BillsOnTime");
b.Property<string>("CallToField");
b.Property<string>("CellPhone");
b.Property<string>("Charasmaticism");
b.Property<int>("ChildrenSchool");
b.Property<bool>("ContemporaryMusic");
b.Property<string>("CorrectWrongOfAnotherMissionary");
b.Property<decimal>("CurrentMonthlySupport");
b.Property<int>("DailyBible");
b.Property<bool>("Dance");
b.Property<bool>("Divorced");
b.Property<string>("EvaluationOfNationals");
b.Property<string>("FellowshipAssociation");
b.Property<bool>("FemaleDressStandard");
b.Property<int>("FemaleShorts");
b.Property<int>("FemaleSlacks");
b.Property<string>("FieldOfService");
b.Property<string>("FieldPhone");
b.Property<string>("FinancialStatementPrevYear");
b.Property<bool>("Fundamentalist");
b.Property<bool>("GroundsForRemarry");
b.Property<string>("HomePhone");
b.Property<string>("LateBillActionTaken");
b.Property<string>("LateBills");
b.Property<bool>("MaleHair");
b.Property<bool>("MarryADivorcee");
b.Property<bool>("MasonicLodge");
b.Property<decimal>("MonthlySupportNeeded");
b.Property<bool>("MovieTheaters");
b.Property<string>("Name");
b.Property<double>("NumberLedToChrist");
b.Property<double>("NumberWeeklyTracts");
b.Property<double>("NumberWitnessedTo");
b.Property<string>("Plans");
b.Property<string>("PotentialHarvest");
b.Property<string>("Predestination");
b.Property<string>("RateOfSuccess");
b.Property<string>("RepentanceDefinition");
b.Property<bool>("RepentanceNecessary");
b.Property<string>("RestAndRelaxation");
b.Property<string>("SendingChurch");
b.Property<bool>("Smoking");
b.Property<string>("SwimmingClothing");
b.Property<string>("Television");
b.Property<string>("Testimony");
b.Property<string>("TimeInCountry");
b.Property<bool>("Tongues");
b.Property<string>("WifesName");
b.Property<bool>("WorldlyMusic");
b.HasKey("Id");
b.ToTable("MissionarySupportForms");
});
modelBuilder.Entity("OFBButte.Entities.PasswordResetCode", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Code");
b.Property<DateTime>("CreatedDate");
b.HasKey("Id");
b.ToTable("PasswordResetCodes");
});
modelBuilder.Entity("OFBButte.Entities.Profile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("City");
b.Property<string>("Country");
b.Property<string>("FirstName");
b.Property<string>("LastName");
b.Property<DateTime>("ModifiedDate");
b.Property<int?>("ProfileFederationCodeId");
b.Property<string>("State");
b.Property<string>("Street");
b.Property<string>("Zip");
b.HasKey("Id");
b.HasIndex("ProfileFederationCodeId");
b.ToTable("Profiles");
});
modelBuilder.Entity("OFBButte.Entities.ProfileFederationCode", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Code");
b.Property<DateTime>("CreatedDate");
b.HasKey("Id");
b.ToTable("ProfileFederationCodes");
});
modelBuilder.Entity("OFBButte.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDate");
b.Property<DateTime?>("DeletedDate");
b.Property<string>("Email")
.IsRequired();
b.Property<int?>("EmailVerificationCodeId");
b.Property<DateTime?>("EmailVerifiedDate");
b.Property<int?>("PassswordResetCodeId");
b.Property<string>("Password")
.IsRequired();
b.Property<int?>("ProfileId");
b.HasKey("Id");
b.HasIndex("Email");
b.HasIndex("EmailVerificationCodeId");
b.HasIndex("PassswordResetCodeId");
b.HasIndex("ProfileId");
b.ToTable("Users");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryChild", b =>
{
b.HasOne("OFBButte.Entities.MissionarySupport")
.WithMany("Children")
.HasForeignKey("MissionarySupportId");
});
modelBuilder.Entity("OFBButte.Entities.MissionaryCollegeRecommendation", b =>
{
b.HasOne("OFBButte.Entities.MissionarySupport")
.WithMany("CollegeRecommendations")
.HasForeignKey("MissionarySupportId");
});
modelBuilder.Entity("OFBButte.Entities.Profile", b =>
{
b.HasOne("OFBButte.Entities.ProfileFederationCode", "ProfileFederationCode")
.WithMany()
.HasForeignKey("ProfileFederationCodeId");
});
modelBuilder.Entity("OFBButte.Entities.User", b =>
{
b.HasOne("OFBButte.Entities.EmailVerificationCode", "EmailVerificationCode")
.WithMany()
.HasForeignKey("EmailVerificationCodeId");
b.HasOne("OFBButte.Entities.PasswordResetCode", "PassswordResetCode")
.WithMany()
.HasForeignKey("PassswordResetCodeId");
b.HasOne("OFBButte.Entities.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -5,6 +5,6 @@
Christian = 1, Christian = 1,
Public = 2, Public = 2,
Home = 3, Home = 3,
Other = 5 Other = 4
} }
} }

View File

@ -8,5 +8,7 @@ namespace OFBButte.Entities
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string City { get; set; }
public string State { get; set; }
} }
} }

View File

@ -22,8 +22,8 @@ namespace OFBButte.Entities
public string TimeInCountry { get; set; } public string TimeInCountry { get; set; }
public string CorrectWrongOfAnotherMissionary { get; set; } public string CorrectWrongOfAnotherMissionary { get; set; }
public string FinancialStatementPrevYear { get; set; } public string FinancialStatementPrevYear { get; set; }
public decimal CurrentMonthlySupport { get; set; } public string CurrentMonthlySupport { get; set; }
public decimal MonthlySupportNeeded { get; set; } public string MonthlySupportNeeded { get; set; }
public string RestAndRelaxation { get; set; } public string RestAndRelaxation { get; set; }
public string AloneOrTeam { get; set; } public string AloneOrTeam { get; set; }
public ChildrenSchool ChildrenSchool { get; set; } public ChildrenSchool ChildrenSchool { get; set; }