Giter Site home page Giter Site logo

introkamp's Introduction

IntroKamp

Camp works Description For Link Project

***Linq yapısı

Yazmış oldugum kodumda ;

List categories = new List() List products = new List()

ile Category ve Product sınıfından liste tanımlayıp bunları çeşitli linq operasyonları yardımıyla farklı kullanımları denediğim örnek methodlar içermektedir.

Linq in çeşitli methodları aşagıda anlatılmış ve kod içerisinde mevcuttur. Örnek Basit Linq yapısı : .Where var result =products.Where(p => p.UnitPrice > 5000 && p.UnitInStock > 3).ToList(); //p parametremiz burada products listesinde dolaşan geçici değişkenimizdir her p için p'nin birim fiyatı (UnitPrice) 5000 den büyük ve Stok adedi(UnitInStock) 3'ten büyük olanları Where anahatar kelimesi kullanarak elde edilen (ürün listesi döndürülen) yapıdır.

.Any var result = products.Any(p => p.ProductName == "Acer Laptop") sonuc olarak ProductName Acer Laptop adında bir product(ürün) varsa true yoksa false döndürür (Any bool yapıdadır)

.Find var result = products.Find(p => p.ProductId == 3) // details of product for find (üürn id si 3 olan ürünü döndürür)

.FindAll var result = products.FindAll(p => p.ProductName.Contains("top")) FindAll methodu ise her p için ürün adı 'top' içeren her ürünü ürün listesi şeklinde geri döndüren yapı örnegidir

azalan veya artan şekilde sorgu yazmak istersek ; var result = products.Where(p => p.ProductName.Contains("top")).OrderByDescending(p => p.UnitPrice) .ThenByDescending(p => p.ProductName); //OrderBy(p=>p.UnitPrice) //return those contains the 'top'

introkamp's People

Contributors

ozerbey avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.