SQL服务器+实体框架的基础知识 [英] SQL Server + Entity Framework basics

查看:118
本文介绍了SQL服务器+实体框架的基础知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的任务创建在C#程序来管理公司的工作人员。只简要概述 - 所有关于每个雇员的信息要被存储在MS SQL数据库。作为一个表现层,我必须使用WPF和与数据库通信 - LINQ到实体

I have this task to create a program in C# for managing company's staff. Only a brief overview - all the information about each employee is to be stored in MS SQL database. As a presentation layer, I have to use WPF and as a communication with database - LINQ to Entities.

的事情是 - 我设法学习WPF我自己,但SQL是一个严重的问题。我做了一些研究,但即使是阅读许多不同的教程后,我还没有找到满意的东西。我甚至不知道这种模式的机制。据我了解,在创建在SQL Server数据库中根本不执行任何操作,因为一个从数据库创建实体模型后,就不再绑到SQL Server。因此,在创建的SQL数据库中更新数据不再使用的对程序本身。我可能是错的,这是极有可能的,但我只是不明白这一点。

The thing is - I managed to learn WPF on my own, but SQL is a serious matter. I've done some research, but even after reading many different tutorials I haven't found anything satisfying. I don't even understand the mechanics of this model. It is my understanding, that creating a database in SQL Server simply does nothing, because after one creates Entity model from the database, it is no longer tied to SQL Server. So updating data in created SQL database is no longer of use to the program itself. I may be wrong, and that is highly probable, but I just don't get it.

所以,任何人都可以点我到正确的方向?我怎么甚至要知道开始?也许一些教程这样的菜鸟?

So, can anyone point me to a right direction? What do I even have to know to start? Maybe some tutorials for such a noob?

推荐答案

ADO.NET实体框架(EF)首次与Visual Studio 2008和释放。 NET Framework 3.5的Service Pack 1中到目前为止,很多人认为EF从微软只是一个ORM产品,虽然在设计它应该是不仅仅是一个ORM tool.A新的数据接入提供商,EntityClient更强大,创建对于这个新的框架,但引擎盖下,仍在使用ADO.NET的数据提供与数据库

ADO.NET Entity Framework (EF) was first released with Visual Studio 2008 and .NET Framework 3.5 Service Pack 1. So far, many people view EF as just another ORM product from Microsoft, though by design it is supposed to be much more powerful than just an ORM tool.A new data-access provider, EntityClient, is created for this new framework but under the hood, the ADO.NET data providers are still being used to communicate with the databases

应用程序不再直接连接到数据库或看到任何特定的数据库结构;整个应用程序的更高级别的EDM模型来操作。
这意味着你可以不再使用原生数据库查询语言;不仅将数据库无法理解EDM模型,但还需要构建以处理由EDM引入的如继承,关系,复杂类型等元素当前数据库查询语言都没有。

The application no longer connects directly to a database or sees any database-specific construct; the entire application operates in terms of the higher-level EDM model. This means that you can no longer use the native database query language; not only will the database not understand the EDM model, but also current database query languages do not have the constructs required to deal with the elements introduced by the EDM such as inheritance, relationships, complex-types, etc.

。 LINQ到实体允许开发人员使用LINQ表达式和LINQ标准查询运算符

教程创建灵活,对实体数据模型(EDM)的强类型查询可以在这里找到

Tutorial can be Found Here

这篇关于SQL服务器+实体框架的基础知识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