before adding COA packages

This commit is contained in:
2020-10-15 08:48:11 -04:00
parent d990c53029
commit 4630b54fd2
10 changed files with 60 additions and 8 deletions

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.0.0" />
<PackageReference Include="StructureMap" Version="4.7.1" />
</ItemGroup>

View File

@ -26,19 +26,32 @@ namespace COA.EnterpriseServices.DataAccess.Helpers
public ICollection<Creditor> FindByName(string name)
{
// TODO: use AutoMapper to return mapped domain objects!
return creditorDataAccess.Get(c => c.ClientFirstName.Contains(name) || c.ClientLastName.Contains(name));
}
public ICollection<Creditor> FindByStatus(string status)
{
// TODO: use AutoMapper to return mapped domain objects!
return creditorDataAccess.Get(c => c.Status == status);
}
public bool AddCreditor(Creditor creditor)
{
// TODO: use AutoMapper to pass in mapped domain object!
return creditorDataAccess.Add(creditor);
}
public bool UpdateCreditor(Creditor creditor)
{
// TODO: use AutoMapper to pass in mapped domain object!
return creditorDataAccess.Update(creditor);
}
public bool SetCreditorStatus(int creditorId, string status)
{
return creditorDataAccess.Update(creditorId, c => c.Status = status);

View File

@ -0,0 +1,12 @@
using AutoMapper;
namespace COA.EnterpriseServices.DataAccess
{
public class MappingProfile : Profile
{
public MappingProfile()
{
// add mappings between domain and entity objects here
}
}
}