Is it worth spending time in these frameworks. Or they just another framework like microsoft developed in the form of MFC library.
I dont want to waste precious time, so please help. Under what scenarios these frameworks will be helpful.
EF and L2S are Object-Relational Mappers (ORM). They would be used wherever an ORM is used. StackOverflow uses Linq to SQL as its ORM layer, to good effect. Entity Framework is up-and-coming, and although it currently has issues, it will be greatly improved in the upcoming version 4.0.
Your time would be well spent learning one or both of these frameworks, as it will be highly likely you will use an ORM in your applications at some point.
It really depends on what your alternative is. If your alternative is using ADO.NET and DataSets, then yes, LinqToSql and EntityFramework are likely a step forward. If your alternative is NHibernate or another feature rich ORM, then they may be a step backward.
Microsoft has really strongly moved away from LinqToSql while still continuing to offer support for it and making minor changes. Microsoft is recommending all LinqToSql users move to Entity Framework. However, the Entity Framework that came out with VS 2008 SP1 / .NET 3.5 SP1 was in many ways a step back from LinqToSql. The Entity Framework that is coming out in April with VS 2010 and .NET 4.0 should be mostly an upgrade from LinqToSql, assuming you can migrate to VS 2010 / .NET 4.0 sometime in the near future.
YES! It is worth Learning. No! its not just another framework. It is useful for any application that uses a SQL Database to query data and present/do some logic.
Linq2Sql was introduced with .NET 3.5. Very useful if you dont have your own set of domain entities. A bit difficult to map Linq2Sql classes to our own domain entity classes in complexed scenarios.
But, recommend to use Entity Framework. EF was introduced with .NET 3.5 SP1. Much improved version of Linq2Sql and came as part of Olso Mixed Models. This can be used as a real ORM to map our own set of domain entities and the designer provides most of the features.
There is a new version of EF (EF4) ships with .NET 4.0.
Watch Evolving ADO.NET Entity Framework in .NET 4 and Beyond for what you can do with EF4.
Download the "Layered Architecture Sample for .NET" from Codeplex.com
Related
I've recently started using VS2022 Community Edition Version 17.4.4 after using VS2017 Enterprise Edition for many years. I've started a new project after selecting ASP.Net Core Web App using MVC. After creating the project, I used Nuget to import the MS.EntityFramwork packages I need and the went to add a new item to select ADO.Net from my DB for my Entity Framework. However, as you can see from the screenshot below the packages are there but ADO.Net is not.
Although I cannot find ADO.Net I can select Scaffolding if I want to and something tells me that is the only option available to me. I've used this process of adding Entity Framework many times and I think it's no coincidence that it isn't available after updating my Visual Studio. Can someone please confirm this is my only option to work with my SQL database or is there something I'm missing in order to access ADO.Net.
ADO.Net only works with .Net Framework. You can pay attention to see what your framework version is. If it is .Net XXX, it should be that you have created the wrong project, and the type of project you should create is ASP.Net Web Application (.Net Framework).
If following the methods above doesn't work, please speak up.
Our group does not primarily develop in c#/.NET, but a few years ago we picked up a couple of licenses for Visual Studio 2008 for a few projects. Since we do not develop full time in .NET, we have not upgraded Visual Studio since then.
There is a project coming where we need to develop a web application that contains a REST API. We have been looking at all of the documentation that deals with creating REST APIs. It appears that while VS 2008 is capable of creating APIs (with WCF), later versions of Visual Studio seem to have much better support for creating REST APIs (ASP.Net Web API).
My questions are:
Would upgrading to Visual Studio 2012 or 2013 make that much of a difference in the development/maintenance of an API, or is Visual Studio 2008 sufficient?
How can we go about justifying an upgrade in our Visual Studio licenses (if needed)?
We don't want to justify an upgrade by just saying "it is newer so it is better". Are there any documents that show how Visual Studio 2012 or 2013 is much better at creating REST APIs than Visual Studio 2008?
Not sure if is enough to justify the money but here are some reasons to adopt Visual Studio 2013:
With Visual Studio 2008 you are restricted to .NET Framework 3.5 or lower. If you upgrade you have access to 4.0, 4.5 and future 5.0
If you use Framework 4.5 you can use new REST API Framework.
You can use latest versions of MVC.
You can use latest Microsoft Entity Framework versions (old version can be used in Framework 3.5.1 but you really want the latest version as it has important performance improvement)
You can benefit from ASP.NET WebAPI.
WCF was a way of improving web services, but not the best one. I would avoid WCF if possible.
What is Web API?
ASP.NET Web API is a framework for building web APIs on top of the .NET Framework. You can use the new MVC4 (ASP.NET MVC 4 Web Application project)
using Web API template.
You can actually get Visual Studio 2013 express for free and build all the web API's you'd like. The paid versions include lots of enterprise features and plugin support.
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
For me, it will always be a factor of the business side of things. If they see the value, it is an easy sell.
If using Framework 4.5.1 (VS2013 required) will reduce both the server resources
(See:
ASP.NET application suspend
Just-In-Time (JIT) performance of 15%
"The .NET Framework 4.5 and Windows 8 introduce features that can help you achieve a significant performance boost for web-server workloads. This includes a reduction (up to 35%) in both startup time and in the memory footprint of web hosting sites that use ASP.NET."
)
AND bandwidth resources
(SEE:
.NET 4.5 and WCF Request Compression
http://www.topwcftutorials.net/2014/03/whats-new-in-wcf-v45.html under Compress and Cache
),
then one can actually do the maths and see if it makes sense already. Then, the developer and maintenance side (which is quite "neat" in Vs2013 - new intellisense, nice nuget, etc.), is just jam. From a developer point of view, you will also need to consider the cost to upgrade the application between versions, i.e. the cost from 2008 to vNext vs. 2013 to vNext.
Update:
As this is a very similar situation I find myself in, I have been doing some research. Our company standards is VS2012 (RE: Microsoft Dynamics environment).
According to "What's New in the .NET Framework 4.5, 4.5.1, and 4.5.2" at http://msdn.microsoft.com/en-us/library/ms171868(v=vs.110).aspx they suggest the following for your domain specific improvements:
•Ability to support multiple authentication modes on a single WCF endpoint when using the HTTP transport and transport security.
This is always a big seller for business. Please look at the other improvements under WCF at the link above.
I have also found an article at http://www.msmsoftware.com/2013/8/6/the-business-benefits-of-upgrading-net-35-to-45.aspx that is very specifically aimed at your question. They note, as I said, better performance, better security and increase development and support functions.
Your question is unique in that it targets the work side of things (WCF), so the fluff around better support for app stores, better web standards, etc. is somewhat pointless. Hopefully I have given you enough to make the answer somewhat clear.
I want to NO I have to use Entity Framework with Oracle database (version is not defined).
I would like to use Code First and I have read in an article from 2012 that it is not implemented by Oracle.
1) Has that changed with latest EF 6.0.2?
2) Is there still something which should not work in latest EF 6.x you made the experience with?
Entity Framework 6 support is implemented in Devart ADO.NET providers.
Please check below mentioned article for full details (posted on October 17th, 2013).
Entity Framework 6 Support for Oracle
I want to use LINQ on machines with only .NET Framework 2.0 installed.
I've alread read about LINQBridge. But can't I simply set "copy local" to the referenced assemblies like System.Core.dll and System.Xml.Linq.dll to get the functionality I need?
Are there any drawbacks? Is this even allowed?
.Net 3.5 is really just .Net 2.0 with some extra dlls. There is no 3.5 runtime. If you include the dlls you need, the application will run without any problems.
From the following article concerning the linq bridge comment: http://www.albahari.com/nutshell/linqbridge.aspx
First, it's important to understand
that C# 3.0 and Framework 3.5 are
designed to work with CLR 2.0—the same
CLR version that Framework 2.0 uses.
This means that the C# 3.0 compiler
emits IL code that runs on the same
virtual machine as before.
This makes Framework 3.5 additive—just
as Framework 3.0 was
additive—comprising additional
assemblies that enhance the existing
2.0 Framework and CLR. So there's nothing to stop us from writing our
own assemblies that do the work of
Framework 3.5 (at least, the critical
bits required for local LINQ queries).
The compiler then looks for Where,
OrderBy and Select methods. The
critical thing is that it can find
appropriately named methods with the
correct signatures (typically
extension methods). But it doesn't
matter what assembly the methods come
from. LINQBridge simply provides
another source of these methods—that
are functionally identically to those
implemented in the Framework 3.5
assemblies.
I'm arguing with one guy about linq in visual basic.He shows linq expressions in vb,but I can't be sure if it's managed or unmanaged(vb6),because I've never used any of them.
Does VB6 have linq expressions?
Visual Basic 6 does not have LINQ extensions.
VB6 is not related to VB.NET. It's a different language and platform. The two are related in the sense that C and C++ are related.
In particular, VB6 is not an unmanaged form of VB.NET.
LINQ is part of the .NET Framework. VB6 was released in 1998. .NET was released in 2002.
The VB6 IDE is unsupported.
Linq is fairly new (Released 2007). Its not supported by VB6 which was released about 1998
With version 7 Visual Basic took the step into .NET with managed code and real object orientation, leaving the old unmanaged platform behind. (Well, it was never called unmanaged, as there was no managed code...) Version 9 was released a while a go including LINQ support.
So, no VB 6 doesn't support LINQ.
The only way that you can use LINQ and Lambda expressions in VB 6 is to use COM Interop. The performance is still Okay regardless of the time that you need to consider for proxy and translators.
For scenarios that you need to use LINQ and Parallel LINQ(PLINQ) in your VB 6 code, the best solution is to use COM Callable Wrapper(CCW). To learn more, you can read how to expose a .NET COM to a COM client such as VB 6.