Showing Posts for Entity Framework

SQL helper script to generate properties for an Entity Framework model

Michael Roma

This post shows a T-SQL script that can be used to generate the properties for a class that correspond to to a field in a database table. This can be used with Entity Framework.

  • C#
  • SQL
  • Entity Framework

Connecting to a SQL Compact database using Entity Framwork in ASP.NET

Michael Roma

The following shows how to setup a proper connection string and DbContext in Entity Framework in order to connect to a SQL Compact database in ASP.NET.

  • ASP.NET
  • C#
  • Entity Framework

Using the LIKE filter in Entity Framework

Michael Roma

Example on how to use the LIKE functionality in T-SQL in Entity Framework

  • C#
  • Entity Framework

Using Contains in Entity Framework for WHERE IN clause

Michael Roma

A common problem with parameterized queries is when you have the need for a WHERE IN clause and the IN list is variable. This is solved with Entity Framework using the Contains methods of the list.

  • C#
  • Entity Framework

Easy way to get distinct values from a .NET List

Michael Roma

The follow example shows how to get a list of objects that are distinct based on a property's value.

  • C#
  • Entity Framework

Counting records in associated tables in Entity Framework

Michael Roma

The following example shows how to query a table and count records associated in another

  • C#
  • Entity Framework
  • SQL

Using Inheritance in Entity Framework

Michael Roma

C# Examples on how to use inheritance in Entity Framework

  • C#
  • Entity Framework
  • SQL

Entity Framework DbSet Helper functions for Insert and Update

Michael Roma

C# DbSet extension functions for Add and Update

  • C#
  • Entity Framework

Entity Framework - how to specify the table name for an entity class manually

Michael Roma

How to specific the table name on an entity class in Entity Framework

  • C#
  • Entity Framework