Coder Social home page Coder Social logo

CultureInfo support about norm HOT 11 CLOSED

JornWildt avatar JornWildt commented on June 30, 2024
CultureInfo support

from norm.

Comments (11)

petriashev avatar petriashev commented on June 30, 2024

I've added similar issue: http://github.com/atheken/NoRM/issues#issue/19

from norm.

JornWildt avatar JornWildt commented on June 30, 2024

And my branch contains a solution, but so far Andrew hasn't merged it.

from norm.

petriashev avatar petriashev commented on June 30, 2024

Yes, I started to do the same thing! )))
Andrew, what about JornWildt solution?

from norm.

atheken avatar atheken commented on June 30, 2024

I'm going to cherry-pick Jorn's TypeConverter solution, I just can't include his circular reference handling, as it would screw up query semantics for each document in a collection.

from norm.

JornWildt avatar JornWildt commented on June 30, 2024

Okay, thanks. Can you explain why the circular reference stuff is wrong? Maybe I can fix it?

from norm.

JornWildt avatar JornWildt commented on June 30, 2024

Tak a look at the changelists I have submitted - they are rather explicit about which features they add.

from norm.

atheken avatar atheken commented on June 30, 2024

Jorn, here's one example:

class Product{
string Name{get;set;}
Supplier ProductSupplier {get;set;}
}
class Supplier{
string Name {get;set;}
Product BestProduct {get;set;}
}

P1 = new Product{}
S1 = new Supplier{}
P1.Name = "ACME"
P1.ProductSupplier = S1;
S1.BestProduct = P1;

coll = db.GetCollection()
coll.Insert(P1);
results = coll.AsQueryable().Where(y=>y.ProductSupplier.BestProduct.Name == "ACME");

since "BestProduct" is just a reference to P1, "Name" will not resolve correctly on the DB side, and we won't get correct results back.

I understand this is a "contrived" example, but this is a simplified version of circular references.

The folks at 10Gen are very specific that MongoDB is a DocumentDB, not an ObjectDB, and I think the fact that it doesn't do internal dereferencing is one of the major differences.

from norm.

atheken avatar atheken commented on June 30, 2024

By the way, I have merged in the TypeConverter code, test and all, Thank you.

from norm.

JornWildt avatar JornWildt commented on June 30, 2024

You are right, NoRM/MongoDB won't be able to query correctly with circular references, I see that. But neither does it work today - NoRM crashes with a stack overflow. Adding circular references will enable some usefull scenarioes that NoRM cannot handle today - but it won't be complete with, for instance, querying as you say. But in many (my) cases that may not be an issue.

from norm.

atheken avatar atheken commented on June 30, 2024

I think that the safest thing to do is disable the behavior by default, and throw an exception when the circular reference is detected, but allow for the user to opt-in to serializing them.

from norm.

JornWildt avatar JornWildt commented on June 30, 2024

That is indeed very fine with me.

from norm.

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.