working with QB field mapping registry
This commit is contained in:
@ -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" />
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user