Keyvan
Keyvan
CC#
Created by Keyvan on 3/5/2025 in #help
How far should i normalize my DB?
namespace Server.Models {
public class User {
public Guid Id { get; set; } // UUID
public string FirstName { get; set; }
public string LastName { get; set; }
public string? Password { get; set; }
public string Email { get; set; }
public int Verified { get; set; }
public string Role { get; set; }
public DateTime LastOnline { get; set; }
public DateTime JoinedDate { get; set; }
}
}
namespace Server.Models {
public class User {
public Guid Id { get; set; } // UUID
public string FirstName { get; set; }
public string LastName { get; set; }
public string? Password { get; set; }
public string Email { get; set; }
public int Verified { get; set; }
public string Role { get; set; }
public DateTime LastOnline { get; set; }
public DateTime JoinedDate { get; set; }
}
}
9 replies
CC#
Created by Keyvan on 3/5/2025 in #help
How far should i normalize my DB?
using System.ComponentModel.DataAnnotations;

namespace Server.Models
{
public sealed class Exam
{
public Guid ExamId { get; set; } = Guid.NewGuid();
public string Institute { get; set; }
public string Course { get; set; }
public string CourseManager { get; set; }
public int Year { get; set; }
public string Path { get; set; }
public string? PublicId { get; set; }

public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public ICollection<ExamSubmission> Submissions { get; set; } = new List<ExamSubmission>(); // one exam can have multiple submissions.
}
}
using System.ComponentModel.DataAnnotations;

namespace Server.Models
{
public sealed class Exam
{
public Guid ExamId { get; set; } = Guid.NewGuid();
public string Institute { get; set; }
public string Course { get; set; }
public string CourseManager { get; set; }
public int Year { get; set; }
public string Path { get; set; }
public string? PublicId { get; set; }

public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public ICollection<ExamSubmission> Submissions { get; set; } = new List<ExamSubmission>(); // one exam can have multiple submissions.
}
}
9 replies
CC#
Created by Keyvan on 3/5/2025 in #help
How far should i normalize my DB?
Here are the schemas:
namespace Server.Models
{
public sealed class ExamAnswer
{
public Guid Id { get; set; } =
Guid.NewGuid(); // UUID
public string UserId { get; set; } // Foreign key to user who this belongs to
public DateTime CompletionDate { get; set; } = DateTime.UtcNow;
public string Answer { get; set; }
public Guid ExamId { get; set; } // Foreign key to exam
}
}
namespace Server.Models
{
public sealed class ExamAnswer
{
public Guid Id { get; set; } =
Guid.NewGuid(); // UUID
public string UserId { get; set; } // Foreign key to user who this belongs to
public DateTime CompletionDate { get; set; } = DateTime.UtcNow;
public string Answer { get; set; }
public Guid ExamId { get; set; } // Foreign key to exam
}
}
9 replies
CC#
Created by Keyvan on 2/17/2025 in #help
✅ Why is it common practice to reroute users to login after registering?
Thanks
27 replies
CC#
Created by Keyvan on 2/17/2025 in #help
✅ Why is it common practice to reroute users to login after registering?
I see
27 replies
CC#
Created by Keyvan on 2/17/2025 in #help
✅ Why is it common practice to reroute users to login after registering?
Cant i just create a session if the register is successful and proceed with the user logged in? In this way the user is logged it automatically without any redirect.
27 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Thanks for the effort
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
The problem was that in docker i cant use localhost(127.0.0.0) i switched to 0.0.0.0 and now its working
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
I got it to work!!! @everyone
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
So if it is any mapping or CORS i should get an error
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
hmmm, then i suspect port mapping as the problem. I will try to send http rq to the backend from the frontend. They are in the same container in development
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
So the code works fine, the backend is launched and runnung but i cannot send requests to the backend from outside of the container...
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
i can send curl request from within the docker shell but not form outside of the docker shell
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
yeah The thing is:
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
yes it does because of the volume mounting in the docker compose
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
.
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
which executes a shell script dotnet run
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Yes but in the docker compose there is defined entrypoint
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Also i run dotnet run in entrypoint.sh
42 replies
CC#
Created by Keyvan on 1/17/2025 in #help
Dockerizing dotnet
Not prod
42 replies