concept database access layer in category c#

appears as: database access layer
Code like a Pro in C#

This is an excerpt from Manning's book Code like a Pro in C#.

  • “Inheriting Code”: In this part, I guide you through the exploration of a code base we inherit. This part is a detailed walkthrough of the existing code base, with a discussion on potential improvements and design flaws.
  • Figure 5.1 In this chapter we start the process of re-implementing the Flying Dutchman Airlines codebase. We start with the database access layer. In the following chapters, we look at the repository layer, service layer, and controller layer.

    Exercise Number

    Answer

    Explanations

    10.1

    B

     

    10.2

    False

    The repository layer typically interacts with a database through a database access layer when using an ORM.

    10.3

    True

     

    10.4

    True

     

    10.5

    A

     

    10.6

    C

    We never want to delete code without worrying about the side effects. When encountering commented out code, do your due diligence to figure out why it is there. There better be a really good excuse or else delete it. 99 percent of the time, you can delete the code without issue.

    10.7

    D

     

    10.8

    A

     

    10.9

    True

     

    10.10

    C

     

    10.11

    True

    Whilst there is still some coupling between controller and repository, this is looser coupling when compared to the controller directly calling the repository.

    10.12

    False

    This is the functionality of a stub.

    10.13

    False

    The InternalsVisibleTo allows you to expose an assembly’s internals to a different assembly.

    10.14

    C

     

    10.15

    True

     

    10.16

    B

     

    10.17

    A

    [MethodImpl(MethodImplOptions.NoInlining)] can only be applied to methods