Code Monkey home page Code Monkey logo

repodb's Introduction

SolutionBuilds Version Releases UnitTests IntegrationTests GitterChat

RepoDB - a hybrid ORM Library for .NET.

RepoDB is an open-source .NET ORM library that bridges the gaps of micro-ORMs and full-ORMs. It helps you simplify the switch-over of when to use the BASIC and ADVANCE operations during the development.

To get the latest updates about this library, follow us on Twitter!

Benefits/Advantages

Like with any other ORMs, RepoDB does provide the preliminary methods needed for your basic operations. The good thing is, it also does provide the operations that is needed to cater your edge-cases like 2nd-Layer Cache, Tracing, Repositories, Property Handlers and Batch/Bulk Operations.

If you are to use RepoDB, your development experience is as simple as opening a connection and calling the advance operations with a very minimal code. It is the reason that makes this library the simpliest ORM to use.

When you do the bulk operations, the generated value of the identity columns will be set back to the data models, just right after your execution. It is an important use-case that is/may needed by you and/or most developers, and both the BulkInsert and BulkMerge operations addressed this need.

RepoDB also does support the different way-of-executions (the atomic, the batch and the bulk). Through this, it is easy for you to establish your repository that can process the smallest-to-the-largest datasets without even affecting the efficiency and the performance of your application.

Important Attributes

Easy to Use - the operations were all implemented as extension methods of your IDbConnection object. For as long your connection is open, any operations can then be called against your database.

High Performant - it caches the already-generated compiled expressions for future reusabilities and executions. It understands your schema to create the most optimal compiled expression AOT.

Memory Efficient - it extracts and caches your object properties, execution contexts, object mappings and SQL statements. It is reusing them all throughout the process of transformations and executions.

Dynamic and Hybrid - it provides some advance features of the full-fledged ORMs. It significantly help the developers to simplify the experience when context-switching during the development.

Open-Source Software - it is an open-source software and will always be free. It is authored to further improve the .NET data access experiences and solutions, together with the collective ideas of the community.

High Quality - it is a high-quality micro-ORM supported by 10K+ real-life Unit and Integration Tests. It is highly tested and is used by various critical systems that are running in the Production environment.

Get Started

Please click any of the link below to fast-track your learnings.

Or, learn a specific feature.

Otherwise, please visit our documentation page to learn more.

Supported Databases

The execute methods below support all the RDBMS data providers.

Whereas the fluent methods below only support the SQL Server, SQLite, MySQL and PostgreSQL RDBMS data providers.

Click here to see all the operations.

Package Referencing

By default, .NET is auto-resolving the references, however, we strongly recommend that you always explicitly reference the RepoDb core library. The rationale behind this is that, the RepoDb core library is a fast-moving package in which all the alpha/beta releases, hotfixes and/or even the actual releases could happen without affecting the extension libraries.

Please note that we are releasing an actual next released-version if the changes are having minimal impact but is important for the other users.

You can always target the version when installing the library, even it is on a semantic release.

> Install-Package RepoDb -version 1.x.x-betaX

.NET Type Coercion

By default, RepoDB does not do the automatic .NET CLR Type conversion during the serialization and deserialization process. The coercion support is completely dependent to the ADO.NET coercion capability.

It is in purpose to strictly notify you (as a library user) the design and/or the implementation problem of the entity model if being compared to its corresponding database table/view.

If you wish to have an automatic conversion, simply set the Converter.ConversionType property to Automatic.

RepoDb.Converter.ConversionType = ConversionType.Automatic;

Note: The exception that is being thrown is dependent to what the underlying ADO.NET coercion exception. If the Automatic conversion is used, the extracted value will always be evaluated and an additional conversion logic will be used (if needed). The conversion logic is through the AOT compilation of System.Linq.Expressions.Expression.Convert and/or System.Convert.

Exception Handling

As the compiler exception is a bit low-level and is not descriptive for the native language, therefore, when compiling the process of hydration from/to the database and the application, a customized exception is being thrown to provide a detailed exception messages to the callers.

