Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Analyzing the participating database tables is mandatory for the extension to work correctly.
  • No support for links between LINQ and SQL objects
  • Entity Framework objects are not correctly presented in the CAST dashboards
  • Enum Collections are not supported.
  • DBContexts are not supported.
  • The table name and DbSet name should be in same case. Link to Table not formed if table name and DbSet name are in different case.
Panel

Table of Contents

Info

Summary: This document provides basic information about the extension providing Entity Framework support for C# and VB.NET

Extension ID

com.castsoftware.entity

What's new?

See Entity Framework 1.4 - Release Notes for more information.

Description

This extension provides support for Entity Framework. The calculation of Automated Function Points for your .NET analyses will be supplemented through the creation of new objects and links specific to Entity Framework framework that will link back to objects/links produced by the base .NET analyzer.

In what situation should you install this extension?

If your .NET application contains Entity Framework source code and you want to view these object types and their links, then you should install this extension. More specifically the extension will identify:

  • "use" links from Entity Framework objects to participating Database tables
  • "rely on" links from C#/VB.NET Classes to Entity Wrapper objects

Technology support

Entity Framework

Entity Framework is delivered with the .NET Framework. Therefore the following .NET frameworks are supported by this extension:

...

Version

...

Supported

...

Entity Framework Core

...

Version

...

Supported

...

Supported Annotations in code-first

Code Block
languagec#
'System.Data.Entity.Core.Objects.DataClasses.EdmEntityTypeAttribute'
'System.Data.Entity.Core.Objects.DataClasses.EdmTypeAttribute.Name' 
'System.Data.Linq.EntityMapping.TableAttribute'
'System.Data.Objects.DataClasses.EdmEntityTypeAttribute'
'System.Data.Objects.DataClasses.EdmTypeAttribute.Name'
'System.ComponentModel.DataAnnotations.TableAttribute'
'System.ComponentModel.DataAnnotations.Schema.TableAttribute'
'System.ComponentModel.DataAnnotations.Schema.NotMapped'
'System.ComponentModel.DataAnnotations.Schema.NotMappedAttribute'
'System.ComponentModel.DataAnnotations.NotMappedAttribute'

Supported methods in fluent api

Code Block
languagec#
Microsoft.EntityFrameworkCore.ModelBuilder.Entity<TEntityType>()
Microsoft.EntityFrameworkCore.ModelBuilder.Conventions.Remove<TConvention>()
Microsoft.EntityFrameworkCore.DbContext.OnModelCreating( ModelBuilder modelBuilder )
System.Data.Entity.DbModelBuilder.Entity<TEntityType>()
System.Data.Entity.DbModelBuilder.Conventions.Remove<TConvention>()
System.Data.Entity.DbContext.OnModelCreating( DbModelBuilder modelBuilder )
System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<TEntityType>.ToTable(String)

Supported tags in .edmx file

Code Block
languagec#
<edmx:StorageModels>
	<EntityType>
	<Property>
	</Property>
	</EntityType>
	<Function>
	</Function>
</edmx:StorageModels>

<edmx:ConceptualModels>
	<EntityType>
	<Property>
	</Property>
	</EntityType>
	<FunctionImport>
	</FunctionImport>
</edmx:ConceptualModels>

<edmx:Mappings>
	<MappingFragment>
	<ScalarProperty>
	</ScalarProperty>
	</MappingFragment>
	<FunctionImportMapping>
	</FunctionImportMapping>
</edmx:Mappings>

Function Point, Quality and Sizing support

This extension provides the following support:

  • Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
  • Quality and Sizing: a green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist

...

CAST AIP compatibility

This extension is compatible with:

...

CAST AIP release

...

Supported

...

Supported DBMS servers

This extension is compatible with the following DBMS servers:

...

Prerequisites

...

Download and installation instructions

Include the extension using the interface in AIP Console:

Image Removed

There is nothing further to do. Follow the instructions below to run a new analysis/snapshot to generate new results:

CAST Transaction Configuration Center (TCC) configuration

In Entity Framework ≥ 1.1, if you are using the extension with CAST AIP ≥ 8.3.x, a set of Entity specific items are now automatically imported when the extension is installed. These items will be available in the CAST Transaction Configuration Center (click to enlarge):

Image Removed

Manual import action for CAST AIP ≤ 8.2.x (optional)

Expand
  • Locate the .TCCSetup file in the extension folder: Configuration\TCC\DotNet_Entity.TCCSetup
  • In the CAST Transaction Configuration Center, ensure you have selected the Templates node:

Image Removed

  • This .TCCSetup file is to be imported into the CAST Transaction Calibration Center using either the:
    • File > Import Configuration menu option:

Image Removed

    • Or right clicking on the Template node and selecting Import Configuration:

Image Removed

  • The import of the "DotNet_Entity.TCCSetup" file will provide you with a sample Transaction End point in the Free Definition node under Templates (click to enlarge):

Image Removed

  • Now right click the one of the items and select copy:

Image Removed

  • Paste the item into the equivalent node under the Application, for example, below we have copied it into the Application MEUDON:

Image Removed

  • Repeat the copy / paste process for all items.

What results can you expect?

Once the analysis/snapshot generation has completed, you can view the results in the normal manner. The following objects and links will be displayed in CAST Enlighten:

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Links

...

Image Removed

Info
Because CAST cannot be absolutely certain that the C#/VB.NET class is "entity associated", these rely-on links will always be flagged as "dynamic" and will therefore always appear in the Dynamic Link Manager for review.

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

Limitations

In this section we list the most significant functional limitations that may affect the analysis of applications using Entity Framework:

  • Analyzing the participating database tables is mandatory for the extension to work correctly.
  • No support for links between LINQ and SQL objects
  • Entity Framework objects are not correctly presented in the CAST dashboards
  • Enum Collections are not supported.
  • DBContexts are not supported.
  • The table name and DbSet name should be in same case. Link to Table not formed if table name and DbSet name are in different case.