Skip to content

Instantly share code, notes, and snippets.

View mbdavid's full-sized avatar

Mauricio David mbdavid

  • Porto Alegre / Brazil
View GitHub Profile
@mbdavid
mbdavid / Reflection.Unity.cs
Last active December 21, 2017 22:36
LiteDB Unity changes
// REPLACE "Reflection.Expression.cs"
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
@mbdavid
mbdavid / CustomerPerformance.cs
Created December 16, 2017 10:00
Test Insert Performance in LiteDB
using LiteDB;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace LiteDB.Demo
@mbdavid
mbdavid / QueryAscDesc.cs
Created September 3, 2017 22:10
Performance test for LiteDB query between asc/desc
using LiteDB;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
namespace TestNet40
{
@mbdavid
mbdavid / Find.cs
Created December 29, 2016 23:56
Catch in IEnumerable Yield
// why this do not work?
public IEnumerable<T> Find(Query query)
{
while(true)
{
try
{
// FindWrap returns IEnumerable using yield return
return FindWrap(query);
@mbdavid
mbdavid / Transaction.cs
Last active May 3, 2020 19:39
LiteDB v3 Transaction Syntax Options
// 1
db.BeginTrans();
// ... do stuffs
db.Commit(); // or db.Rollback();
// 2
using(var t = db.BeginTrans()) // where t is LiteTransaction
{
// ... do stuffs