On the other hand, as part of the standard when writing code in RepoDB (i.e.: respect the default exception handling of .NET, ensure an unharmonized exception when bubbling up the exception messages), RepoDB does not contain a single line of code that catches and rethrowing any exception (try-catch statement). Any exception happens within the library whether it is an ADO.NET exception and/or whatever will be bubble up natively back to the callers.

System.Data.SqlClient

If you are working with this package, you are required to bootstrap the connection object on the startup.

var dbSetting = new SqlServerDbSetting();

DbSettingMapper
	.Add<System.Data.SqlClient.SqlConnection>(dbSetting, true);
DbHelperMapper
	.Add<System.Data.SqlClient.SqlConnection>(new SqlServerDbHelper(), true);
StatementBuilderMapper
	.Add<System.Data.SqlClient.SqlConnection>(new SqlServerStatementBuilder(dbSetting), true);

Or, you can replicate the actual SqlServerBootstrap class implementation and attach it to your solution. Then, call the local class initializer method explicitly.

Trust Server Certificate

For RepoDb.SqlServer package, starting the version v1.1.5-beta4, the Microsoft.Data.SqlClient v4.0.0 is used, however, it seems to require a TLS 1.2 when connecting to the database via Integrated Security.

In most cases, an exception below is thrown if the mentioned security chain is not enabled.

