-
Notifications
You must be signed in to change notification settings - Fork 13
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
File scoped and explicit enums #19
base: master
Are you sure you want to change the base?
File scoped and explicit enums #19
Conversation
var book = await this._unitOfWork.Repository.AddAsync<Book, Guid>( | ||
new Book |
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.
Remove unnecessary 'this' qualifier @jeffward01
AuthorId = entity.Id | ||
}); | ||
|
||
await this._unitOfWork.Repository.CompleteAsync(); |
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.
Remove unnecessary 'this' qualifier @jeffward01
[HttpPost("range")] | ||
public async Task<IActionResult> AddAuthorAsync([FromBody] List<AuthorRequestDto> dto) | ||
{ | ||
var entity = await this._unitOfWork.Repository.AddRangeAsync<Author, Guid>( |
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.
Remove unnecessary 'this' qualifier @jeffward01
[HttpGet("filterable-multiple")] | ||
public async Task<IActionResult> GetFilterableMultipleAsync([FromQuery] AuthorFilterDto dto) | ||
{ | ||
var entities = await this._unitOfWork.Repository.GetMultipleAsync<Author, AuthorFilterDto, object>( |
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.
Remove unnecessary 'this' qualifier @jeffward01
public async Task<IActionResult> GetIncludeableFilterableMultipleAsync([FromQuery] AuthorFilterDto dto) | ||
{ | ||
Func<IQueryable<Author>, IIncludableQueryable<Author, object>> include = a => a.Include(i => i.Books); | ||
var entities = await this._unitOfWork.Repository.GetMultipleAsync<Author, AuthorFilterDto, object>( |
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.
Remove unnecessary 'this' qualifier @jeffward01
var entities = await this._unitOfWork.Repository.GetMultipleAsync<Author>(false); | ||
|
||
return this.Ok(entities); |
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.
Remove unnecessary 'this' qualifier @jeffward01
var entities = await this._unitOfWork.Repository.GetMultipleAsync<Author, object>( | ||
false, | ||
select => new |
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.
Remove unnecessary 'this' qualifier @jeffward01
var entity = await this._unitOfWork.Repository.GetByIdAsync<Author>(true, id); | ||
await this._unitOfWork.Repository.HardDeleteAsync(entity); | ||
|
||
return this.NoContent(); |
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.
Remove unnecessary 'this' qualifier @jeffward01
var entity = await this._unitOfWork.Repository.GetByIdAsync<Author>(true, id); | ||
await this._unitOfWork.Repository.SoftDeleteAsync<Author, Guid>(entity); | ||
|
||
return this.NoContent(); |
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.
Remove unnecessary 'this' qualifier @jeffward01
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.
Too many unnecessary 'this' qualifiers are used.
All of these need to be removed.
} | ||
public async Task CompleteAsync(CancellationToken cancellationToken = default) | ||
{ | ||
await this._context.SaveChangesAsync(cancellationToken) |
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.
Remove unnecessary 'this' qualifier @jeffward01
Let the methods using normal bools stay for now. I don't think it's necessary to make a big change in one go. |
First of all, big thank you for all of your change requests! I would much rather that you mention your opinion and suggest changes, rather than 'just hit accept'. Thank you.
Are the
Ahh, your one of these people who dislike I will remove all of |
You are right, with |
Summary
*** Summary is here ***
Changes made:
async Task<int> Count(....)
toasync Task<int> CountAsync(....)
AsNoTracking
option. See belowIf you want, I can also apply the change to the classic
boolean
GetById<TEntity>(bool, object)
method. I did not want to introduce any breaking changes, so I skipped this on the classic version.