Coder Social home page Coder Social logo

Comments (4)

dj-nitehawk avatar dj-nitehawk commented on May 28, 2024

can you tell me what the property looks like in your code that breaks the function?
for ex:
public SomeType PropName { get; set; }

in other words, how to replicate the issue so i can write a test for it?

from mongodb.entities.

 avatar commented on May 28, 2024

namespace A.B.C
{
    namespace Record
    {
        public class D : MongoDB.Entities.Entity
        {
            public long F { get; set; } // bad: F(
            public string G { get; set; } // ok: G
            public DateTime H { get; set; } // bad: H(
        }
    }
}
            db.Index<D>()
              .Key( x => x.F, KeyType.Descending )
              .Create();

            db.Index<D>()
              .Key( x => x.H, KeyType.Descending )
              .Create();

            db.Index<D>()
              .Key( x => x.G, KeyType.Descending )
              .Create();

It's confusing because this block of codes made it wrong in my private project but not happening in 'Examples' project.

image

You can see that it's expression shown as 'x => Convert(x.F)' in above screenshot.

from mongodb.entities.

dj-nitehawk avatar dj-nitehawk commented on May 28, 2024

i can't produce the error with the latest v8.4.1

try this in a new console app and report back the result please?

using MongoDB.Entities;
using System;

namespace A.B.C
{
    namespace Record
    {
        public class D : Entity
        {
            public long F { get; set; }
            public string G { get; set; }
            public DateTime H { get; set; }
        }

        public static class Program
        {
            public static void Main()
            {
                new DB("test-fullpath");

                DB.Index<D>()
                  .Key(x => x.F, KeyType.Descending)
                  .Create();

                DB.Index<D>()
                  .Key(x => x.H, KeyType.Descending)
                  .Create();

                var p1 = Prop.Dotted<D>(x => x.F);
                var p2 = Prop.Dotted<D>(x => x.H);

                Console.WriteLine("prop1 name is: " + p1); // F
                Console.WriteLine("prop2 name is: " + p2); // H
                Console.Read();
            }
        }
    }
}

are you testing with your own fork? it could be something wrong in your fork most likely. as everything seems to be working fine with mine.

from mongodb.entities.

dj-nitehawk avatar dj-nitehawk commented on May 28, 2024

@gshockim good news... even though i couldn't replicate the issue, i was able to come up with regexes (with help from stackoverflow) to cater for all edge cases. have a look at the Prop class here.

from mongodb.entities.

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.