A connection was successfully established with the server, but then an error occurred during the login process.
(provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
---> System.ComponentModel.Win32Exception: The certificate chain was issued by an authority that is not trusted..

The issue above can be rectified by simply enabling the TLS 1.2. Alternatively, the argument TrustServerCertificate can be used on the connection string.

Note: By enabling the TrustServerCertificate argument, as per Microsoft, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. Therefore, only enable this flag if needed.

Library Limitations

It is very important for you and to the community of .NET to learn the things the library is capable and is-not capable of doing, so please spend time reading the limitation page before using the library.

Benchmark

The benchmark result shown on this section is the result of the community-approved ORM bencher tool, the RawDataAccessBencher tool.

Below is the actual recent official execution result.

RepoDB shows an impressive performance and memory-efficiency if being compared with other ORMs available in the .NET ecosystem. It has positioned itself just right behind the logic-less hand-coded materializer if being benchmark with .NET Core and .NET Framework. However, RepoDB is the fastest and the most-efficient ORM if being benchmark with .NET 5, even beating the hand-coded materializer.

Important Note

The AOT compilation (IL/Expression) has some degree of performance impact, even just for milliseconds, therefore, if you are to materialize RepoDB, it is highly recommended to always eliminate the first execution.

To avoid the bias, you as well should exclude the first execution of the other ORMs during the benchmarking.

Contributions

We would like to make RepoDB the mainstream hybrid-ORM library for .NET technology. Please help us build and realize the solution.

To contribute, please find a for-grabs item and issue a PR. Otherwise, you may create a new issue for us to look-at and discuss.

If you wish to contribute to the documentation site, it is hosted in the RepoDb.NET repository. Your expertise is needed to correct the forms, if needed.

Your biggest contribution is to utilize and share this library to the other developers.

  • Blog it
  • Discuss it
  • Document it
  • Share it
  • Use it

Or, show your support by simply giving a ⭐ on this project.

Engagements

Please get in touch with us via:

Ensure to visit our Support Policy to get more details about our policies when handling the operational support for this library.

Hints

Credits

Thanks to all the contributors of this project, and to Scott Hanselman for Exploring the .NET open source hybrid ORM library RepoDB.

And also, thanks to these awesome OSS projects.

License

Apache-2.0 - Copyright © 2019 - Michael Camara Pendon

repodb's People

Contributors

akilaetribe avatar alexn-tinwell avatar anpin avatar bgrainger avatar bieleckiltd avatar cwaldron avatar davidrot avatar fake-fur avatar fredliex avatar geewee avatar inoa-pmattos avatar kjnckelly avatar mertkokusen avatar mikependon avatar ngardon avatar nickdodd79 avatar orthoxerox avatar ovidr avatar rdagumampan avatar rodolfoferreira avatar say25 avatar sellig avatar sergergood avatar simoncropp avatar spaceogre avatar stefandevo avatar swoorup avatar xperiandri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

repodb's Issues

Support a raw SQL Query Statement Array Parameters

As requested by one of our Senior Developer, please support the raw SQL Statement array parameters.

Please see below.

 var param = new [] { 1, 2, 3, 4 };
 using (var connection = new SqlConnection(connectionString))
 {
      connection.ExecuteQuery<Person>("SELECT * FROM [dbo].[Person] WHERE Id IN (@Ids);", new { Ids = param });
 }

Parameters are still created even if property was marked with Ignore

When query is executed, the parameter builder still process properties that are marked to Ignore. In this case DateInsertedUtc must be ignored when building the parameter bucket. If the property is not initialized, it will set to default value.

[Map("[dbo].[Customer]")]
public class Customer : DataEntity
{
	[Attributes.Ignore(Command.Insert | Command.Update | Command.Merge | Command.InlineUpdate), Primary(true), Map("Id")]
	public int Id { get; set; }

	public Guid GlobalId { get; set; }

	public string FirstName { get; set; }

	public string MiddleName { get; set; }

	public string LastName { get; set; }

	public string Address { get; set; }

	public string Email { get; set; }

	public bool IsActive { get; set; }

	public DateTime LastUpdatedUtc { get; set; }

	[Attributes.Ignore(Command.Update | Command.Insert)]
	public DateTime DateInsertedUtc { get; set; }

	public string LastUserId { get; set; }
}
[Test]
public void TestInsert()
{
	//arrange
	var repository = new DbRepository<SqlConnection>(RepoDbConnectionString, 0);

	var fixtureData = new Customer
	{
		GlobalId = Guid.NewGuid(),
		FirstName = "Juan",
		LastName = "de la Cruz",
		MiddleName = "Pinto",
		Address = "San Lorenzo, Makati, Philippines 4225",
		IsActive = true,
		Email = "[email protected]",
		//DateInsertedUtc = DateTime.UtcNow, COMMENTED FOR TESTING
		LastUpdatedUtc = DateTime.UtcNow,
		LastUserId = Environment.UserName
	};

	//act
	repository.Insert(fixtureData);

	//assert
	var customer = repository.Query<Customer>().FirstOrDefault();
	customer.ShouldNotBeNull();
	customer.Id.ShouldNotBe(0);
	customer.GlobalId.ShouldBe(fixtureData.GlobalId);
	customer.FirstName.ShouldBe(fixtureData.FirstName);
	customer.LastName.ShouldBe(fixtureData.LastName);
	customer.MiddleName.ShouldBe(fixtureData.MiddleName);
	customer.Address.ShouldBe(fixtureData.Address);
	customer.Email.ShouldBe(fixtureData.Email);
	customer.IsActive.ShouldBe(fixtureData.IsActive);
	customer.DateInsertedUtc.ShouldBe(fixtureData.DateInsertedUtc);
	customer.LastUpdatedUtc.ShouldBe(fixtureData.LastUpdatedUtc);
	customer.LastUserId.ShouldBe(fixtureData.FirstName);
}

System.Data.SqlTypes.SqlTypeException : SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource1 completion, Int32 startRpc, Int32 startParam) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at RepoDb.Extensions.DbConnectionExtension.ExecuteScalar(IDbConnection connection, String commandText, Object param, Nullable1 commandType, Nullable1 commandTimeout, IDbTransaction transaction, ITrace trace) in C:\play\RepoDb\RepoDb\Extensions\DbConnectionExtension.cs:line 498
at RepoDb.DbRepository1.ExecuteScalar(String commandText, Object param, Nullable1 commandType, Nullable1 commandTimeout, IDbTransaction transaction) in C:\play\RepoDb\RepoDb\DbRepository.cs:line 2058 at RepoDb.DbRepository1.Insert[TEntity](TEntity entity, IDbTransaction transaction) in C:\play\RepoDb\RepoDb\DbRepository.cs:line 1094
at RepoDb.IntegrationTests.TestBasicCrud.TestInsert() in C:\play\RepoDb\RepoDb.IntegrationTests\TestBasicCrud.cs:line 38

