working with QB field mapping registry

This commit is contained in:
2020-10-14 08:35:14 -04:00
parent 4ed44dc913
commit 5151da0724
26 changed files with 605 additions and 132 deletions

View File

@ -5,10 +5,6 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="structuremap" Version="4.7.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\COA.EnterpriseServices.DataAccess.EntityFramework\COA.EnterpriseServices.DataAccess.EntityFramework.csproj" />
<ProjectReference Include="..\COA.EnterpriseServices.DataAccess.QuickBase\COA.EnterpriseServices.DataAccess.QuickBase.csproj" />

View File

@ -1,40 +1,33 @@
using COA.EnterpriseServices.DataAccess;
using COA.EnterpriseServices.DataAccess.EntityFramework;
using COA.EnterpriseServices.DataAccess.EntityFramework.Entities;
using COA.EnterpriseServices.DataAccess.QuickBase;
using StructureMap;
using System;
using COA.EnterpriseServices.DataAccess.Entities;
using COA.EnterpriseServices.DataAccess.Helpers;
namespace COA.EnterpriseServices.Sandbox
{
class Program
internal class Program
{
static void Main(string[] args)
private static void Main(string[] args)
{
var container = CreateContainer();
var creditorHelper = new CreditorHelper();
var creditorDataAccess = container.GetAllInstances<IDataAccess<Creditor>>();
// get single creditor
var singleCreditor = creditorHelper.GetCreditor(1);
// search creditors
var searchedCreditors = creditorHelper.FindCreditorsByName("Guy");
}
// search active creditors
var activeCreditors = creditorHelper.FindByStatus("Active");
private static IContainer CreateContainer()
{
return new Container(c =>
var newCreditor = new Creditor
{
//c.Scan(s =>
//{
// s.WithDefaultConventions();
// s.AssembliesFromApplicationBaseDirectory();
//});
ClientFirstName = "New",
ClientLastName = "Guy",
Status = "Active"
};
// when saving to QuickBase is needed (as well as SQL)
c.For<IDataAccess<Creditor>>().Add<EntityDataAccess<Creditor>>();
c.For<IDataAccess<Creditor>>().Add<QuickBaseDataAccess<Creditor>>();
// when only SQL is needed
//c.For<ISettlementAttemptDataAccess>().Singleton().Use<EfSettlementAttemptDataAccess>();
});
creditorHelper.AddCreditor(newCreditor);
}
}
}