Using Entity Framework with Telerik's Controls - c#

I have worked with products of Telerik about two week,and in my opinion the Entity Framework is better than the Open Access(ORM), But i wonder that other Products of Telerik(EXP:GridView or ....) hasn't any problem with Entity Framework? I want to start a Project with Entity Framework and Telerik's Controls

You shouldn't run into any problems. Entity Framework and the Telerik Tools are compatible with one another, in fact I have used EF and Telerik together in a number of projects.

We use the EntityFramework in conjunction with Telerik's controls extensively, and have not had any issues or problems. Telerik's controls seem to always behave as expected when binding to individual objects or lists.
Good luck!

To take the classical 3 tier approach...
Are you asking if your data access layer (i.e. EF) is compatible with your UI (i.e. Telerik controls)?
The answer is kind of up to you as you should provide the middle layer (i.e. the business/service layer).
If you are finding direct dependencies between the two then I would advise looking at the architecture of the application. They shouldn't be connected directly.

Related

Replace Devexpress XPO to Entity Framework

I am working on an ASP.NET MVC web application that was built with DevExpress 12.1 tools including DevExpress XPO.
Due to licensing issue, I have task in which I want to remove Devexpress components entirely from that web application.
After r&d, I found at the first step of removing, I need to change datalayer to Entity-Framework (currently using XPO).
I know the manual process, but can anybody suggest how to do this? Is this any online tool or suggestion which achieve my work speedily?
I use XPO in one application and EF Core in another. I would happily move away from XPO forever, EF Core is a much better experience - the linq to entities is way better than linq to xpo, and while there are lots of other reasons, the most important thing is that you can change properties by ID with EF Core - in XPO you have to load the object first and then change the object reference. I have begun to truly loathe working with my project that is dependent on XPO so I have been looking for an answer for this for a long time.
I have sadly come to the conclusion that the best way is a gradual migration. You can run the models side by side and just change components over on a progressive basis. This way you can keep the application functional while moving between ORMs. There is sadly no esy way to do this.

Using EF and Passing Data Through Application Layers

All,
We are using EF as our primary data access technology. Like many apps out there, we have a business objects/domain layer. This layers talks to our repository, which, in turn, talks to EF.
My question is: What is the best mechanism for passing the data back and forth to/from EF? Should we use the EF-generated entity classes (we did DB-first development, so we have entity classes that EF generated), create our own DTOs, use JSON or something else?
Of course, I could make an argument for each of these, as well as a counter-argument against them. I'm looking for opinions based on experience building a non-trivial application using a layered architecture and EF.
Thanks,
John
I would use POCOs and use them with EF. You can still do that with the DB first approach.
The main benefit is that your business objects will not be tied to any data access technology.
Your underlying storage mechanism can, and will, change but your POCOs remain. All that business logic is easily re-used and tested.
As you're looking for cons, then I would say it might take longer. However, that cost is well worth it.
With t4 templates I put the actual EF generated entities in a common project that is referenced by all other projects. I use the EF database first created models through the entire application (including use as view models). If I need to add additional properties to an entity that are not in the database I just extend the partial class of the entity in the common project. I have written dozens and large nTier applications using this model and its worked great.

Strategy for Silverlight and Entity Framework solution

I am new to Silverlight and am developing an ASP.NET web application that requires a Silverlight project to record webcam audio/video streams.
The solution consists of a library project containing business entities such as [User], [BillingInfo], etc., and an ASP .NET Web Application.
Since Silverlight does not support EF, how can I use the strongly-typed entity objects from within Silverlight? I do not need access to the Context object but will require access to Entity classes.
I use Code First so have to mark Entities with Annotations which Silverlight will not recognize since the DataAnnotations assembly is not referencable. Switching to model-first is also an option (albeit less preferable) if required.
Has anyone dealt with a similar scenario? What is the best way to get strongly-typed entities in Silverlight. Any articles or references would help as well. Thank you.
Technologies (upgrade is an option if required):
ASP .NET Web Application (.NET 4)
Entity Framework 5
Silverlight 5
I would recomend giving WCF RIA Services a try. This will simplify the data access for your application and provide you with strongly typed entities on the Silverlight client side.
Silverlight works very well with entity framework!
You could directly consume your entity through webservices as describe in this blog: http://geekswithblogs.net/berthin/archive/2011/05/29/ado_net_entityframework_from_silverlight.aspx
Or as Dave suggest, you could combine RIA services and Entity Framework, so you could use annotation http://blogs.msdn.com/b/brada/archive/2010/03/15/silverlight-4-ria-services-ready-for-business-exposing-data-from-entity-framework.aspx
The combination of Silverlight and Entity Framework create a really powerfull ready to use business logic.