Consider creating .NET Type to DBType mapping

When parameters are created we rely on the ADO.NET facility to derive the right db types. In cases the type is not supported, we can use TypeMap to support it. This works so far but maybe not the best approach for the ff reasons:

  • we may get inconsistent precision like when in DB its real but in model its double
  • there might be overhead given we use variant types
  • we may lose data like in char and nvarchar

Guid Primary Key is not being set if the Class Name is a Mapped Class

[Map("DatabaseCheckActivity")]
public class DatabaseCheckActivityAllocation
{
public Guid Id { get; set; }
public long LargePageAllocationsInKb { get; set; }
public long LockedPageAllocationsInKb { get; set; }
public long TotalVirtualAddressSpaceInKb { get; set; }
public long VirtualAddressSpaceReservedInKb { get; set; }
public long VirtualAddressSpaceCommittedInKb { get; set; }
public long VirtualAddressSpaceAvailableInKb { get; set; }
}

var allocation = _serviceMonitorRepository
.Query<WebModels.DatabaseCheckActivityAllocation>(new { Id = databaseCheckId })
.Select(databaseCheckActivity => Convert(databaseCheckActivity))
.FirstOrDefault();


Result: The allocation.Id is an Empty Guid

Support RepoDb.Field.From<TEntity> Expression

To support a simplified expression-based coding when calling certain operations the required a Field, kindly support the following.

RepoDb.Field.From<Person>(p => p.Name);

Usable at InlineMerge, Merge, etc operations

BatchQuery ignores property mapping

Using Query works fine, but for BatchQuery the MapAttribute is ignored.

Here is a simple example:

CREATE TABLE [dbo].[Test](
	[Id] [int] NOT NULL,
	[WrongName] [nvarchar](50) NOT NULL
) ON [PRIMARY]
GO
public class Test : DataEntity {
	public int Id {get;set;}
	[Map("WrongName")]
	public string RightName {get;set;}
}

using (var con = new SqlConnection(ConnectionString).EnsureOpen())
{
  con.Query<Test>(); // works fine
  
  // SqlException: Invalid column name 'RightName'.
  con.BatchQuery<Test>(0,2,OrderField.Parse(new {Id = Order.Descending })); 
}

The generated SQL is:

WITH CTE
AS (  
    SELECT ROW_NUMBER() OVER (
    ORDER BY [Id] DESC
    ) AS [RowNumber],
    [Id],
    [WrongName] -- correct
  FROM [Test]
  )
SELECT [Id], [RightName] -- not correct
FROM CTE
WHERE ( [RowNumber] BETWEEN 1 AND 2 )
ORDER BY [Id] DESC

The Problem is in SqlDbStatementBuilder.cs, line 61 which has .FieldsFrom(fields), the problem stops occuring when the line is replaced with .FieldsFrom(Command.BatchQuery).

I'd send a PR, but with the lag of tests and my lack of deeper understanding I neither know if this will introduce further bugs nor if it has performance penalties.

Support BLOB data types

Test shows the BLOB types are currently not support. The IL generator used to fast-read the datareader are emitting empty byte arrays for data columns that are Image, VarBinary or VarBinaryMax. Insert works fine but repository cannot read the byte arrays back.

Integration tests available here https://github.com/rdagumampan/RepoDb

