• Home
  • About Us
  • Pricing
  • Products
    • AspCoreGen 6.0 MVC
    • AspCoreGen 3.0 Razor
    • AspCoreGen 3.0 MVC
    • AspCoreGen 2.0 Razor
    • AspCoreGen 2.0 MVC
    • AspxForsmgen MVC 5
    • AspxFormsGen 4.5
    • WinFormsGen
  • Blog
  • Contact Us

Data Layer

  • Home
  • Products
  • AspCoreGen 3.0 Razor Home
  • Data Layer

Generated Data Layer


Listed below are quick descriptions of the Data Layer class files (generated in the Class Library Project) AspCoreGen 3.0 Razor generates that makes up the Data Tier. In a 3-tier infrastructure, data layer code is called by the middle layer code. It contains calls to the database (stored procedures/Ad-Hoc SQL/linq-to-entities using Entity Framework Core).

One of each of the following objects listed below is generated per table in your database.

Generated Class (.cs) Quick Description (DataLayer Folder)
1. Data Layer Base Class

  - Sample Code

A class file containing methods communicating with the database. The methods encapsulates calls to stored procedures using linq-to-entities queries. Used as a base class.
2. Data Layer Class

  - Sample Code

A class file derived from the data layer base class. Additional methods may be added here.
Generated Entities (.cs) Quick Description (EF Folder)
1. Entity Framework Entities

  - Sample Code

A class file containing entity properties.
Generated Ad-Hoc SQL (.cs) Quick Description (SQL Folder)
1. Ad-Hoc SQL Scripts

  - Sample Code

A class file containing SQL Scripts.

Note: When generating code you can choose whether to generate Linq-to-Entities queries (EF Core), or Stored Procedures, or Ad-Hoc SQL. Stored procedures are generated directly in your Microsoft SQL Server. Linq-to-Entities queries (EF Core) or Ad-Hoc SQL are generated in this Class Library Project.

Accessing Code From the Middle Tier


To make it really simple, the Data Layer method signatures are very similar to the Middle Layer method signatures, we simply add a string constant "DataLayer" to the middle layer method name to call data layer objects. For example if the middle tier object name is Categories, then the respective data tier object name is CategoriesDataLayer. To call a data layer method you simply add a dot and then the method name; e.g. CategoriesLayer.TheMethodName();

Select Everything


// we generally don't assign to a variable
var allCategories = CategoriesLayer.SelectAll();

// instead, we simply return the collection to the calling middle tier method
return CategoriesLayer.SelectAll();


Accessing the Database from the Data Layer


As mentioned above, the database can now be accessed using either of the following:

1. Using Linq-To-Entities (Entity Framework Core)
2. Using Stored Procedures
3. Using Ad-Hoc SQL



Buy It Now
  • Professional Plus
  • 349.99
  • Add to Cart
More Info
  • Product Home
  • What's New
  • How It Works
  • N-Tier Layer
  • Generated Projects
  • Presentation Layer
  • Web API
  • Middle Layer
  • Data Layer
  • SQL Scripts
  • Miscellaneous
  • Demos & Examples
  • Screenshots
  • Pro Plus vs Express
  • Download Express
  • Tutorials
  • Requirements
  • Limitations
  • Recommendations
  • Notes
  • Release Notes
  • FAQs

Our company has been developing high-quality, reliable, easy-to-use code generators to help software developers worldwide since 2001. All our products are 100% Made in the United States of America.

Address
11956 Bernardo Plaza Dr. #255
City, State
San Diego, California
Country
United States of America

Subscribe



    Processing. Please wait....

Questions? Contact Us

  • Sales/Products
    ....please wait..
  • Software Support
    ....please wait..
  • Feedback
    ....please wait..
  • Careers/Jobs
    ....please wait..

© 2025 Junnark.Com Inc. All rights reserved.     Site Map    Videos    Terms of Use    Privacy Policy