Comments (14)
Thanks a lot for the help
from couchdb-net.
Ouch, will fix it now!
from couchdb-net.
Can you try the latest dev branch? For some reason, I cannot install CouchDB. Since they use the underscore, I thought it was valid
from couchdb-net.
I will try It now but should be fine, you can put whatever you want but _
, yea that's what I thought too :P
from couchdb-net.
Maybe I should call it database_discriminator
?
EDIT: Well EF Core calls the column discriminator, so I doubt people will frequently need to use a field called discriminator
.
from couchdb-net.
I tried it and it works. Hmmm, you could or maybe start it with .
or $
? I think $
is used for special cases in general since it sets schema on json from what I have seen
from couchdb-net.
Also unrelated but do you think GetDatabase<TSource>()
could be GetDatabase<TSource>(string discriminator? = null)
so that you don't always provide the database name?
from couchdb-net.
Do you mind giving it a try? Just change the json attribute in CouchDocument
EDIT: I like the $
from couchdb-net.
That's a choice I made because I think that if you have 2 types of documents in 1 DB, the DB name should not be one of the 2 types. Right?
from couchdb-net.
Okay, none of .
and $
work when I try to search :/
Yea that seems better I was using [JsonObject]
attribute better to leave it this way so that it is more explicit
from couchdb-net.
Wow, I forgot JsonObject
is supported by the library. I thought it was something you were using manually ahah too many features at this point... So you prefer to have GetDatabase<TSource>(string discriminator? = null)
right?
from couchdb-net.
I don't know now that I gave it more thought it might start to become too much magic :P because if you forget JsonObject
you target another DB, at my patched up hack it was convenient since I had my own CouchDocument
type and used JsonObject
there. Now I feel a bit confused if it would help or not XD
For the discriminator part, I think database_discriminator
or db_discriminator
should be okay since the user won't really see it or use it himself and it makes sense as a name
from couchdb-net.
I opted for split_discriminator
.
About the name, I tried GetDatabase<TSource>(string discriminator? = null)
but then, if anyone tries to use that overload it will actually call GetDatabase<TSource>(string database, string discriminator? = null)
.
So please try last time and I release the fix
from couchdb-net.
Okay, it works just fine, yea that actually makes sense that it's better this way in the end :D
from couchdb-net.
Related Issues (20)
- Add indexes in OnDatabaseCreating method HOT 2
- Non-nullable Tables in Context HOT 4
- Exception when running a query. HOT 2
- CouchDB.NET.DependencyInjection HOT 1
- Support retrieving available revisions of a document HOT 9
- Bug with querying overlaping string arrays HOT 6
- Use design documents with CouchDB.Net HOT 1
- Database Splitting + FirstOrDefault() + CouchContext.MyDatabase.Where doesn't apply predicate
- Database Splitting + Convert --> Crash : Exception thrown: Call failed with status code 400 (Bad Request) HOT 2
- Database Splitting : create selector on type (SplitDiscriminator)
- Support raw/un-typed documents? HOT 1
- Replication : add "create_target" field HOT 1
- "Cannot add or update a document without an ID." System.InvalidOperationException HOT 2
- Performance implications / Gotchas ? HOT 1
- Add Replication state HOT 2
- Change feed not including attachments as per specification HOT 1
- How to deserialize inherited documents? HOT 3
- Add Partitioned Database support
- Unexpected behaviour of GetContinuousChangesAsync HOT 3
- Please release v3.5.0 NuGet HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchdb-net.