Skip to content

Conversation

@KennyDeew
Copy link

No description provided.

KennyDew added 6 commits June 1, 2025 22:29
added EfCore (+Design,Sqlite,Tools) libraries
пункт №1
added HasData for Role, Preference, Employee, Customer entities
сonfigured mapping for Role, Preference, Employee, Customer entities
пункты №2, 3 и 4
added CustomerRepository
added Cascade delete for Promocodes on delete Customer
пункт №5
пункт №6
пункт №8
{
public interface ICustomerRepository : IRepository<Customer>
{
Task<IQueryable<Customer>> GetAllWithPreferenceAsync();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше возвращать IEnumerable


public async Task<IQueryable<Customer>> GetAllWithPreferenceAsync()
{
return Context.Set<Customer>().Include(c => c.CustomerPreferences).ThenInclude(cp => cp.Preference).AsNoTracking() ;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше добавить ToListAsync, чтобы здесь выполнить запрос к БД

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants