Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear confusion on readme #324

Open
herbertmilhomme opened this issue Apr 28, 2018 · 0 comments
Open

Clear confusion on readme #324

herbertmilhomme opened this issue Apr 28, 2018 · 0 comments

Comments

@herbertmilhomme
Copy link

The readme makes an introduction or lightly touches on the getting started with massive. However, it begins with

Code Please

Let's say we have a table named "Products". You create a class like this:

public class Products:DynamicModel {
	//you don't have to specify the connection - Massive will use the first one it finds in your config
	public Products():base("northwind", "products","productid") {}
}

You could also just instantiate it inline, as needed:

var tbl = new DynamicModel("northwind", tableName:"Products", primaryKeyField:"ProductID");

Or ignore the object hierarchy altogether:

Massive.DB.Current.Query(...);

But only towards the end, at the bottom, does it ever mention:

Factory Constructor

One thing that can be useful is to use Massive to just run a quick query. You can do that now by using "Open()" which is a static builder on DynamicModel:

var db = Massive.DynamicModel.Open("myConnectionStringName");

You can execute whatever you like at that point.

As if it were an "Oh yeah! We forgot to mention..." My suggestion is to incorporate this sooner or closer to the top, as part of the intro. Possibly if they are not the same thing (which, why wouldnt they be?... idk, it's separated and placed towards the bottom for who knows what reason) provide use-examples to clarify it's design or best case scenario. To me, this var db = ... is the norm, and what i normally look for when messing around with database. But then again, that's why i'm here, and why this tool is so useful. It's because it caters to those who perform inline sql, on a per use basis. Why not give us that little bone at the start of the introductions, rather than towards the end of that major tl;dr?

Since we're all trying to find ways to streamline productivity, it would be a disappoint for me to have missed that part hidden, even way after insert and update. I could've potentially been stuck rewriting lines and lines of code, it werent abundantly clear that hey, maybe i can use something i'm already familiar with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant