Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

0

Share

Download to read offline

6 Programación Web con .NET y C#

Download to read offline

Expresiones LAMBDA en el EF de .NET

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

6 Programación Web con .NET y C#

  1. 1. LINQ Guido Ticona Hurtado guidoti@gmail.com
  2. 2. Calculo Lambda  El mas pequeño lenguaje universal de programación  Regla de transformación simple  Sustitución de variables  Esquema para definir funciones  Cualquier función computable puede ser expresada por un calculo lambda
  3. 3. Sintaxis (parametros input) => {sentencias;} (x, y) => x == y () => funcion() Personas.Where(p => p.NOMBRE == “Juan");
  4. 4. Comparacion var personas = from p in db.PERSONAS where p.NOMBRE == “Juan”; orderby p.DOCUMENTO select p;
  5. 5. Expresiones Lambda var personas = db.PERSONAS .Where(p => p.NOMBRE == “Juan”) .OrderBy(p => p.DOCUMENTO) .Select(p => p);
  6. 6. Expresiones Lambda  .Select()  .OrderBy() .OrderByDescending()  .Where()  .GroupBy()  .Single()  .First()  .Last()
  7. 7. Expresiones Lambda (GroupBy) var personas= db.PERSONAS .GroupBy(o => o.TIPODOCUMENTOID) .Select(o => new { Id = o.Key , Cantidad= o.Count() })
  8. 8. SQL con entidades EntityConnection econn=new EntityConnection(“name=contexto”) econn.open() EntityCommand ecmd =econn.CreateCommand() ecmd.CommandText=“sql” EntityDataReader ereader= ecmd.ExecuteReader(CommandBehavior.SequentialAc cess) ereader.Read()

Expresiones LAMBDA en el EF de .NET

Views

Total views

255

On Slideshare

0

From embeds

0

Number of embeds

3

Actions

Downloads

7

Shares

0

Comments

0

Likes

0

×