예제 #1
0
        public async Task <IEnumerable <Product> > GetAllProductsAsync()
        {
            var products = await _context.Set <Product>()
                           .OrderByDescending(c => c.ProductId)
                           .ToListAsync();

            return(products);
        }
예제 #2
0
        public async Task <IEnumerable <Customer> > GetAllCustomersAsync()
        {
            var customers = await _context.Set <Customer>()
                            .OrderByDescending(c => c.CustomerId)
                            .ToListAsync();

            return(customers);
        }
예제 #3
0
        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);
        }