AC Docs

../Service References/

Database Changes (DACPAC and Entity Framework)


DACPAC

A DACPAC (data-tier application package) is focused on capturing and deploying schema, including upgrading an existing database.

The primary use case for a DACPAC is to deploy a tightly defined schema to development, test, and then to production environments.

In the AssetCalc environment, the DACPAC project is currently named "ACNetDatabase".

Add a new table

In the steps below, we will be showing how to add a new table ac_Tests to the DACPAC project for AssetCalc.
The same process is used when working with Views, Stored Procedures or Functions.

1. Navigate to the folder you wish to modify (tables, views, stored procedures, or functions).

- Navigate to the Tables folder under the dbo folder

2. Add the new table ac_Tests



- Enter table name




- Enter table columns info
You can use the same designer window to make edits to a table (rename/drop fields, change data type/constraints etc)

Entity Framework

Entity Framework (EF) is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects.

It eliminates the need for most of the data-access code that developers usually need to write.

In the AssetCalc environment, the project handling EF related activies is "ACNetLib".

Add a new table

In the steps below, we will be adding to EF the table ac_Tests (created from the previous DACPAC steps).
The same process is used when working with Views, Stored Procedures or Functions.

1. Navigate to the EF model you wish to modify to add the ac_Tests.
We will be using the Entities2 edmx file for this example.

- Navigate to the Entities2.edmx file

2. Add the new table ac_Tests to the Entities2 model



- On the Update Wizard window, expand the Tables items to navigate to the ac_Tests table




- Save the changes to the Entities2 model