I was planning on publishing this (completely rewritten) version of Tesseract DAB, 3 years ago. However, I could not find the time to do so. Just like Tesseract DAB, this is MUCH faster than Entity Framework but, you have to create the POCOs and utilize either stored procs or straight SQL.

Things this project has to offer:
  • Object caching
  • Multi-Threaded object population
  • Table valued param support,
  • Multiple connection string support,
  • Ability to connect to multiple (disparate) data sources within one application
    • Ability to create your own connector if I haven't created one already
  • and... I could go on for a while.


2.0 can be extended to other DB types by creating a library that ties into Database.Core; similar to Database.Sql and Database.ODBC.

I will be adding SQL Compact, MDX (SSAS), and Oracle soon; so keep an eye on this page for those releases.

Documentation: Check the Downloads section. Will have a documentation website up soon.

Set up (Global.asax, App.xaml.cs, etc.):

  // Application initialization. WPF used for this example.
  protected override void OnActivated(EventArgs e)
  {
    Database.Sql.Environment.Connections.Add("DefaultConnection", ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);

    //If you want multiple compiled connections...
    Database.Sql.Environment.Connections.Add("Connection2", ConfigurationManager.ConnectionStrings["Connection2"].ConnectionString);
    Database.Sql.Environment.Connections.Add("Connection3", ConfigurationManager.ConnectionStrings["Connection3"].ConnectionString);

    Database.Sql.Environment.Connections.DefaultConnection = "DefaultConnection";

    //OR...
    //NEW FEATURE: Load from config file... and it filters connections based on the provider type.
    Database.Sql.Environment.Connections.LoadConfigFileConnections("DefaultConnection");
    Database.Odbc.Environment.Connections.LoadConfigFileConnections("DefaultConnection");

    base.OnActivated(e);
  }

Singular class:

  namespace Sample
  {
    public class SampleClass
    {
      public int Id { get; set; }
      //more props if you wish

      public SampleClass()
      { }

      public SampleClass(int id)
      {
        StoredProc.GetDataTable("uspSampleSelect", new Parameters{
          {"id", id}
        }).ToEntity(this);
      }

      public void Save()
      {
        Id = StoredProc.ExecuteScalar<int>("uspSampleSave, new Parameters("id", Id));
      }
    }
  }


Plural class:

  namespace Sample
  {
    public class SampleClasses : EntityCollectionBase<SampleClass>
    {
      //properties, ctors, save methods, etc.

      public SampleClasses()
      {
        Load(StoredProc.GetDataTable("uspSampleSelect"));
      }
    }
  }


3.0 release:
  • Getting rid of TVPColumnOrder
  • Adding GetEntities<T>
  • Overhauling the code base (It needs some cleanup)
  • Moving Database.Environment.Connections to Database.Core
  • Getting rid of Database.Environment
  • Adding support for *.config file section
  • Reworking ChildColumnMap functionality and changing attribute name to "Map"
  • Going to attempt GetEntities<T> where T: Tuple (would be great for those pesky DataSets)

Last edited May 3, 2016 at 7:50 PM by robertschoenstein, version 17