EdgeJS and Entity Framework

7

Next, I'm learning NodeJS and I'm thrilled with it, but I found my first stone in the path, accessing a relational database using some ORM (precisely to access PostgreSQL).

At first I thought about using SequelizeJS , I even found it well documented and promising, but I found his query a bit complex.

A simple condition like this:

title LIKE 'Boat%' OR description LIKE '%boat%'

turns into:

$or: [
    {
      title: {
        $like: 'Boat%'
      }
    },
    {
      description: {
        $like: '%boat%'
      }
    }
  ]
}

So I decided to go for the alternative, which would be EdgeJS . Then I would create a CLR Blibioteca in C # using Repository Pattern that accesses data with the Entity Framework, where all methods would have a signature similar to the following:

async Task<object> MethodName(object input);

And by NodeJS, would only create a module that would serve as a proxy for this Library.

As a .NET developer, using the CLR Library seems easier for me to maintain, but I would like to have a broader view of what the pros and cons of this strategy would be. Is it a good choice? or am I showing myself a lazy programmer?

    
asked by anonymous 03.08.2015 / 13:31

1 answer

1

I would like to take a broader view of what the pros and cons of this strategy would be. Is it a good option? Or am I showing myself a lazy programmer?

So far this answer is not.

Explain: The interface that Edge.js does with .NET code is still very small. For use with the Entity Framework, you need not only embed the .NET code in the Node application, but also initialize the data context, apply Migrations , create the classes that will be part of the context, etc.

I do not see portability as being very practical at the moment, but I can change my mind, since Edge.js is a very recent technology and interface with the rest of .NET Frameworks is not exactly consolidated.

    
13.09.2015 / 01:33