eoblogは 2017年3月31日(金)15:00 をもってサービスを終了いたしました。 長年にわたりご愛顧いただき誠にありがとうございました。
eoblogは 2017年3月31日(金)15:00 をもってサービスを終了いたしました。 長年にわたりご愛顧いただき誠にありがとうございました。
The content on this page is adapted from an article originally written by Julie Lerman (<http://thedatafarm.com>). Entity Framework Code First allows you to use your own domain classes to represent the model that EF relies on to perform querying, change tracking, and updating functions. Code First leverages a programming pattern referred to as 'convention over configuration.' Code First will assum
最近の仕事で (個人的にやや敬遠がちだった)EFを使ってAzureのSQL Databeseに接続するのに 「接続のリトライは実装してね」とお願いしてたら、大掛かりな実装をされた事件があり「おいおーい」と感じたので、メモっておきます。 前提として、現在の開発は Visual Studio 2013 update4 .Net Framework4.5 Entity Framework6.1.2 そしてC#って感じでやってます。 Overview MSDNとかみてると、MS用語的には、Connection の Resiliency とか RetryのLogicと言うようですね。 実装方法は、以下です。非常にシンプル。 DbConfigurationクラスの派生クラスを作って、リトライの設定を持たせる(≒属性を作成する)。 対象のDbContextの派生クラスに、属性をつける。 Implimen
富山で某 O 江さんが Entity Framework 4 で切り捨てたと言ってたので、最新の Entity Framework 6.1.2 について書きます。割と頑張っているし、Entity Framework 7 が期待出来そうです。 EF6.1.2 RTM Available - ADO.NET Blog - Site Home - MSDN Blogs Entity Framework 6 に関しては今後はバグ修正レベルのアップデートになりそうです。ASP.NET 5 と同じタイミングで Entity Framework 7 をリリースしないといけないので大変なのでしょう。 それでは使えないと思われがちな機能を紹介していきます。 コードファーストのモデルクラスを DB から自動生成する コードファーストのモデルクラスという表現はいまいちですが、DbContext を使う POCO
Entity Framework 7 で NoSQL というか KVS に対応すると発表されてましたが、久しぶりにリポジトリを眺めてみると Azure Table Storage 用のプロバイダーが用意されていました。Wiki に vNext ではない .NET Framework 4.5.1 で動かす方法が書いてあったので試してみます。 Home · aspnet/EntityFramework Wiki · GitHub Home · aspnet/EntityFramework Wiki · GitHub NuGet のパッケージソースとして MyGet を追加したら、以下のコマンドを叩き込むだけで完了です。 Install-Package EntityFramework.AzureTableStorage -PreEntity Framework 7 は基本的に 6 の時と同じよう
ASP.NET MVC のスキャフォールディングを使うと、以下のように Entity Framework の DbContext をコントローラのフィールドに持つコードが生成されます。 public class CustomerController : Controller { private SampleDbContext db = new SampleDbContext(); // // GET: /Customer/ public ActionResult Index() { return View(db.Customers.ToList()); } } 単純なアプリの場合はこれでいいかもしれないですが、リポジトリパターンを使った場合では DbContext をどうやって持つべきかと悩む人が居ると思います。 変更追跡やトランザクションの観点的に、DbContext や Unit of
nugetで「MySQL.ConnectorNET.Entity」をインストール。他のは無視。 うまくいけば、アセンブリの参照はこんな感じになる。 App.configはこう。 <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Vers
Code First Migrations is the recommended way to evolve your application's database schema if you are using the Code First workflow. Migrations provide a set of tools that allow: Create an initial database that works with your EF model Generating migrations to keep track of changes you make to your EF model Keep your database up to date with those changes The following walkthrough will provide an o
Using MVC, Entity Framework, and ASP.NET Scaffolding, you can create a web application that provides an interface to an existing database. This tutorial series shows you how to automatically generate code that enables users to display, edit, create, and delete data that resides in a database table. The generated code corresponds to the columns in the database table. In the last part of the series,
「Package Manager Console」([ツール]-[Library Package Manager]-[Package Manager Console])から、Entity Framework をインストールすることにします。 (なお、参照設定を追加するプロジェクトを正しく選択します。) これで、該当プロジェクトに該当パッケージが参照設定されました。 (なお、インストールされたパッケージは、ソリューションのフォルダの”packages”というフォルダの下にあります。) 2.データモデルの定義 Entity Framework のコードファーストを使った開発では、次の流れでデータモデルを作成します。 1) モデル クラス(エンティティ)の定義 2) コンテキスト クラスの定義 3) イニシャライザの準備 4) スキーマの細かな定義処理 まずは、モデル クラスを定義します。(以下
ASP.NET MVC 3 開発入門 - インデックス 今回のアプリケーションはデータベースを Entity Framework 4.1 コード・ファーストを利用して作成しましたが、実際にコードファーストで作成したテーブルがどのようになっているか確認を行いたいと思います。 データベースとしては SQL Server Compact 4.0 を利用していますので、Visual Studio 2010 でテーブルを表示するためには「Microsoft Visual Studio 2010 SP1 Tools for SQL Server Compact 4.0」が必要になります。インストールされていない場合は Visual Studio 2010 SP1 をインストールしている場合は、ソリューションを閉じて再度開きなおせば Web PI が起動して不足しているコンポーネントが自動的にインストー
本連載では、MVCモデルをベースとした.NET Frameworkの新たなアプリケーション・フレームワーク「ASP.NET MVC」を基礎から解説している。前回は、Model-View-Controllerのうち、主に「View」「Controller」について解説した。今回は残る1つである「Model」を中心に、簡単なデータベース連携アプリケーションを作成してみよう。 なお、前回の解説の後、Visual Studio 2010(以降、VS 2010)に新たな機能を追加する「ASP.NET MVC 3 Tools Update」がリリースされている。本連載でもこのUpdate版をベースに説明を進めていくので、まだインストールされていないという方は、「ASP.NET MVC: The Official Microsoft ASP.NET Site」から入手&導入しておくことをお勧めする。 [
Entity Framework Tutorials Web フォーム、そしてASP.NET MVC で Entity Frameworkをどう使うか、というチュートリアルがまとめられています。 Webフォームで各種WebコントロールとEntity Frameworkとの組み合わせ方はいろいろ悩むところだったので、このような資料の提供は本当にありがたいですね。 #どこかできちんと調べなくては、と思いつつそのままになってた。。。 Getting Started with the Entity Framework は 107ページ、Continuing with the Entity Frameworkは111ページのPDFとしてダウンロードすることもできるようになっています。 今回あらたに加わった Getting Started with the Entity Framework Using
このブラウザーはサポートされなくなりました。 Microsoft Edge にアップグレードすると、最新の機能、セキュリティ更新プログラム、およびテクニカル サポートを利用できます。 Entity Framework でのデータベース アクティビティのプロファイリング Julie Lerman コード サンプルのダウンロード 先月のコラム (msdn.microsoft.com/magazine/gg309181) では、Entity Framework と SQL Azure のパフォーマンスのプロファイリングについて説明しました。今月は、クエリのプロファイリングという種類の異なるプロファイリングについて見ていきます。この種のプロファイリングでは、Entity Framework でのクエリやその他のデータ アクセス アクティビティに応答してデータベースで実行されるクエリやコマンドを確認
In Visual Studio 2022 17.10 Preview 2, we’ve introduced some UX updates and usability improvements to the Connection Manager. With these updates we provide a more seamless experience when connecting to remote systems and/or debugging failed connections. Please install the latest Preview to try it out. Read on to learn what the Connection ...
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く