LTI - round 2 Flashcards

1
Q

SQL Joins

A
  • Inner Join – returns rows with matching values on both tables
  • Left/Right Join – returns all rows of either side and also matching values from other side
  • Outer Join – returns all rows from both left and right side and puts nulls where there are no matches
  • Cross Join – combination of all rows of both tables
  • Self Join – joining self table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

SQL Tables - migrating data

A
  • SSMS tool (Export/Import Wizard) – takes care of exporting and importing process
  • SQL script – queries to move data
  • Backup/restore – create backup of db and restore it on next db server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Abstract class

A
  • Blueprint for other classes
  • Good for when you need a common base with some shared implementation among derived classes
  • Allows for code reuse
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Interface

A
  • Good for when you know methods need to exist but you also know they may need to be implemented differently
  • If you want to change the interface like adding new method / property to it, it will break all implementations
  • Cannot have access modifiers
  • Cannot have constructor
  • Can only define methods
  • You implement an interface (you inherit an abstract class)
  • Composition
  • Multiple unrelated classes can implement
  • Allowing a class to implement multiple interfaces
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Scoping

A

o Public – any class has access
o Protected – inherited class has access
o Private – only same class has access
* Interface – public
* Abstract class – private, protected, public

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

AutoMapper

A

 Install by adding nuget package
 Configure maps
 Flattening/unflattening
 Can handle mapping of lists/collections to other lists/collections
 Can handle conditional mapping
* .ForMember(dest => dest.SomeProperty, opt => opt.Condition(src => src.SomeProperty != null));

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Entity Framework

A

ORM (Object Relational Mapper) framework
* Makes it easier to work with databases using C# objects
* Abstracts away underlying database interactions
Key components
* DbContext – represents a session with the database
o Manages database connections, transactions
o Provides set of APIs for querying and interacting with data
* DbSet – represents a table
Provides a collection of entities
* Entities – represents objects that represent database records
o C# classes that represent objects in database
o Class properties == database columns
Best practices
* Managing lifespan of connection of DbContext

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Authentication vs authorization

A

 Authentication – verifying user login credentials
 Authorization – verifying user permissions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly