Giter Club home page Giter Club logo

models's Introduction

Nuget

This is a very small library of some attributes, enums, and interfaces that I use with Dapper.Repository, Dapper.CX and ModelSync. I extracted them to a standalone library so that model class projects can use these while keeping a minimal dependency footprint. For example, I don't want model projects to have a Dapper dependency.

Nuget package: AO.Models

Reference

Wiki

Please see the wiki for info about my SqlBuilder static class and other helpers here.

Prior Versions

There's an earlier version of this package called AO.DbSchema.Attributes.

models's People

Contributors

adamfoneil avatar

Watchers

 avatar  avatar

models's Issues

consider removing IValidate async method

the issue is if I have validation code at the model level that does database queries, then I'm tempted/required to add dependencies for that -- Dapper.CX, QX, or whatever. Dependencies like that muddy what model classes should do. See IValidate.ValidateAsync

There's no problem with the sync method so long as everyone understands it's not intended for database queries. Validation logic will really need to be in app layer.

rename "Model" as "Entity"

In this project, I've used the word "model" to mean "entity," but now at long last I think "entity" is clearer.
So, for this issue, I'd like to rename all assets that refer to "models" as "entities" -- along with all dependent packages. These include:

  • Dapper.Repository
  • ModelSync (will become EntitySync)

add attribute to prevent auto FK inference

I created a property called CustomerId in another project. This got made into an FK because it fits a naming rule that infers FKs when it's a combo of a table + identity property. I need to be able to make exceptions in this case to suppress the inferred FK. This is here the inference happens in ModelSync.

v1.5 - model services/biz layer features

The idea here is to move interfaces (triggers, validation, get related, stamping, tenant isolation, etc) to a "business layer" object or "service" object in order to declutter model classes, allow simpler reuse (avoiding linked source stuff I do today to segregate IDbConnection methods), and provide an extension point for advanced functionality like concurrency and change tracking.

"unindent" generated SQL

One annoyance I've had with Dapper.CX is that the generated crud SQL statements have a big uneven left indent because of how I use verbatim strings. I could remove the verbatim string (and craft the indents manually), but I don't want to. I'd like to have an Unindent method that left justifies multi-line strings like this

image

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.