Code Monkey home page Code Monkey logo

Comments (14)

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024 1

Thanks a lot for the help

from couchdb-net.

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024

Ouch, will fix it now!

from couchdb-net.

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024

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.

panoukos41 avatar panoukos41 commented on August 23, 2024

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.

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024

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.

panoukos41 avatar panoukos41 commented on August 23, 2024

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.

panoukos41 avatar panoukos41 commented on August 23, 2024

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.

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024

Do you mind giving it a try? Just change the json attribute in CouchDocument

EDIT: I like the $

from couchdb-net.

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024

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.

panoukos41 avatar panoukos41 commented on August 23, 2024

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.

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024

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.

panoukos41 avatar panoukos41 commented on August 23, 2024

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.

matteobortolazzo avatar matteobortolazzo commented on August 23, 2024

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.

panoukos41 avatar panoukos41 commented on August 23, 2024

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)

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.