[Test]
public void BlobTypeMap()
{
	//arrange
	var resourceName = "RepoDb.IntegrationTests.Setup.hello-world.png";
	var baseByteData = ExtractResource(resourceName);
	
	var fixtureData = new Models.TypeMapBlob
	{
		image_column = baseByteData,
		varbinary_column = baseByteData,
		varbinarymax_column = baseByteData
	};

	//act
	var sut = new DbRepository<SqlConnection>(Constants.TestDatabase);
	var returnedId = sut.Insert(fixtureData);

	//TODO: support guid primary key

	//assert
	var saveData = sut.Query<Models.TypeMapBlob>(top: 1).FirstOrDefault();
	saveData.ShouldNotBeNull();
	saveData.image_column.SequenceEqual(fixtureData.image_column).ShouldBe(true);
	saveData.varbinary_column.SequenceEqual(fixtureData.varbinary_column).ShouldBe(true);
	saveData.varbinarymax_column.SequenceEqual(fixtureData.varbinarymax_column).ShouldBe(true);
}
System.EntryPointNotFoundException : Entry point was not found.
   at System.Collections.Generic.IEnumerable`1.GetEnumerator()
   at System.Linq.Enumerable.SequenceEqual[TSource](IEnumerable`1 first, IEnumerable`1 second, IEqualityComparer`1 comparer)
   at RepoDb.IntegrationTests.TestBlobDataTypeMapping.BlobTypeMap() in C:\play\_forked\RepoDb\RepoDb\RepoDb.Tests\RepoDb.IntegrationTests\TestBlobDataTypeMapping.cs:line 72

Query is defaulting to TOP instead of using PK

When executing repository.Query, the resulting query is using TOP instead of using the PK of the table.

These two approach returns 2 different rows when we expect the same row.

var repository = new DbRepository<SqlConnection>(Constants.TestDatabase);
var customer = repository.Query<Customer>(1).FirstOrDefault();

var customer = repository.Query<Customer>(new { Id = 1 }).FirstOrDefault();

Performance: Compile the Expression Trees

Frans:

be worth looking into compiling a generated expression tree which accepts a datareader and results in a new, materialized poco instance


:)

You can use the results, it was a release build run. As your set fetch pipeline is a bit behind the pack, it might be worth looking into compiling a generated expression tree which accepts a datareader and results in a new, materialized poco instance. So generate something like:
r=>new p() { Field1=r.GetInt32(0), Field2 = r.GetString(1), ... , Fieldn=r.GetInt32(n-1);} where the type of the get method called of course depends on the type of the field at ordinal n. For fields that are nullable, you have to check for nulls of course, so you then have to generate something like Field1 = r.IsDBNull(0) ? null : r.GetInt32(0), it's up to you of course to determine which fields are null and whether you need to do actual testing.

Linq to DB (and I suspect tortuga does too) check the resultset's schema table prior to consuming the resultset and based on that skip null checks for some fields which are actually nullable (if the meta-data says no nulls are expected, you could skip the check). This is the reason Linq to DB is ahead of the pack (and I suspect tortuga is too, there's no other way to get this close to the handwritten materializer in set fetches). It's unfortunately not reliable in many cases, so for this benchmark it might work, in general cases in might not, hence I skipped implementing it in llblgen pro (and therefore have to settle for a spot in the middle ;))

The generated expression tree represents a LambdaExpression, which is then compiled using its Compile() method and of course cached so you don't compile it again with the next query.

Merge failed when PK column was not passed in the dataset

Merge failed when PK column was not passed in the dataset. It used to be working but have now failed after the latest fixes in Master.

Tests available in my fork https://github.com/rdagumampan/RepoDb.

Open the

