public async Task <IEnumerable <Product> > GetAllProductsAsync() { var products = await _context.Set <Product>() .OrderByDescending(c => c.ProductId) .ToListAsync(); return(products); }
public async Task <IEnumerable <Customer> > GetAllCustomersAsync() { var customers = await _context.Set <Customer>() .OrderByDescending(c => c.CustomerId) .ToListAsync(); return(customers); }
public async Task <IEnumerable <Repair> > GetAllRepairsAsync() { var repairs = await _context.Set <Repair>() .Include(c => c.Product) .Include(c => c.RepairStatus) .Include(c => c.Customer) .OrderByDescending(c => c.CreateDate) .ToListAsync(); return(repairs); }
public async Task <EmailTemplate> GetEmailTemplateByIdAsync(int emailTemplateId) { var emailTemplate = await _context.Set <EmailTemplate>() .FirstOrDefaultAsync(c => c.EmailTemplateId == emailTemplateId); return(emailTemplate); }
public async Task <EmailSubject> GetEmailSubjectByIdAsync(int emailSubjectId) { var emailSubject = await _context.Set <EmailSubject>() .FirstOrDefaultAsync(c => c.EmailSubjectId == emailSubjectId); return(emailSubject); }