-
Notifications
You must be signed in to change notification settings - Fork 14
Mapper and repository #11
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
Conversation
|
|
||
| public int Id; | ||
|
|
||
| public decimal Latitude; | ||
|
|
||
| public decimal Longtitude; | ||
|
|
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.
А шо по відступах в нас?
| Fact fact = new Fact(); | ||
| fact.Id = 1; | ||
| fact.Title = "Test1"; | ||
| FactDTO factDTO = _mapper.Map<Fact, FactDTO>(fact); | ||
|
|
||
| return factDTO.Title; | ||
| // return _repositoryWrapper.FactRepository.GetFactsByStreetcode(); |
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.
Let's add TODO here to clean this after merge
| public void GetAudioAsync(); | ||
| public void UploadAudioAsync(); | ||
| public void DeleteAudioAsync(); |
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.
I think we can remove these duplicated methods from all repository's interfaces and just inherit them from IRepositoryBase
|
|
||
| public string GetSubtitlesByStreetcode() | ||
| { | ||
| return "GetSubtitlesByStreetcode"; |
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.
Let's add TODO for all code that we will have to clean
| public string GetFactsByStreetcode() | ||
| { | ||
| _loggerService.LogError("Error????????"); | ||
| return _factService.GetFactsByStreetcode(); |
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.
Let's use Async
| using EPlast.BLL.Interfaces.Logging; | ||
| using EPlast.BLL.Services.Logging; |
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.
Very strange namespace
AleXLaeR
left a comment
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.
Please thouroughly review my comments & impovement suggestions.
| public DateTime StartDate; | ||
|
|
||
| public DateTime EndDate; |
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.
Make these column names compliant with Streetcode Entity.
|
|
||
| public List<ImageDTO> Images; | ||
|
|
||
| public int Code; |
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.
Make this column name compliant with Streetcode Entity.
|
|
||
| public DateTime EndDate; | ||
|
|
||
| public int NumberOfViews; |
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.
Make this column name compliant with Streetcode Entity.
| public DateTime CreateDate; | ||
|
|
||
| public DateTime UpdateDate; |
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.
Make these column names compliant with Streetcode Entity.
| public int Id; | ||
|
|
||
| public string Title; |
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.
Extract "id-title" pattern to its own DTO (ex. IdentifierDTO).
| void GetById(); | ||
|
|
||
| public void GetAll(); | ||
| IQueryable<T> GetAll(); |
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.
When working with IQueryable interface, we are posing a "question", applying all necessary filters right off the bat.
Hence the method's name should be "FindAll" and not "GetAll".
| IQueryable<T> GetAll(); | ||
|
|
||
| public void GetAllAsync(); | ||
| Task<IEnumerable<T>> GetAllAsync(); |
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.
Also, it wouldn't hurt to add optional Expressions/Predicates, bound to default/null by default.
| void Create(); | ||
|
|
||
| public void CreateAsync(); | ||
| Task CreateAsync(); | ||
|
|
||
| public void GetById(); | ||
| void GetById(); |
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.
Where are method parameters?
GetById should have an integer id, Create/Update/Delete should have an entity of generic type T.
| namespace StreetCode.DAL.Repositories.Interfaces.Base; | ||
|
|
||
| public interface IRepositoryBase | ||
| public interface IRepositoryBase<T> |
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.
As a side note, during the latter stages of our development plan we would surely face the need insome form of conditional fetching of only one entity from the repo.
Hence, the base repo interface must be supplied with FirstOrDefaultAsync/SingleOrDefaultAsync methods.
| services.AddScoped(typeof(ILoggerService<>), typeof(LoggerService<>)); | ||
| services.AddScoped<IFactService, FactService>(); | ||
| services.AddScoped<IMediaService, MediaService>(); | ||
| services.AddScoped<IPartnersService, PartnersService>(); |
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.
Please divide intergration of built-in services and custom ones into their own extension methods.
AleXLaeR
left a comment
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.
All done great.
LanchevychMaxym
left a comment
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.
LGTM!
dev
JIRA
Code reviewers
Second Level Review
Summary of issue
ToDo
Summary of change
ToDo
Testing approach
ToDo
CHECK LIST