Skip to content

Latest commit

 

History

History
 
 

Demo

Beef.Demo

This sample represents an end-to-end demonstration of the usage of Beef; as well as serving as the primary test vehicle of the overall code-generation and supporing execution framework.


Naming

There are two key attributes within the code-generation that drive the naming:

  • Company - the company name - for this sample we use: Beef
  • AppName - the application name - for this sample we use: Demo

This sample has been set up and named in accordance with the documented solution structure.


Beef.Demo.CodeGen

This is the primary entity-based code generation console that is at the heart of Beef.

A number of sample entities have been configured to demonstrate:

  • Beef.Demo.xml - business entity configuration:
    • Person - demonstrates ADO.NET and EntityFramework CRUD database activities.
    • Product - demonstrates ODATA queries against an example ODATA endpoint.
    • CustomerGroup - demonstrates ODATA CRUD activities against Dynamics 365.
  • Beef.RefData.xml - reference data configuration.

The Program.cs demonstrates how to configure the company and application name.

To test try the following command line executions:

dotnet run entity        # Generates only the entity using Beef.Demo.Xml
dotnet run refdata       # Generates only the reference data using Beef.RefData.Xml
dotnet run all           # Generates all (both entity and reference data)

Note: Database code generation can be driven from this project also; this is where the richer database and data manangement capabilities are not required.


Beef.Demo.Database

This is the optional database and data management console used where a SQL Server database is required and the documented approach is required.

The following demonstrates usage:

The Program.cs demonstrates how to configure the company, application name and default connection string.

To test try the following command line executions:

dotnet run all           # Database Create, Migrate, CodeGen, Schema and Data.
dotnet run drop          # Database Drop if it already exists.
dotnet run codegen       # Generates only the database Schema objects.

Beef.Demo.Test

This demonstrates the intra-integration tests; try running the tests and ensure they all pass.