question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find .InitOneToMany method for extended classes from :Entity

See original GitHub issue

Hello,

I’ve installed MongoDB.Entities with Nuget.

DB.InitAsync is working…I can create flat documents and I can see them in Mongo database.

However, when I try to create a Many<> relationship I can’t find .Hello,

I’ve installed MongoDB.Entities with Nuget.

DB.InitAsync is working…I can create flat documents and I can see into Mongo DB.

However, when I try to create a Many<> relationship I can’t find .InitOneToMany method in my constructor.

I understand that this is an extension method, so all inherited from :Entity or :IEntity should be able to use this method.

see my code snipped below:

 public class Ship: MongoDB.Entities.Entity {
        public string Name { get; set; }

        public Ship() {
            
        }
    }

    public class Station : MongoDB.Entities.Entity {
        public string Name { get; set; }

        public MongoDB.Entities.Many<Ship> Ships { get; set; }

        public Station() {
//at this point, there is no .InitOneToMany
        }
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
denileo82commented, Sep 9, 2021

My bad…I had another namespace (package) starting with MongoDB

I’ve removed it or renamed it so it is working now.

congrats for your project, awesome 😃

0reactions
denileo82commented, Sep 9, 2021

solved, see above 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to extend entity class?
I'm using Entity Framework and Mysql. And I have Entity classes for each tables. But I do not know how to extend fields...
Read more >
c# extending a entity framework class
I have a Entity Framework class that was derived from the database layout. I was wondering if there was any problems by extending...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found