MIS Professor Sandvig MIS 324 Professor Sandvig

Slides:



Advertisements
Similar presentations
LINQ and Collections An introduction to LINQ and Collections.
Advertisements

.NET 3.5 – Mysteries. NetFx Evolution NetFx 1.0 C# 1.0, VB 7.0, VS.NET NetFx 1.1 C# 1.1, VB 7.1, VS 2003 NetFx 2.0 C# 2.0, VB 8.0, VS 2005 NetFx 3.0 C#
Data Structures Michael J. Watts
C# Data Structures AND Generics By Michael and Miles.
C# Programming: From Problem Analysis to Program Design1 Advanced Collections C# Programming: From Problem Analysis to Program Design 3 rd Edition 8.
Database Solutions for Storing and Retrieving XML Documents.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
Entity Framework MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
Chapter 15: Using LINQ to Access Data in C# Programs.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
Introduction to LINQ Lecture # 19 August Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free.
Introduction to LINQ Chapter 11. Introduction Large amounts of data are often stored in a database—an organized collection of data. A database management.
Understanding Data Types and Collections Lesson 2.
Introduction to the Standard Template Library (STL) A container class holds a number of similar objects. Examples: –Vector –List –Stack –Queue –Set –Map.
XML and Database.
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX.
CSCI 3327 Visual Basic Chapter 8: Introduction to LINQ and Collections UTPA – Fall 2011.
Oracle11g: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
C++ Review STL CONTAINERS.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 11.  Large amounts of data are often stored in a database—an organized collection of data.  A database management system (DBMS) provides mechanisms.
Introduction to.NET Florin Olariu “Alexandru Ioan Cuza”, University of Iai Department of Computer Science.
Understanding Data Types and Collections Lesson 2.
Web Database Programming Using PHP
Standard Template Library
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
Lecture 10 Collections Richard Gesick.
Introduction to .NET Florin Olariu
Understanding Algorithms and Data Structures
C# Object Oriented Programming Concepts
Data Structures Michael J. Watts
Introduction to LINQ and Generic Collections
September 29 – Stacks and queues
CIS 200 Test 01 Review.
MIS Professor Sandvig MIS 324 Professor Sandvig
Web Database Programming Using PHP
Language Integrated Query: (LINQ) An introduction
LiNQ SQL Saturday David Fekke.
Overview of Data Access
CSC 222: Object-Oriented Programming
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
Chapter 12 Outline Overview of Object Database Concepts
What is “Data Structures”?
MIS Professor Sandvig MIS 324 Professor Sandvig
Chapter 3 The .NET Framework Class Library (FCL)
Overview of Data Access
MIS Professor Sandvig MIS 324 Professor Sandvig
structures and their relationships." - Linus Torvalds
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
structures and their relationships." - Linus Torvalds
C# Object Oriented Programming Concepts
Introduction to LINQ Chapter 11 10/28/2015 Lect 4 CT1411.
MIS Professor Sandvig MIS 424 Professor Sandvig
Introduction to LINQ Chapter 11.
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections UTPA – Fall 2012 This set of slides is revised from lecture slides.
Web DB Programming: PHP
Managing Collections of Data
MIS Professor Sandvig MIS 324 Professor Sandvig
Introduction to Data Structure
By Yogesh Neopaney Assistant Professor Department of Computer Science
Introduction to .NET Florin Olariu
Fundaments of Game Design
Tenth step for Learning C++ Programming
Handling Data in PL/SQL Blocks
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises UTPA – Fall 2012 This set of slides is revised from lecture.
Entity Framework & LINQ (Language Integrated Query)
structures and their relationships." - Linus Torvalds
Fast-Track UiPath Developer Module 4: Retrieving and Working With Data
Modern Collections Classes & Generics
Presentation transcript:

MIS 324 -- Professor Sandvig MIS 324 Professor Sandvig 11/9/2018 C# Collections MIS 324 Professor Sandvig

Overview What are collections Arrays Language Integrated Query (LINQ) Sort & filter collections Similar to SQL Generic List<>

What are Collections Collections store multiple data values Frequently work with collections: Database records List of products List of people Shopping cart Cookies Web form values Etc.

What Are Collections Arrays .NET library namespaces C# feature Simple Limited functionality .NET library namespaces System.Collections System.Collections.Generic Classes for managing collections of data

What are Collections Select collection type based on desired behavior & performance Many choices: Array Queue Stack Dictionary List<> Sorted List Etc.

What are Collections A few types of collections: Collection Best for Dictionary Fast lookups Sorted list Items sorted on Insert List General use Stack Last in First Out (LIFO) Queue First in First Out (FIFO)

Array Simple collection type Basic C# language feature Limited features No sorting No filtering Limited to C# data types

Array Advantages Disadvantages Simple Basic features: Iterate, retrieve values, find value Disadvantages Limited to C# data types String, Int, Double, etc. Size fixed when initialized

LINQ Language Integrated Query Query language built into C# Use with any collection type Including database Capabilities similar to SQL Uses Lamda Syntax .where(collection => expression) Collection Examples

Collections Namespaces .NET library namespaces System.Collections System.Collections.Generic Have similar classes List Stack Queue Etc. Generic classes newer More functionality

Generic Collections System.Collections.Generic namespace Strongly typed! Faster Used extensively in MVC Retain datatypes defined in model .NET Library Documentation

Generic Collections Why “generic”? Declare type when create collection Items in collection can be any “generic” object Declare type when create collection List<int> myGenericList = new List<int>(); Generics can hold any object List<PersonModel> personList = new List<PersonModel>(); See code sample

MIS 324 -- Professor Sandvig 11/9/2018 Generic List<> List<> only collection used in MIS 324 Used in ViewModels Fonts States List<> has methods for sorting, finding, etc. Often use LINQ (Language Integrated Query) to query List

Summary Collections frequently used Generic Collections Strongly typed Generic List<> used for most data lists