Giter Club home page Giter Club logo

iayos.dappercrud's People

Contributors

daleholborow avatar

Watchers

 avatar  avatar

iayos.dappercrud's Issues

write generic recursive tree query

something like:

class SimpleTreeNode { childidfield, parentidfield, primaryid }

class Staff { childidfield, parentidfield, primaryid }

// return a simple tree of
var simpleTreeNodes = db.GetSimpleTree(x => x.childIdfield, x => x.parentIdfield);

var staff = db.GetTree(x => x.childidfield, x => x.parentidfield, params[] x => x.otherdynamicfieldstoselect // by default, select *);

Add ability to do concurrency check on UPDATE by comparing entity against known interface

E.g. allow user to store static reference to some interface that defines timestamped records, e.g.
"interface ITimeStamped { }", or better yet, a new attribute that can be added to a timestamp column for concurrency checks, e.g.

then when performing an update, scan obejct for property with ConcurrencyCheckAttrribute, then if exists, append "and where RowVersion = @RowVersion", and throw error if no row updated (ie. we know row was modified in the meantime)

add typesafe dynamic multiparam selects (along the lines of the id+name pair idea or selectxSingleXWhereY)

Had this idea to add dynamic multiparam classes, something like:

public class IaYoSMulti<TField1, TField2>
{
public TField1 Field1 {get;set;}
public TField2 Field2 {get;set;}
}

and

public class IaYoSMulti<TField1, TField2, TField3, etc>
{
public TField1 Field1 {get;set;}
public TField2 Field2 {get;set;}
public TField3 Field3 {get;set;}
etc
}

and a select that switches the WhereIn logic like:

db.GetFieldsWhereIn<TableToSelectFrom, int, string, DateTime>(
table => table.Id, idsToSelectFromList, table => table.Id, table => table.FirstName, table => table.DateOfBirth, etc
);

and extension method would look something like:

public static IaYoSMulti<T1, T2, T3> GetFieldsWhereIn<TargetTable, T1, T2, T3>(this IDbConnection db, params[] Func<TargetTable, obj> fieldsToSelect) {
--- do the select of the columns, add them in order to the IaYoSMulti<> selector
}

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.