-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review Backend - Sunny #3
base: main
Are you sure you want to change the base?
Conversation
[HttpGet] | ||
public async Task<ActionResult<IEnumerable<Candidate>>> GetAllCandidate() | ||
{ | ||
var a = await _candidateService.GetAllCandidate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename a to candidates
_commentService = commentService; | ||
} | ||
|
||
[HttpGet("get/{CandidateId}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename CandidateId to camel case
} | ||
|
||
#region table | ||
public DbSet<Candidate> Candidate { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to plural word for data list variable
public string Experience { get; set; } | ||
public string Skills { get; set; } | ||
public string Personality { get; set; } | ||
public string cInputDate { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to Pascal case
public int CommentId { get; set; } | ||
public string cComment { get; set; } | ||
|
||
public string cCommentDate { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pascal case
{ | ||
[Key] | ||
public int CommentId { get; set; } | ||
public string cComment { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pascal case and rename to more details or add the comment
|
||
namespace ToDoAPI.Data | ||
{ | ||
public class Commentinfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CommentInfo
|
||
public DbSet<User> Users { get; set; } | ||
|
||
public DbSet<Commentinfo> Commentinfo { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to CommentInfos
public string Password { get; set; } | ||
} | ||
|
||
public class LoginResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create new folder to separate Model and Contract class
{ | ||
//return await _context.Candidate.Where(ci => ci.CandidateId == CandidateId).ToListAsync(); | ||
|
||
var candidates = await _context.Commentinfo.Where(c => c.CandidateId == CandidateId).ToListAsync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to more related to variable
Data
-> In the Candidate table have data CandidateId, FirstName, LastName, Email, PhoneNumber, Rating, Position, Gender, Attitude, Experience, Skills, Personality, cInputDate and cAppointment
-> In the Commentinfo table have CommentId, cComment, cCommentDate, CandidateId
-> In the User table have Id, Name, UserName, Password
Schemas
Controller
-> CandidateController have Method
-> CommentController have Method
-> User have Method
Services/Interfaces
-> CandidateServices connect with ICandidateServices
-> CommentServices connect with ICommentServices
-> UserService connect with IUserService