Addet Employye get logic
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using Database.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Database.Models;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Database.Repository
|
||||
{
|
||||
@@ -58,5 +59,16 @@ namespace Database.Repository
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeEntity>> GetAllAsync()
|
||||
{
|
||||
await using PosDbContext context = new PosDbContext();
|
||||
|
||||
return await context.Employee
|
||||
.AsNoTracking()
|
||||
.Where(employee => !employee.IsArchived)
|
||||
.OrderBy(employee => employee.Name)
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user