-
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
Features/sorvkumr/complete controller methods #25
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
var ret = await _designationService.InsertAsync(value); | ||
if(ret != null) { return TypedResults.Ok(ret); } | ||
return null; | ||
if (value?.Name != "") |
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.
Can we use string.IsNullOrEmpty.
var ret = await _designationService.UpdateAsync(value); | ||
if(ret != null) { return TypedResults.Ok(ret); } | ||
return null; | ||
if (value?.Name != "") |
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.
Can we use string.IsNullOrEmpty.
{ | ||
foreach (var item in items) | ||
{ | ||
var projectResult = _projectService.GetAsync(item.ProjectId)?.Result; |
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.
await it, insted of Result.
IEnumerable<Module> items = await _repository.GetAsync(); | ||
if (items.Any()) | ||
{ | ||
foreach (var item in items) |
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.
Instead of doing this can we use the navigation property, if we have one.
|
||
public async Task<ModuleResponse?> GetByIdAsync(Guid? id) | ||
{ | ||
var item = await _repository.GetByIDAsync(id); |
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.
Instead of doing 2 queries, can we use a join.
if (ret != null) | ||
{ | ||
await _repository.SaveChangesAsync(); | ||
var projectVal = _projectService.GetAsync(ret.ProjectId).Result; |
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.
await
if (result != null) | ||
{ | ||
await _repository.SaveChangesAsync(); | ||
var projectVal = _projectService.GetAsync(result.ProjectId).Result; |
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.
await
Add crud for the Module. Review and added checks in the Designation controller.