-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb1a5ba
commit ef3ed78
Showing
9 changed files
with
335 additions
and
13 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
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,49 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace contactos.Migrations | ||
{ | ||
public partial class UserAdd : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "Usuario"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "User", | ||
columns: table => new | ||
{ | ||
username = table.Column<string>(maxLength: 20, nullable: false), | ||
fechacreado = table.Column<DateTime>(nullable: false), | ||
email = table.Column<string>(nullable: true), | ||
PasswordHash = table.Column<byte[]>(nullable: true), | ||
PasswordSalt = table.Column<byte[]>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_User", x => x.username); | ||
}); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "User"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "Usuario", | ||
columns: table => new | ||
{ | ||
username = table.Column<string>(maxLength: 20, nullable: false), | ||
FechaCreado = table.Column<DateTime>(nullable: false), | ||
email = table.Column<string>(nullable: true), | ||
password = table.Column<string>(maxLength: 100, nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Usuario", x => x.username); | ||
}); | ||
} | ||
} | ||
} |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace contactos.Models | ||
{ | ||
public class User | ||
{ | ||
[Key] | ||
[Required] | ||
[Display(Name="Username")] | ||
[StringLength(20, ErrorMessage = "El valor para {0} debe contener al menos {2} y máximo {1} caracteres de longitud.", MinimumLength = 6)] | ||
public string username { get; set; } | ||
public DateTime fechacreado { get; set; } | ||
public string email { get; set; } | ||
|
||
public byte[] PasswordHash { get; set; } | ||
public byte[] PasswordSalt { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace contactos.Models | ||
{ | ||
public class UserDto | ||
{ | ||
[Key] | ||
[Required] | ||
[Display(Name="Username")] | ||
[StringLength(20, ErrorMessage = "El valor para {0] debe contener al menos {2} y máximo {1} caracteres", MinimumLength=6)] | ||
public string username {get; set;} | ||
|
||
public string password {get; set;} | ||
|
||
public string email {get; set;} | ||
|
||
[DataType(DataType.Date)] | ||
public DateTime FechaCreado {get; set;} | ||
} | ||
} |
Oops, something went wrong.