GithubHelp home page GithubHelp logo

abstractleap / dashing Goto Github PK

View Code? Open in Web Editor NEW
48.0 6.0 7.0 14.91 MB

Dashing is a simple to use mini ORM built on top of Dapper

License: MIT License

C# 99.89% PowerShell 0.08% Batchfile 0.03%
dapper orm sql ado-net

dashing's People

Contributors

abstractjerz avatar conaugh avatar georgeseeger avatar jamesholwell avatar markjerz avatar vanillajonathan 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dashing's Issues

Improper exception when changing string columns to Timespan

Or vice versa.

When changing a column from a string to a Timespan, or Timespan to string, an exception of type

Caught unhandled InvalidOperationException
An OppositeColumn only exists on a OneToOne relationship

is thrown. Should probably be something else.

DbProviderFactories should be supported in app.config file for dbm.exe

I wasn't able to register the Mysql Data Provider whose config had been updated in the app.config of my project registered in PathToDll. Instead, I had to copy it to the DbProviderFactories section in the machine.config.

Would prefer to have a .config file that is used by dbm without a dependency to machine.config.

Generics in where clause not working as expected

I have several base entities, all with similar stuctures, which all inherit from an interface. When querying a parent object, the interface type is used rather than the concrete type.

e.g.
ApplyTagsSearch<TEntity, TTag>(this ISelectQuery<TEntity> query) where TEntity : class, IHasTags<TTag, TEntity>, new() where TTag : IIAmTag<TEntity> { query.Where(o => o.Tags.Any(ot => tags.Contains(ot.Tag.TagId))); }
tags is an int[] of tag IDs

The exception thrown by Dashing is "Type IIAmTag`1 is not mapped"

Support .Any() on local enumerables within query

Currently, .Any() is supported on enumerables within the query - e.g. .Where(customer => customer.Orders.Any(o => o == order)). It would be useful to be able to use .Any() on enumerables which have been declared in the calling scope - e.g. .Where(customer => ordersOutsideQuery.Any(o => o.Customer.Name.StartsWith(customer.Name)))

InsertOrUpdate doesn't work for unchanged entities

In InMemoryEngine the Save will return the number of entities that already exist and updates them where necessary. In SQLEngine the Save will return the number of entities to be updated. In the case where the item exists but doesn't need to be updated InMemoryEngine returns 1 and SQLEngine returns 0. The 0 returned from SQLEngine then prompts the Insert.

Save() return values:

                 | Exists no change | Exists change needed | Does not exist
InMemoryEngine   |       1          |           1          |         0
SQLEngine        |       0          |           1          |         0

Save() != Exists() in SQLEngine is there a better method to check whether something already exists in InsertOrUpdate() or should Save() change so that is is synonymous with exists.

Either way InMemoryEngine and SQLEngine should give the same results.

Entities without primary keys

If there is one or more entities without a primary key then the rest of the entities break on tracking:

Initialization method Dashing.Repository.Tests.CRUDTests.Test_Initialize threw exception. System.InvalidCastException: System.InvalidCastException: Unable to cast object of type 'Dashing.Model.Product' to type 'Dashing.CodeGeneration.ITrackedEntity'..

To reproduce add this class to TestDomain:

public class NoPrimary {
    public virtual string Name { get; set; }
}

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.