before adding COA packages
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="10.0.0" />
|
||||
<PackageReference Include="StructureMap" Version="4.7.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -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);
|
||||
|
12
COA.EnterpriseServices.DataAccess/MappingProfile.cs
Normal file
12
COA.EnterpriseServices.DataAccess/MappingProfile.cs
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user