tweaks
This commit is contained in:
parent
9dca60bec7
commit
b37433e6de
@ -8,10 +8,10 @@ namespace COA.EnterpriseServices.DataAccess.Helpers
|
||||
// It allows for multiple DataAccessManagers to be used however needed by the helper
|
||||
public class CreditorHelper
|
||||
{
|
||||
private static DataAccessManager<Creditor> creditorDataAccess;
|
||||
private static DataAccessManager<SettlementAttempt> settlementAttemptDataAccess;
|
||||
private static readonly DataAccessManager<Creditor> creditorDataAccess;
|
||||
private static readonly DataAccessManager<SettlementAttempt> settlementAttemptDataAccess;
|
||||
|
||||
public CreditorHelper()
|
||||
static CreditorHelper()
|
||||
{
|
||||
creditorDataAccess = new DataAccessManager<Creditor>();
|
||||
settlementAttemptDataAccess = new DataAccessManager<SettlementAttempt>();
|
||||
@ -19,12 +19,12 @@ namespace COA.EnterpriseServices.DataAccess.Helpers
|
||||
|
||||
public Creditor GetCreditor(int id)
|
||||
{
|
||||
return creditorDataAccess.Invoke(d => d.Get(d => d.Id == id).FirstOrDefault());
|
||||
return creditorDataAccess.Invoke(d => d.Get(d => d.Id == id)?.FirstOrDefault());
|
||||
}
|
||||
|
||||
public SettlementAttempt GetSettlementAttempt(int id)
|
||||
{
|
||||
return settlementAttemptDataAccess.Invoke(d => d.Get(d => d.Id == id).FirstOrDefault());
|
||||
return settlementAttemptDataAccess.Invoke(d => d.Get(d => d.Id == id)?.FirstOrDefault());
|
||||
}
|
||||
|
||||
public ICollection<Creditor> FindByName(string name)
|
||||
|
@ -7,8 +7,8 @@ namespace COA.EnterpriseServices.Sandbox
|
||||
{
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
ClientStuff();
|
||||
//CreditorStuff();
|
||||
//ClientStuff();
|
||||
CreditorStuff();
|
||||
}
|
||||
|
||||
private static void CreditorStuff()
|
||||
|
Loading…
x
Reference in New Issue
Block a user