- Extension ID
- What's new?
- Description
- In what situation should you install this extension?
- Technology support
- Function Point, Quality and Sizing support
- AIP Core compatibility
- Supported DBMS servers
- Prerequisites
- Download and installation instructions
- What results can you expect?
- Objects
- Links
- Code examples
- Insert operation
- Insert Operation through dbcontext.Set<T>
- Insert Operation through ObjectContext
- Delete operation
- Delete Operation through ObjectContext
- Batch Delete Operation through EF Plus
- Update Operation
- Batch Update Operation through EF Plus
- Bulk Operations through EFCore.BulkExtensions
- Select operation
- LINQ-To-Entities
- Support for EntityModelConfiguration
- Support for CRUD operations using dbContext
- Support for ExecuteSqlQuery
- Reading of edmx file
- Support for Table Per Hierarchy
- Assumptions
- Limitations
Summary: This document provides basic information about the extension providing Entity Framework support for C#.
Extension ID
com.castsoftware.entity
What's new?
See Entity Framework 2.2 - 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 links between objects produced by the base .NET Analyzer and database tables, using Entity Framework CRUD operations.
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:
- "call" links from C# methods using Entity Framework operations to Entity framework operation objects
- "use" links from Entity framework operation objects to participating Database tables
Technology support
The following .NET framework / Libraries are supported by this extension:
Framework / Library name | Version | Supported | Supported Technology | Comments |
---|---|---|---|---|
Entity Framework (EF, EF6) | 3.0 to 6.4.x | C# | ||
1.0.x to 7.0.x | C# | |||
1.6.4 to 7.21.0 | C# | |||
2.22.3 to 7.22.4 | C# | Same as above | ||
EFCore.BulkExtensions | 1.0 to 7.1 | C# | ||
LINQ to Entities - method syntax | C# |
Function Point, Quality and Sizing 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
Function Points (transactions) | |
---|---|
Quality and Sizing |
AIP Core compatibility
AIP Core release | Supported |
---|---|
8.3.x |
Supported DBMS servers
This extension is compatible with the following DBMS servers:
DBMS | Supported |
---|---|
CSS/PostgreSQL |
Prerequisites
An installation of any compatible release of AIP Core (see table above) |
Download and installation instructions
The extension will be automatically downloaded and installed in CAST Console. You can manage the extension using the Application - Extensions interface:
What results can you expect?
Once the analysis/snapshot generation has completed, you can view the results in the normal manner. The following links will be displayed in CAST Enlighten:
Objects
Icon | Object Type Description | Comment |
---|---|---|
Entity | Created when the DbSet Entity is declared in the derived class inheriting from DbContext | |
Entity Operation | Used when CRUD operation is performed on Entity | |
Entity SQL Query | Used for native queries |
Links
Link type | Source and destination of link | Methods supported |
---|---|---|
callLink useInsertLink | callLink between the caller .NET Class / Method object and Entity Operation useInsertLink between the Entity Operation object and Database Table object | |
callLink useDeleteLink | callLink between the caller .NET Class / Method object and Entity Operation useDeleteLink between the Entity Operation object and Database Table object | |
callLink useUpdateLink | callLink between the caller .NET Class / Method object and Entity Operation useUpdateLink between the Entity Operation object and Database Table object | |
callLink useSelectLink | callLink between the caller .NET Class / Method object and Entity Operation useSelecttLink between the Entity Operation object and Database Table object | |
callLink | callLink between the caller .NET Class / Method object and Entity SQL Query |
Code examples
Insert operation
Insert Operation through dbcontext.Set<T>
Insert Operation through ObjectContext
Delete operation
Delete Operation through ObjectContext
Batch Delete Operation through EF Plus
Update Operation
Batch Update Operation through EF Plus
Bulk Operations through EFCore.BulkExtensions
Select operation
LINQ-To-Entities
Support for EntityModelConfiguration
EntityModelConfiguration allows configuration to be performed for any entity type in a model. Support has be been provided to create callLink between method and entity operation object and appropriate crud link between entity operation object and table, when table name is overridden through EntityModelConfiguration.
Support for CRUD operations using dbContext
Support for ExecuteSqlQuery
Reading of edmx file
Support for Table Per Hierarchy
Assumptions
- SaveChanges() method of DbContext class commits the operation in the database table. Hence no useLink is created between caller method and table.
- When the class is referenced in other code as a property, parent and child relation is created. Any CRUD operation performed on parent class is also reflected in the child class. e.g. In the below case, data is deleted from Role_DalerComplaints_ProcessingStage, but useDeleteLink is created for both Role_DealerComplaints_ProcessingStage and DealerComplaint_ProcessingStages, as DealerComplaint_ProcessingStages is referenced in role_DealerComplaints_ProcessingStage(foreign key):
Limitations
- Analyzing the participating database tables is mandatory for the extension to produce appropriate useLinks
- Select operations performed through dbcontext.Set<T> are not supported
- LINQ-Entity Query syntax is not supported
- Unit of Work and Repository pattern are not supported