Entity Framework Flashcards

1
Q

How to recovery information of the several tables using entity framework

A

In the class repository of this entity
I can add the instruction
_context.Products.
Include(p => p.ProductType).
Include(p =>p.ProductBrand)
.FirstOrDefaultAsync(p => p.Id == id);

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

What is the difference between an API and Microservices

A

The difference is the architecture, in the case of the APi in the majority of the cases use a monolithic architecture that means that all the execution it is in a only container or server in the case of the one application that implements the architecture microservices pattern every service is executed in the different place for example in a docker container or in a different server.

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

What is dependency injection DI

A

In general is send the instance of a class into the constructor of a new class this with the target of minimize the high coupling an procure the low coupling. This injection of dependency is achievement using interfaces instead of concrete classes.

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

What is IoC (inversion of code)

A

That is a design pattern in which the control flow of a program is inverted. In the case of dotnet core use specialized classes

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

What classes use dotnet core to implement the DI

A

ServiceCollection: this class contains a list of the declaration of interfaces or concrete class.

ServiceProvider: This class help to implement the services listed in the service collector.

Both classess are in the DependencyInjection package of dotnetcore

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

How add the services in the service collection and what is its lifecycle?

A

Using the methods AddSingleton same instance for the entire application, AddScope same instance in a request, AddTransient new instance every time that the object is requested or injected.

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

Which is the authentication strategy using the azure services

A

Single Sign On (SSO)

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

What are the characteristics of the microservices

A

Componentization via services, Organized around business capacities, products not projects, smart endpoints and dumb pipes, decentralized Governance, decentralized data management, infrastructure automatization, design for failure, evolutionary design

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

Definition of pattern microservices

A

Every Service is indepent for any other, with this, we are promove the loose coupling instead of tight coupling , the independence of test and deployment and the use of the stack of technology in every service.

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

Characteristic of the componentization

A

Independent deployment
Well define interface

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

Characteristics of the decentralized governance

A

Use of the optimal technology for every specific service. We can use the stack of the optimal technology that solve our objective with a different stack of technologies

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

Characteristics of the Infrastructure automatization

A

Short Deployment cycles
Automatic Testing
Automatic Deployment

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

Characteristics of the design for failure

A

We would make extensive use of logging and monitoring
In the case of error will be three actions, 1 catch the error, 2 try the connection again, 3 log the error
For this activities exists tools to help us to make this activities automatically like kubernetes.

increase system reliability

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

Recommend attributes in Microservices

A

*Componentization
*Organized around business capacities
*Decentralized Governance
*Decentralized data
*Infrastructure automatization

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

Issues that microservices solve

A

*Single Technology Platform
*Inflexible deployment
*Inefficient resources use

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

Components of docker

A

Containers in which we can configurate the infraestructure, server, framework, etc

17
Q

What is CI/CD

A

Continuous Integration / Continuous Delivery

18
Q

What are the stages in the process of integration and delivery

A

The stages for integration are Buld-> Unit Test-> Integration Test
The stages for Delivery are Staging->deployment

19
Q

What use CI/CD

A

Faster release cycle
Reliability
Reporting

20
Q

What problems solve the containers management

A

Deployment
Scalability
Monitoring
Routing
High-Avaliability

21
Q

Main Activities that cover Kubernetes

A

Routing
Scaling
High-Availability
Automated deployment
Configuration Management

22
Q

Which are the parts for the entity data model

A

Storage Model
Conceptual Model
Mapping

23
Q

What is DataAnnotation

A

In the properties of the entities we can add metaproperties to add characteristics and functionalities like example when the property is required in the table of the database

24
Q

What is fluent API?

A

We can add properties directly in the tables using the capacity of the language to use function lambda especially at the class DbContext in the method OnModelCreating

25
Q

How to apply relationships using entityframework

A

Using Data Annotations or Fluent API

26
Q

What are extension methods

A

Are the methods that use lambda functions in it’s sintax for example in use of linq

27
Q

How many joins has linq

A

Three types: Inner Join
Group Join
Cross Join

28
Q

What is lazy loading?

A

When we use entity framework some entities has a properties of the kind of other entity for example employee has employeRole, then when we recover a entity with the single method like Single the value of the property is queried until that property is used,

29
Q

What is Eager loading?

A

It is the opposite of lazy loading the entity is loaded with the minus number of queries possible. This is executed add at the middle of the linq query the method Include().

30
Q

What is explicit loading?

A

It is a load of data from database in an explicit way means its executed immediately after to execute the action. This is executed add at the end of the linq query the method Load().

31
Q

Explain Repository Pattern

A

Mediates between the domain and data mapping layers, acting like an in-memory collection of domain objects.

32
Q

What is the Unit of work pattern

A

Maintains a list of objects affected by a business transaction and coordinates the writing out of changes.

33
Q

What is swagger

A

Is the way how to dotnet core documented the functionality of his endpoints