Recommendations for C# database access

Hi I've programmed a fair bit of C#, but never with a database. I'd like to use SQL Server with C# with some framework. Microsoft seems to have shipped a number of frameworks through the lifetime of C#. This makes it difficult for me to search/choose.
Which one should I choose? I'm developing a simple 3-tier webapp. I've watched a few Entity Framework .Net 4.0 videos, but I get the feeling that things are too automatic. I need to do some SQL now and then..
And if I should go for the EF4.0, is this really the best reference http://msdn.microsoft.com/en-us/library/bb386876.aspx
Any recommendations?
Go with Entity Framework 4 - it is the current and future best approach to SQL Server database. It is the basis for WCF Data Services, and the idea of a conceptual model will show up in other Microsoft product, for sure (Reporting Services and others, possibly).
And it does give you a lot of hooks to allow you to execute "on the fly" SQL statements, and you can also integrate stored procedures very nicely into Entity Framework.
And for the "run of the mill" everyday tasks, it gives you nice C# objects - based on your database - to work with.
In my opinion, this is your best choice currently - and the one with the most flexibility and options. You can start with a database ("database first") and create your classes from existing tables; or you can start with a model and have EF4 generate your database for you, and EF v4.1 (due out pretty soon) will also offer "code-first" development where you don't even need a visual model but you can describe all your database objects and settings in just C# code.
Update:
Entity Framework 4 Overview
Learn Entity Framework - the site accompanying the book by the same name, by Julie Lerman, Goddess of EF :-)
ADO.NET team blog with lots of good EF stuff
Entity Framework team design blog
ASP.NET 4.0 and the Entity Framework 4 - Part 1 - Create a Database using Model-First Development - good intro for EF4 model-first approach; Vince has multiple articles here - click on his name to get a list of all his articles (many new ones EF4 related)
Introduction to Entity Framework (this was for v1 - but still good)
C#+ActiveRecord+NHibernate. Hide the implementation behind several WCF services.
You said you want to try some 'framework', so Entity Framework is that one. It is the result from best practices MS come up with after years of research. Of course, on the way, you can always use SQL (Dataset) anytime you want together with EF (mostly for performance tuning).
I would say Start with Rob Conery's Sub Sonic..
Its easy to start with..specillaly Simple Repository..
Site Link: http://www.subsonicproject.com/
Simple Repository using Sub Sonic:
http://subsonicproject.com/docs/Simple_Repo_5_Minute_Demo
Update:
I have seen one answer mentioning NHibernate and want to add a small addition to the same... and since OP mentinoned that you have good experience with C# I assume you have good OOPS knowledge and also the relationships amongs objects
I personally felt much easy to start with NHibernate when used it with Fluent NHibernate hence I would also suggest
C# + NHibernate + Fluent Nhibernate....
Take a look here for some information about performance/benchmarks on various ORM frameworks for .Net.

WPf which one suits best a dataset or Entity Frame Work?

Normally as i know Entity frame work associated with WCF application , for standalone desktop application like POS or Inventory application , is Entity Frame work suitable ? or WPF MVVM Model
MVVM is a design pattern that separates the UI from the implementation details.
The Entity Framework is (I believe) an ORM, designed to abstract application specific implementation details from the underlying storage.
Datasets offer little to no abstraction over the underlying storage. I'd recommend using any ORM/DAL framework over directly interacting with datasets.
Both MVVM and the Entity Framework can be used in the same application because they offer abstractions at completely different layers. When combined, the "model" in MVVM is the DAL/ORM layer.
To work with WPF; I’ll prefer to use Entity Frame work.
1-It will convert all tables to classes direct.
2-You can add partial class to tables to do some validation or extra variable
3-You don’t need to write to many procedures.
Of course it will be different from dataset, but with time you’ll never go back to dataset. I promise.
Additional arguments
Datasets work well when the database is disconnected. They can be saved and loaded as xml from a file or send over the wire to an other application. I am not shure wether this is possible with ef.
As far as i know Datasets are not supported in silverlight apps or on windows-mobile7. They are supported in Dotnet-CompactFramework.

Categories