Change id types
This commit is contained in:
@@ -23,6 +23,14 @@ public class UserContext : DbContext
|
|||||||
{
|
{
|
||||||
modelBuilder.Entity<User>()
|
modelBuilder.Entity<User>()
|
||||||
.ToTable("User");
|
.ToTable("User");
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id);
|
||||||
|
|
||||||
|
entity.Property(e => e.Id)
|
||||||
|
.HasColumnType("binary(16)"); // **** Map Guid to BINARY(16) ****
|
||||||
|
});
|
||||||
modelBuilder.Entity<User>()
|
modelBuilder.Entity<User>()
|
||||||
.Property(u => u.LastLogin).IsRequired(false);
|
.Property(u => u.LastLogin).IsRequired(false);
|
||||||
modelBuilder.Entity<User>()
|
modelBuilder.Entity<User>()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ public class LoginResult : BaseResult
|
|||||||
{
|
{
|
||||||
#region Properties
|
#region Properties
|
||||||
[JsonProperty("user_id")]
|
[JsonProperty("user_id")]
|
||||||
public int UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
[JsonProperty("username")]
|
[JsonProperty("username")]
|
||||||
public string? Username { get; set; }
|
public string? Username { get; set; }
|
||||||
[JsonProperty("token")]
|
[JsonProperty("token")]
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ public class User
|
|||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
[Column("Id")]
|
[Column("Id")]
|
||||||
[Key]
|
[Key]
|
||||||
public int Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[JsonProperty("username")]
|
[JsonProperty("username")]
|
||||||
public string? Username { get; set; }
|
public string? Username { get; set; }
|
||||||
[JsonProperty("password")]
|
[JsonProperty("password")]
|
||||||
|
|||||||
Reference in New Issue
Block a user