Vezbe-2020-2021

Материјали за вежбе за школску 2020/2021 годину

View on GitHub

Вежбе – Први час – Упознавање са C#

повратак

Текст на енглеском је преузет из различитих извора – уџбеника, интернета итд.

Основе


Класе

public string this [int wordNum]

Напредни C#


Преглед Framework

Преглед свега што постоји .Net Framework-у. У оквиру курса ће се радити .Net Core Framework и .ASP Net Core па се детаљи везани за други framework и друге могуућности у прављењу апликација могу прескочити.


Основе Framework


Колекције

Namespace Contains
System.Collections Nongeneric collection classes and interfaces
System.Collections.Specialized Strongly typed nongeneric collection classes
System.Collections.Generic Generic collection classes and interfaces
System.Collections.ObjectModel System.Collections.ObjectModel
System.Collections.Concurrent System.Collections.Concurrent

LINQ


LINQ Оператори

Method Description
Where Returns a subset of elements that satisfy a given condition
Take Returns the first count elements and discards the rest
Skip Ignores the first count elements and returns the rest
TakeWhile Emits elements from the input sequence until the predicate is false
SkipWhile Ignores elements from the input sequence until the predicate is false, and then emits the rest
Distinct Returns a sequence that excludes duplicates
Select Transforms each input element with the given lambda expression
SelectMany Transforms each input element, and then flattens and concatenates the resultant subsequences
Join Applies a lookup strategy to match elements from two collections emitting a flat result set
GroupJoin As above, but emits a hierarchical result set
Zip Enumerates two sequences in step (like a zipper), applying a function over each element pair.
OrderBy, ThenBy Sorts a sequence in ascending order.
OrderByDescending, ThenByDescending Sorts a sequence in descending order
Reverse Returns a sequence in reverse order
GroupBy Groups a sequence into subsequences
Concat Returns a concatenation of elements in each of the two sequences
Union Returns a concatenation of elements in each of the two sequences, excluding duplicates
Intersect Returns elements present in both sequences
Except Returns elements present in the first, but not the second sequence
First, FirstOrDefault Returns the first element in the sequence, optionally satisfying a predicate
Last, LastOrDefault Returns the last element in the sequence, optionally satisfying a predicate
Single, SingleOrDefault Equivalent to First/FirstOrDefault, but throws an exception if there is more than one match
ElementAt, ElementAtOrDefault Returns the element at the specified positionException thrown
DefaultIfEmpty Returnsa single-element sequence whose value is default(TSource) if the sequence has no elements
Count, LongCount Returns the number of elements in the input sequence, optionally satisfying a predicate
Min, Max Returns the smallest or largest element in the sequence
Sum, Average Calculates a numeric sum or average over elements in the sequence
Aggregate Performs a custom aggregation
Contains Returns true if the input sequence contains the given element
Any Returns true if any elements satisfy the given predicate
All Returns true if all elements satisfy the given predicate
SequenceEqual Returns true if the second sequence has identical elements to the input sequence
Repeat Creates a sequence of repeating elements
Range Creates a sequence of integers

Concurrency and Asynchrony

повратак