-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from coj337/Develop
Add continous spraying and persistant storage
- Loading branch information
Showing
16 changed files
with
434 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace TheSprayer.Db | ||
{ | ||
public partial class InitialMigration : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "Attempts", | ||
columns: table => new | ||
{ | ||
Id = table.Column<string>(type: "TEXT", nullable: false), | ||
Username = table.Column<string>(type: "TEXT", nullable: true), | ||
Password = table.Column<string>(type: "TEXT", nullable: true), | ||
LastSprayTime = table.Column<DateTime>(type: "TEXT", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Attempts", x => x.Id); | ||
}); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Attempts"); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace TheSprayer.Db | ||
{ | ||
public partial class AddAutoKey : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
|
||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
|
||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace TheSprayer.Db | ||
{ | ||
public partial class AddSuccess : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<bool>( | ||
name: "Success", | ||
table: "Attempts", | ||
type: "INTEGER", | ||
nullable: false, | ||
defaultValue: false); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "Success", | ||
table: "Attempts"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using System.Reflection; | ||
using TheSprayer.Models; | ||
|
||
namespace TheSprayer.Db | ||
{ | ||
public class SprayDbContext : DbContext | ||
{ | ||
public DbSet<CredentialAttempt> Attempts { get; set; } | ||
|
||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
{ | ||
optionsBuilder.UseSqlite("Filename=TheSprayer.db", options => | ||
{ | ||
options.MigrationsAssembly(Assembly.GetExecutingAssembly().FullName); | ||
}); | ||
base.OnConfiguring(optionsBuilder); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// <auto-generated /> | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||
using TheSprayer.Db; | ||
|
||
namespace TheSprayer.Db | ||
{ | ||
[DbContext(typeof(SprayDbContext))] | ||
partial class SprayDbContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
#pragma warning disable 612, 618 | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "5.0.8"); | ||
|
||
modelBuilder.Entity("TheSprayer.Models.CredentialAttempt", b => | ||
{ | ||
b.Property<string>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnType("TEXT"); | ||
b.Property<DateTime>("LastSprayTime") | ||
.HasColumnType("TEXT"); | ||
b.Property<string>("Password") | ||
.HasColumnType("TEXT"); | ||
b.Property<bool>("Success") | ||
.HasColumnType("INTEGER"); | ||
b.Property<string>("Username") | ||
.HasColumnType("TEXT"); | ||
b.HasKey("Id"); | ||
b.ToTable("Attempts"); | ||
}); | ||
#pragma warning restore 612, 618 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace TheSprayer.Models | ||
{ | ||
public class CredentialAttempt | ||
{ | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
public string Id { get; set; } | ||
public string Username { get; set; } | ||
public string Password { get; set; } | ||
public bool Success { get; set; } | ||
public DateTime LastSprayTime { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.