Entity Framework Flashcards
How to recovery information of the several tables using entity framework
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);
What is the difference between an API and Microservices
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.
What is dependency injection DI
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.
What is IoC (inversion of code)
That is a design pattern in which the control flow of a program is inverted. In the case of dotnet core use specialized classes
What classes use dotnet core to implement the DI
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 add the services in the service collection and what is its lifecycle?
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.
Which is the authentication strategy using the azure services
Single Sign On (SSO)
What are the characteristics of the microservices
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
Definition of pattern microservices
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.
Characteristic of the componentization
Independent deployment
Well define interface
Characteristics of the decentralized governance
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
Characteristics of the Infrastructure automatization
Short Deployment cycles
Automatic Testing
Automatic Deployment
Characteristics of the design for failure
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
Recommend attributes in Microservices
*Componentization
*Organized around business capacities
*Decentralized Governance
*Decentralized data
*Infrastructure automatization
Issues that microservices solve
*Single Technology Platform
*Inflexible deployment
*Inefficient resources use