Skip to content

SubSonic-Core/SubSonic.Core.DataAccessLayer

Repository files navigation

DotNET Downloads

SubSonic.Core.Abstractions Nuget Nuget

SubSonic.Core.DAL Nuget Nuget

Fast Data Access, your database should belong to SubSonic.

SubSonic.Extensions.SqlServer Nuget Nuget

SqlServer Db Client and Factory

SubSonic.Extensions.Test Nuget Nuget

MockSubSonic Db Client and Factory, primary purpose is for unit testing and faking the database server.

Why should you switch to SubSonic

  • User-Defined table types (UDTT) are performant, used in stored procedures, insert, update and delete database calls reduces the number of parameters needed to pass to the database. This has reduced the time taken to generate an insert statement of three records with three columns of data by 75%. That is a significant savings in computer time.
  • User-Defined table types, can define a data contract between the database and your application.
  • Insert and Update queries make use of change data capture(CDC) this allows Sub Sonic to retrieve data generated by the database. I.E: identity and computed columns

Supported Frameworks

  • .NETStandard,Version=v2.0
  • .NETStandard,Version=v2.1

Supported Database Servers

  • Sql Server >= 2012

Features

  • Database Context
  • Lazy Loading supports the following relationship types
    • OneToNone
    • OneToMany
    • ManyToOne
    • ManyToMany
  • Stored Procedure Support
  • Scalar Function Mapping
  • Db Model mapping of Table and User Defined Data Type
  • Command Query Responsibility Segregation (CQRS) approach to database operations against a DB Model
  • Linq Query mapping supports
    • WHERE [COLUMN] (NOT) IN ([QUERY] | [VALUE, VALUE])
    • WHERE [COLUMN] [OPERATOR] [VALUE] (AND | OR) ...
    • WHERE (NOT) EXISTS ([QUERY])
    • WHERE [DATE VALUE | COLUMN] (NOT) BETWEEN [DATE VALUE] AND [DATE VALUE]
  • Support for paging large datasets
    • How it is done, we use a cte to filter, order and page the table index.
    • Then we use an inner join with the cte to the table and pull back the complete page that we are looking for.
    • We use a MARS query to retrieve the unpaged record count at the same time. this approach removed the need for a second call from a traditional DAL and reduces the overhead by 50%.
  • Supports OrderBy, OrderByDescending, ThenBy, ThenByDescending
  • Data Caching
  • Insert and Update queries use Change Data Capture (CDC) to extract database generated data back to the client.
    • It is not required that a User-Defined Table Type should exist, but it is performant to use one.
    • The insert DML is executed syncrounously, and SQL optimizer will not use parallelization.
    • The update DML is executed syncrounously, and SQL optimizer will use parallelization.
  • Proxy Support
    • overrides virtual navigation and collection properties.
    • when navigation property value changes proxy changes the foreign key property to match.
    • proxy implements IEntityProxy which implements Data, KeyData, ModelType, IsDirty, IsNew, IsDeleted

Crypto Tip Jar