Compare commits
2 Commits
4a07b1bcc2
...
2f4bdd95f8
| Author | SHA1 | Date |
|---|---|---|
|
|
2f4bdd95f8 | |
|
|
f44f4d794d |
|
|
@ -1,5 +1,6 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using AyCode.Interfaces.Entities;
|
using AyCode.Interfaces.Entities;
|
||||||
using AyCode.Interfaces.TimeStampInfo;
|
using AyCode.Interfaces.TimeStampInfo;
|
||||||
using TIAM.Entities.Products;
|
using TIAM.Entities.Products;
|
||||||
|
|
@ -14,7 +15,9 @@ public class UserProductMapping : IEntityGuid, ITimeStampInfo
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
public Guid ProductId { get; set; }
|
public Guid ProductId { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public virtual User User { get; set; }
|
public virtual User User { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
public virtual Product Product { get; set; }
|
public virtual Product Product { get; set; }
|
||||||
|
|
||||||
public DateTime Created { get; set; }
|
public DateTime Created { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -340,11 +340,17 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("GetUserById")]
|
[Route("GetUserById")]
|
||||||
public async Task<User?> GetUserById([FromBody] Guid id)
|
public User? GetUserById([FromBody] Guid id)
|
||||||
{
|
{
|
||||||
Logger.Info($"GetUserById called with id: {id}");
|
Logger.Info($"GetUserById called with id: {id}");
|
||||||
|
var result = _userDal.GetUserById(id);
|
||||||
|
var b = result.UserProductMappings.FirstOrDefault(x => x.Id != null);
|
||||||
|
|
||||||
return await _userDal.GetUserByIdAsync(id);
|
var a = JsonSerializer.Serialize(result);
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine($"GetUserById result: {a}");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool VerifyPassword(string password, string hashedPassword)
|
private bool VerifyPassword(string password, string hashedPassword)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue