Does anybody know if there is any LINQ methodology for digital twin SQ - azure-digital-twins

Does anybody know if there is any LINQ methodology for digital twin SQL - just like LINQ to sql or LInQ to object etc?
Thanks!

At this moment, there isn't. It would make a good feature request

Related

Getting SQL queries generated with Entity Framework Plus?

I am enjoying the features of Entity Framework Plus over Entity Framework 6 since a few hours, and especially its IncludeFilter.
With regular Entity Framework 6, I was able to simply call ToString() on an IQueryable to easily get the SELECT query that will be actually processed on DB Server.
But with EF+, when I apply an IncludeFilter, I only get :
Z.EntityFramework.Plus.QueryIncludeFilterParentQueryable`1[MyRecord]
Because ToString() seems to not be overloaded the same way in EF+.
Is there a way to get SQL generated for "IncludeFilter" queries as well as for classical queries ?
I know I could get it on SQL server itself with the adequate profiling tools, but I would like to be able to do it on code side in EF.
Is there a way to get SQL generated for "IncludeFilter" queries as well as for classical queries ?
No, there is currently no way.
It might come later but at this moment, the library doesn't offer this feature.
(I'm the owner)
EDIT: Answer comment
My main worry was to know if the generated queries are optimized
I would not call them optimized. They are generated by Entity Framework and nothing is really modified on our side.
IncludeFilter: Create one VERY big query like Include does in EF6
IncludeOptimized: Create multiple small queries like Include does in EF Core
Maybe a little late but you could use SQL Server Profiler to trace database events (e.g., queries). Using SQL Tuning profile it will trace your queries and you can have a look at them in SQL.
You can use the current context's log to track all requests performed under this instance
context.Database.Log = s => Console.WriteLine(s);

How to call stored procedures from mvc3?

I'm trying to use mvc3. The online documentation says how to connect one class to one table. anybody have a suggestion on how to run stored procedures and return the results to a view?
MVC is not responsible for the way you access your data. There are many technologies that you can use including
Plain old ADO.NET
LINQ to SQL
NHibernate
Entity Framework
LINQ to SQL is probably the easiest way to get it working without any prior knowledge. Check out Scott Gu's post http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx

usefulness of microsoft data access application

I am planning to start learning asp.net mvc. And also I want to learn Microsoft's Data Access application block. But I dont want to waste time in MDAC block if theres a better option to go for, or if MVC provides any good feature than MDAC. As I have heard MVC architecture automatically generates code.
So, please guide me regarding this. Thanks in advance.
It's not part of MVC per se, but I'd recommend using LINQ to SQL or LINQ to Entities (Entity Framework) over the Data Access application block if you're interested in a pure MS object relational mapping. You could also look at nHibernate or a variety of other ORMs to accomplish this. Any of these would suffice as the basis for the M(odel) in an MVC application.
Try the Nerddinner example application, there is also the data access included. The tutorials are extensive: http://www.asp.net/mvc/learn/
Don't work with MDAC block if you are not forced to! Try NHibernate, Entity-Framework or LINQ instead.

ASP.NET MVC Forum Application

I need to write a forum application for a friend's web site. I want to write it in C# 3.0 against the ASP.NET MVC framework, with SQL Server database.
So, I've two questions:
Should I use Linq to SQL or the Entity Framework as a database abstraction?
Should I use the ASP.NET Membership API or add Users table and implement it myself?
Thanks.
There are lots of examples around internet which is using ling with ASP.NET MVC. But may be you can add your list NHibernate. If you do not want to add i suggest Entity Framework. Using ORM's is a plus.
I always chose write my own membership management layer. If you are a person like (write your own code and be happy when you are making changes in future.) write your own membership layer. If you are looking for a quick solution ASP.NET Membership API is a good choice.
Entity Framework definitely -- see below.
ASP.net Membership API -- easy to maintain.
Reason:
Entity Framework vs LINQ to SQL
1) How about both? Just create an abstraction and you could just use either. My recommendation is to use the repository pattern.
2) The membership provider has its strengths and weaknesses. For some projects, it was far too complex for my needs. However, it is great if you need to get something running in a short amount of time.
I won't answer the first question since i'm a fan of nhibernate
for the second question adding a users table and implement membership yourself i don't think you will be able to do it at least the right way (lot of people tried to make their own membership api but they messed up !)
1) Totally depends on how complex things are going to get. If you want a quick DAL that more or less mirrors your tables in a 1:1 fashion, go for L2S (or SubSonic if you want something more mature and supported). If you are going for more of an n-tier type thing where your tables and domain model are completely different, go for an OR/M like Entity Framework (or NHibernate if you want something that is pretty much better in every way)
2) ASP.net Membership is extremely complex, and there are bits of it that are fairly poorly engineered. However, it depends on how much experience you have with these things. If you enough to know how to take steps to avoid session fixation attacks, just roll your own because chances are it will be better then the canned solution. If you have no idea what that is, take the time to learn the default one.
Something to think about, SubSonic 3 is a pretty powerful data access generation tool. From what I understand, it basically wraps Linq to Sql inside of some very useful wrappers and makes using Linq a little more intutive. You can have a pretty powerful application built up in no time flat when using SubSonic. One little issue though, if you're using a shared hosting (say GoDaddy) you'll run into a medium trust issue. In that case you can always fall back to Linq To Sql without making many changes to your code base.
As for Aspnet_Membership. Just for the amount of tools it provides, I'd reccomend using it.
Good luck, and hope this helps.

Which data framework is better for an ASP.NET MVC site - LINQ to SQL or NHibernate

We're about to embark on some ASP.NET MVC development and have been using our own entity framework for years. However we need to support more than our entity framework is capable of and so I'd like to get some opinions about using MVC with a more robust framework. We have narrowed down or choices to either NHibernate (with the Fluent APIs) or LINQ to SQL.
Which framework lends itself best to MVC style development (I know SO uses LINQ to SQL)?
If we want to support SQL Server, Oracle, MySQL - does that exclude LINQ to SQL?
As someone who has just switched from LINQ to SQL to (Fluent) NHibernate, here are a few things I've noticed.
LINQ to SQL took so long to figure out how to do the equivalent of a join-subclass. After many modifications, I read somewhere that it is not possible. It can only map inheritance if ALL the columns are in that same table. This is great if there are a few columns, but there are tons in my case and sub classes are parents to other sub classes and so on. Why should I put them all in one table for the sake of my ORM?
NHibernate from experience has been robust (sometimes too much for small quick projects) and although familiar with it through small projects, I felt it might be too much and went the route of LINQ to SQL since I could generate a DBML file and be going within minutes.
Fluent NHibernate. Takes the best of both worlds (in my case). I can map the way I want to and have my database the way I want and not have to compromise in my domain or data models. Also one word: Automapping... icing on the cake.
I would have had to go with another ORM once I found limitations and hit a few road bumps with LINQ to SQL, but Fluent NHibernate made this choice easy, and I don't think I'll leave it unless something comes around that does the job even better.
So, like Rob Scott said, the question is how are you abstracting you domain => data model? And are you starting with a domain or a database? How complex are the relationships? If you have any inheritance at all I'd say just go with a richer ORM framework and save yourself the grief.
Fluent NHibernate has some of the best documentation I've ever found and there are so much support, notes, blogs and resources it's self-hate to do anything less... IMO! I was up and running in less than 24 hours.
Oh and if your'e new to NHibernate pick up the NHibernate in Action book to help grease the wheels although there is a lot of help for that framework as well.
The best indication that a tool isn't working is when you have to WORK the tool... LINQ to SQL I was customizing, reading white papers, all sorts of madness and it refused to generate appropriate queries, right when I was tempted to modify my table and domain, I said let me give Fluent a whirl, and I'm happy I did.
Good luck to you.. Sorry for the long response; this has all been in the past five or so days, so I guess I'm still caught up :-)
I've had great success using Fluent NHibernate and dependency injection (Ninject, in my case) with MVC.
It seems to me though that any mature ORM should work well with MVC. Since the nature of MVC (Model/View/Controller) separates the three concerns, any ORM should fit quite nicely into the "Model" role.
LINQ to SQL is for SQL Server. Entity Framework supports some other databases as well.
NHibernate is good choice. You may use Castle ActiveRecord (it's built on top of NH) if you are doing data based application or Sharp Architecture for project guidance.
Entity Framework integrates nicely with MVC and supports other databases.
The short (and not so helpful) answer is that both of the ORMs you've mentioned will work with MVC. A longer answer is that you should think about how you want to work with your model objects. For example, do you want to do domain object first development (ala a Domain Driven Design approach), or are you implementing a "forms over data" type application where you might want to generate a data access layer from an existing db? What is your preference for specifying mappings? Do you want to use a fluent interface or are you happy with mapping files (or attributes on your domain objects)?
These are the type of questions you need to investigate when choosing an ORM -- and they're mostly independent of whether you're using MVC or Winforms.
Entity Framework makes things complex. Use Fluent NHibernate, with Repository pattern and inversion of control in controllers.
NHibernate will make lots of things easier. We have recently migrated from Entity Framework to Fluent Nhibernate, and Fluent NHibernate is definitely the better candidate.

Resources