[Test]
public void TestMergeInsert()
{
	//arrange
	var repository = new DbRepository<SqlConnection>(Constants.TestDatabase);

	var fixtureData = new Customer
	{
		GlobalId = Guid.NewGuid(),
		FirstName = "Juan-MERGED",
		LastName = "de la Cruz-MERGED",
		MiddleName = "Pinto-MERGED",
		Address = "San Lorenzo, Makati, Philippines 4225-MERGED",
		IsActive = true,
		Email = "[email protected]",
		LastUpdatedUtc = DateTime.UtcNow,
		LastUserId = Environment.UserName
	};

	//act
	repository.Merge(fixtureData);

	//assert
	var customer = repository.Query<Customer>(new { fixtureData.GlobalId }).FirstOrDefault();
	customer.ShouldNotBeNull();
	customer.Id.ShouldNotBe(0);
	customer.GlobalId.ShouldBe(fixtureData.GlobalId);
	customer.FirstName.ShouldBe(fixtureData.FirstName);
	customer.LastName.ShouldBe(fixtureData.LastName);
	customer.MiddleName.ShouldBe(fixtureData.MiddleName);
	customer.Address.ShouldBe(fixtureData.Address);
	customer.Email.ShouldBe(fixtureData.Email);
	customer.IsActive.ShouldBe(fixtureData.IsActive);
	customer.LastUpdatedUtc.ShouldBe(fixtureData.LastUpdatedUtc);
	customer.LastUserId.ShouldBe(fixtureData.LastUserId);
}
System.Data.SqlClient.SqlException : Must declare the scalar variable "@Id".
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

Exceptions occur running in Parallel

An exception is being thrown if running multiple operations in parallel using Task.Factory.StartNew.

at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at RepoDb.PropertyCache.Get[TEntity](Command command) at RepoDb.PropertyMapNameCache.Get[TEntity](Command command) at RepoDb.QueryBuilder`1.Fields(Command command) at RepoDb.SqlDbStatementBuilder.CreateQuery[TEntity](QueryBuilder`1 queryBuilder, QueryGroup where, Nullable`1 top, IEnumerable`1 orderBy) at RepoDb.DbRepository`1.Query[TEntity](QueryGroup where, IDbTransaction transaction, Nullable`1 top, IEnumerable`1 orderBy, String cacheKey) at RepoDb.DbRepository`1.Query[TEntity](Object where, IDbTransaction transaction, Nullable`1 top, IEnumerable`1 orderBy, String cacheKey) at LocalVisitLogHistoricalDataProcessor.Program.ProcessClassifications() in C:\Users\MIPEN\Desktop\LocalVisitLogHistoricalDataProcessor\LocalVisitLogHistoricalDataProcessor\Program.cs:line 119 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute()

Querying a NULL Values

An exception is thrown.

Additional information: Object cannot be cast from DBNull to other types.

IL Reflection Emitting Problem.

Calls to Repository.Query resulted to an Intermittent Exception

Intermittent: Exception below is being thrown when repository.Query is called.

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at RepoDb.Reflection.TypeCache.Get(TypeTypes type) at RepoDb.Reflection.ReflectionFactory.CreateTypes(TypeTypes[] types) at RepoDb.Reflection.TypeArrayCache.Get(TypeTypes[] type) at RepoDb.Reflection.DelegateFactory.GetDataReaderToDataEntityDelegate[TEntity](DbDataReader reader) at RepoDb.Reflection.DelegateCache.GetDataReaderToDataEntityDelegate[TEntity](DbDataReader reader) at RepoDb.Reflection.DataReaderConverter.ToEnumerable[TEntity](DbDataReader reader) at RepoDb.Extensions.DbConnectionExtension.ExecuteQuery[TEntity](IDbConnection connection, String commandText, Object param, Nullable`1 commandType, Nullable`1 commandTimeout, IDbTransaction transaction, ITrace trace) at RepoDb.DbRepository`1.ExecuteQuery[TEntity](String commandText, Object param, Nullable`1 commandType, Nullable`1 commandTimeout, IDbTransaction transaction) at RepoDb.DbRepository`1.Query[TEntity](QueryGroup where, IDbTransaction transaction, Nullable`1 top, IEnumerable`1 orderBy, String cacheKey) at RepoDb.DbRepository`1.Query[TEntity](Object where, IDbTransaction transaction, Nullable`1 top, IEnumerable`1 orderBy, String cacheKey) at LocalVisitLogHistoricalDataProcessor.Program.ProcessClassifications() in C:\Users\MIPEN\Desktop\LocalVisitLogHistoricalDataProcessor\LocalVisitLogHistoricalDataProcessor\Program.cs:line 111 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.