before adding COA packages

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

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>COA.EnterpriseServices.Creditors</AssemblyName>
</PropertyGroup>
<ItemGroup>

View File

@ -0,0 +1,27 @@
namespace COA.EnterpriseServices.Creditors
{
public class CreditorController
{
private readonly CreditorLibrary creditorLibrary;
public CreditorController(CreditorLibrary creditorLibrary)
{
this.creditorLibrary = creditorLibrary;
}
public string GetCreditorStatus(int creditorId)
{
return creditorLibrary.GetCreditorStatus(creditorId);
}
public bool SetCreditorStatus(int creditorId, string status)
{
return creditorLibrary.SetCreditorStatus(creditorId, status);
}
public void AddOfferResponse()
{
creditorLibrary.AddOfferResponse();
}
}
}

View File

@ -1,13 +1,12 @@
using COA.EnterpriseServices.DataAccess.Helpers;
using System;
namespace COA.EnterpriseServices.Creditor
namespace COA.EnterpriseServices.Creditors
{
public class CreditorController
public class CreditorLibrary
{
private readonly CreditorHelper creditorHelper;
public CreditorController(CreditorHelper creditorHelper)
public CreditorLibrary(CreditorHelper creditorHelper)
{
this.creditorHelper = creditorHelper;
}

View File

@ -5,7 +5,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

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
}
}
}

View File

@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\COA.EnterpriseServices.Creditor\COA.EnterpriseServices.Creditor.csproj" />
<ProjectReference Include="..\COA.EnterpriseServices.Creditors\COA.EnterpriseServices.Creditors.csproj" />
<ProjectReference Include="..\COA.EnterpriseServices.DataAccess.EntityFramework\COA.EnterpriseServices.DataAccess.EntityFramework.csproj" />
<ProjectReference Include="..\COA.EnterpriseServices.DataAccess.QuickBase\COA.EnterpriseServices.DataAccess.QuickBase.csproj" />
<ProjectReference Include="..\COA.EnterpriseServices.DataAccess\COA.EnterpriseServices.DataAccess.csproj" />

View File

@ -1,4 +1,4 @@
using COA.EnterpriseServices.Creditor;
using COA.EnterpriseServices.Creditors;
using COA.EnterpriseServices.DataAccess;
using System;
using System.Runtime.CompilerServices;

View File

@ -11,7 +11,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COA.EnterpriseServices.Data
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COA.EnterpriseServices.Sandbox", "COA.EnterpriseServices.Sandbox\COA.EnterpriseServices.Sandbox.csproj", "{61BE21F9-8C5B-4C99-885A-E0B1E5BDCA79}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COA.EnterpriseServices.Creditor", "COA.EnterpriseServices.Creditor\COA.EnterpriseServices.Creditor.csproj", "{FD33DD45-C0B9-45EE-B4C9-43CF1E6AB383}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COA.EnterpriseServices.Creditors", "COA.EnterpriseServices.Creditors\COA.EnterpriseServices.Creditors.csproj", "{FD33DD45-C0B9-45EE-B4C9-43CF1E6AB383}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution