سلامکلاسهای زیر را داریم


public interface ICustomerRepository
{
List<Customers> GetAllCustomers();
IEnumerable<Customers> GetCusstomersByFilter(string parameter);
List<ListCustomerViewModel> GetNameCustomers(string filter = "");
Customers GetCustomerById(int customerId);
bool InsertCustomer(Customers customer);
bool UpdateCustomer(Customers customer);
bool DeleteCustomer(Customers customer);
bool DeleteCustomer(int customerId);
int GetCustomerIdByName(string name);
string GetCustomerNameById(int customerId);
}

و


public class CustomerRepository : ICustomerRepository
{
private Accounting_DBEntities db;


public CustomerRepository(Accounting_DBEntities context)
{
db = context;
}


public List<Customers> GetAllCustomers()
{
return db.Customers.ToList();
}


public IEnumerable<Customers> GetCusstomersByFilter(string parameter)
{
return db.Customers.Where(c =>
c.FullName.Contains(parameter) || c.Email.Contains(parameter) || c.Mobile.Contains(parameter)).ToList();
}


public List<ListCustomerViewModel> GetNameCustomers(string filter = "")
{
if (filter == "")
{
return db.Customers.Select(c => new ListCustomerViewModel()
{
CustomerID = c.CustomerID,
FullName = c.FullName
}).ToList();
}


return db.Customers.Where(c => c.FullName.Contains(filter)).Select(c => new ListCustomerViewModel()
{
CustomerID = c.CustomerID,
FullName = c.FullName
}).ToList();
}


public Customers GetCustomerById(int customerId)
{
return db.Customers.Find(customerId);
}


public bool InsertCustomer(Customers customer)
{
try
{
db.Customers.Add(customer);
return true;
}
catch
{
return false;
}
}


public bool UpdateCustomer(Customers customer)
{
// try
// {
var local = db.Set<Customers>()
.Local
.FirstOrDefault(f => f.CustomerID == customer.CustomerID);
if (local != null)
{
db.Entry(local).State = EntityState.Detached;
}
db.Entry(customer).State = EntityState.Modified;
return true;
// }
// catch
// {
// return false;
// }
}


public bool DeleteCustomer(Customers customer)
{
try
{
db.Entry(customer).State = EntityState.Deleted;
return true;
}
catch
{
return false;
}
}


public bool DeleteCustomer(int customerId)
{
try
{
var customer = GetCustomerById(customerId);
DeleteCustomer(customer);
return true;
}
catch
{
return false;
}
}


public int GetCustomerIdByName(string name)
{
return db.Customers.First(c => c.FullName == name).CustomerID;
}


public string GetCustomerNameById(int customerId)
{
return db.Customers.Find(customerId).FullName;
}
}


چگون می توان تبدیل به Async کنم
باتشکر