💻
Software Development
Technical Knowledges
Technical Knowledges
  • Everything anyone should know
    • Fundamental
      • Life cycle of Dependency Injection
        • When to use?
          • Transient
          • Scoped
          • Singleton
      • OOP
        • Inheritance
          • More with override in C#
            • Why need to use "virtual" keyword when we can use "new" keyword
          • How to achieve multiple inheritance in C#
          • Note
        • Polymophism
        • Encapsulation
        • Abtraction
          • Not use "override" keyword in abstract method
          • Notes
      • Data representing
        • JSON
        • XML
        • Comparation
      • Middleware
      • Status Code
      • API Styles
        • SOAP
        • REST
          • Question
        • GraphQL
        • gRPC
        • WebSocket
        • Webhook
        • Comparation
          • SOAP vs REST
          • REST vs GraphQL
          • gRPC vs REST
          • HTTP vs WebSocket
      • SDK
    • Advanced
      • Memoize
      • N+1 issues
      • Concurrency
        • Thread
          • Race Condition
          • Thread Safety
          • Critical Sections
        • Deadlock
        • Semaphore
    • Comparison
      • Architecture
        • SOA vs Microservices
        • Strong Consistency vs Eventual Consistency
      • Data structures
        • Instance vs Object
        • Field vs Property
        • Properties vs Method
        • Class vs Struct
        • const vs readoly vs static
        • Value types and Reference types
        • i++ vs ++i
        • Prototypal Inheritance vs Class Inheritance
        • Abstraction vs Interface
        • Run-time vs Compile-time
        • Overloading vs Overriding
      • Front-end
        • SSR vs SPA
        • Axios vs Fetch
      • Databases
        • Different between Function() and Store Procedure()
      • Security
        • Encoding vs Encryption vs Tokenization
      • Message Broker
        • RabbitMQ vs Kafka
      • Devops
        • Kubernetes vs Docker Swarm
        • Docker Repository vs Docker Registry
      • Cloud
      • Computer Science
        • Recursion and Iteration
      • Technology
        • .NET Core vs .NET Framework
        • Cache vs Local Storage vs Session Storage vs Cookies
      • SDLC
        • TDD vs BDD
  • Design Pattern
    • Overview
    • Creational Design Patterns
      • Abstract Factory
        • Code Example
          • C#
          • Java
          • Python
      • Builder
        • Code Example
          • C#
          • Java
          • Python
      • Factory Method
        • Code Example
          • C#
          • Java
          • Python
      • Prototype
        • Code example
          • C#
          • Java
          • Python
      • Singleton
        • Code example
          • C#
            • Naïve Singleton
            • Thread-safe Singleton
          • Java
            • Naïve Singleton (single-threaded)
            • Naïve Singleton (multithreaded)
            • Thread-safe Singleton with lazy loading
          • Python
            • Naïve Singleton
            • Thread-safe Singleton
    • Structural Design Patterns
      • Adapter
        • Code example
          • C#
          • Java
          • Python
            • Conceptual Example (via inheritance)
            • Conceptual Example (via object composition)
      • Bridge
        • Code example
          • C#
          • Java
          • Python
      • Composite
        • Code example
          • C#
          • Java
          • Python
      • Decorator
        • Code example
          • C#
          • Java
          • Python
      • Facade
        • Code example
          • C#
          • Java
          • Python
      • Flyweight
        • Code example
          • C#
          • Java
          • Python
      • Proxy
        • Code example
          • C#
          • Java
          • Python
    • Behavior Design Patterns
      • Chain of Responsibility
        • Code example
          • C#
          • Java
          • Python
      • Command
        • C#
        • Java
        • Python
      • Interpreter
        • Code example
          • C#
      • Iterator
        • Code example
          • C#
          • Java
          • Python
      • Mediator
        • Code example
          • C#
          • Java
          • Python
      • Memento
        • Code example
          • C#
          • Java
          • Python
      • Observer
        • Code example
          • C#
          • Java
          • Python
      • State
        • Code example
          • C#
          • Java
          • Python
      • Strategy
        • Code example
          • C#
          • Java
          • Python
        • Different with using abstract class
      • Template Method
        • Code example
          • C#
          • Java
          • Python
      • Visitor
        • Code example
          • C#
          • Java
          • Python
    • Use cases
      • Real-life example
    • More
      • Circuit Breaker Pattern
      • Repository Pattern
      • Unit Of Work Pattern
    • Some design patterns contradictory
  • Architect
    • Clean Architecture
    • Layered (n-tier) Architecture
    • Microservices Architecture
    • Monolithic Architecture
    • Service-Oriented Architecture (SOA)
    • Domain-Driven Design (DDD)
    • Blackboard Architecture
    • Object-Oriented Architecture
  • Microservices Design Pattern
    • Saga Pattern
      • Example
    • Strangler Fig Pattern
    • API Gateway Pattern
    • Backends For Frontends (BFF) Pattern
    • Service Discovery Pattern
    • Circuit Breaker Pattern
    • Bulk Head Pattern
    • Retry Pattern
    • Sidecar Pattern
    • Event Driven Architecture Pattern
    • CQRS (Command and Query Responsibility Segregation)
      • Event Sourcing
      • Code example
        • Basic
        • CQRS + MediatR + EDA + RabbitMQ
      • The Good, the Bad, and the Ugly
    • Configuration Externalization Pattern
  • Design and development principles
    • SOLID aka Design Principles
    • Cohesion Principles
    • Coupling principle
    • Some fundamental principles
      • Separation of Concerns
      • Persistence Ignorance
      • DRY
      • KISS
  • Authentication and Authorization Standards
    • SAML
    • OAuth
    • OIDC
    • SCIM
    • SSO
    • Tools
      • Keycloak
    • More
      • JWT
      • Access Token & Refresh Token
  • .NET TECHNOLOGY
    • .NET MVC
      • HTML Helpers
        • Extension method for HTML Helpers
      • Filters
        • Order of Filters
    • Fundamental
      • Startup file
      • Query Data
        • Linq
          • Filtering
          • Sorting
          • Projecting
          • Quantifying
          • Flattening
          • Grouping
          • Joining
          • Aggregating
          • Deferred execution vs Immediate execution
        • OData
          • Filter Expression
      • ORM
        • Entity Framework
          • Eager Loading vs Lazy Loading vs Explicit Loading
          • How to improve our entity framework core query performance
        • Dapper
        • Why Dapper faster than Entity Framework
      • Identity Server
      • Fluent Validation
      • Minimal API
      • Generic
      • IoC
        • Castle Windsor
        • Autofac
        • Ninject
      • CLR
      • Refit
      • Task Schedule
        • Hangfire
        • Quartz
      • Some notice
    • Advanced
      • Multi Thread
        • Thread pool
        • Parallel
        • Comparation
        • Code comparation
      • Caching
        • IMemoryCache
      • MediatR
      • SignalR
      • API Gateway
        • Ocelot
      • gRPC
      • Multitenancy
      • Special C# technique
        • Generic
        • Extension Method
        • Delegate
        • Lambda Expression
        • Yield
      • Jetbrain tools
        • dotTrace
        • dotMemory
        • dotPeek
      • ABP Framework
        • Multi Layered
          • Domain Layer
            • Entities
            • Repository
            • Domain Services
          • Application Layer
            • Application Services
            • Data Transfer Objects
          • Data Access
            • Entity Framework Core Integration
            • MongoDB Integration
        • Microservice Architecture
        • DDD
          • Domain Layer
            • Entities & Aggregate Roots
            • Value Objects
            • Repositories
            • Domain Services
            • Specifications
          • Application Layer
            • Application Services
            • Data Transfer Objects
            • Unit of Work
    • Tutorial Coding
      • Custom and Using Middleware in .NET CORE
      • Connect Elastic Search and MongoDB
      • Implementing the Unit of Work Pattern in Clean Architecture with .NET Core
    • ServiceStack
    • POCO
  • System Design
    • Blueprint
    • Fundamental
      • Scale from zero to millions of users
        • Single server setup
        • Database
        • Load balancer
        • Database replication
        • Cache
        • Content delivery network (CDN)
        • Stateless web tier
        • Data centers
        • Message queue
        • Logging, metrics, automation
        • Database scaling
        • Millions of users and beyond
      • A framework for system design interviews
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
        • Step 3 - Design deep dive
        • Step 4 - Wrap up
        • Summarize
      • Back-of-the-envelope estimation
      • Design a rate limiter
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
          • Algorithms for rate limiting
            • Token bucket algorithm
            • Leaking bucket algorithm
            • Fixed window counter algorithm
            • Sliding window log algorithm
            • Sliding window counter algorithm
          • High-level architecture
        • Step 3 - Design deep dive
          • Rate limiting rules
          • Exceeding the rate limit
          • Detailed design
          • Rate limiter in a distributed environment
          • Performance optimization
          • Monitoring
        • Step 4 - Wrap up
      • Design consistent hashing
        • Consitent hashing
        • Two issues in the basic approach
        • Wrap up
      • Design key-value store
        • Understand the problem and establish the design scope
        • CAP theorem
        • System components
          • Data partition
          • Data replication
          • Consistency
          • Inconsistency resolution
          • Handling failures
          • System architecture diagram
          • Write path
          • Read path
      • Design a unique id generator in distributed systems
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
          • Multi-master replication
          • UUID
          • Ticket Server
          • Twitter snowflake approach
        • Step 3 - Design deep dive
        • Step 4 - Wrap up
      • Design a url shortener
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
        • Step 3 - Design deep dive
          • Data model
          • Hash function
          • URL shortening deep dive
          • URL redirecting deep dive
        • Step 4 - Wrap up
      • Design a web crawler
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
        • Step 3 - Design deep dive
          • DFS vs BFS
          • URL frontier
          • HTML Downloader
          • Robustness
          • Extensibility
          • Detect and avoid problematic content
        • Step 4 - Wrap up
    • Use cases
      • Design Youtube
      • Design Social Media App
      • Design Typehead Suggestion
      • Design Taxi Booking System
      • Design Messaging App
  • DBMS
    • Fundamental
      • ACID
      • Order Of Execution of the SQL query
      • Transaction – Concurrency Control Techniques
        • Isolation level
      • Index
        • Clustered Index vs Non-clustered index
        • Index vs Unique index
      • Built-in functions
        • String Functions
          • ASCII
          • CHAR
          • CHARINDEX
          • CONCAT
          • CONCAT_WS
          • DATALENGTH
          • DIFFERENCE
          • FORMAT
          • LEFT
          • LEN
          • LOWER
          • LTRIM
          • NCHAR
          • PATINDEX
          • QUOTENAME
          • REPLACE
          • REPLICATE
          • REVERSE
          • RIGHT
          • RTRIM
          • SOUNDEX
          • SPACE
          • STR
          • STUFF
          • SUBSTRING
          • TRANSLATE
          • TRIM
          • UNICODE
          • UPPER
        • Numeric Functions
          • ABS
          • ACOS
          • ASIN
          • ATAN
          • ATN2
          • AVG
          • CEILING
          • COUNT
          • COS
          • DEGREES
          • EXP
          • FLOOR
          • LOG
          • LOG10
          • MAX
          • MIN
          • PI
          • POWER
          • RADIANS
          • ROUND
          • SIGN
          • SIN
          • SQRT
          • SQUARE
          • SUM
          • TAN
        • Date Functions
          • CURRENT_TIMESTAMP
          • DATEADD
          • DATEDIFF
          • DATEFROMPARTS
          • DATENAME
          • DATEPART
          • DAY
          • GETDATE
          • GETUTCDATE
          • ISDATE
          • MONTH
          • SYSDATETIME
          • YEAR
        • Advance Functions
          • CASE
          • CAST
          • COALESCE
          • CONVERT
          • CURRENT_USER
          • LEAD
          • LAG
          • IIF
          • ISNULL
          • ISNUMERIC
          • NULLIF
          • SESSION_USER
          • SESSIONPROPERTY
          • SYSTEM_USER
          • USER_NAME
      • SQL Best Practice
      • Execution Plan
      • Optimize query execution
    • Advanced
      • CTE
      • Window function
      • Performance Tuning
        • Query tuning
        • Interview ques
      • DB Sharding
      • Concurrency Control
        • Optimistic lock
        • Pessimistic lock
      • Compare DELETE VS TRUNCATE
    • Comparation
      • Oracle vs SQL Server vs Postgre vs Mysql
  • Javascript
    • ES6 Techniques
      • Hoisting
      • Destructing
      • Spread Operator
      • Rest Operator
    • Basic
      • Const vs Let vs Var
      • Debounce & Throttle
      • Callback()
    • 5 ways to define a function
  • Clean code
    • Page 2
  • Search Engine
    • Elastic Search
      • Interview question
      • Code Example
    • Solr
    • IBM Watson Discovery
    • Google Cloud Search
    • Coveo Relevance Cloud
  • Cloud Service
    • Overview
    • Azure
      • Certificate
        • AZ-900
          • Describe cloud concepts
            • What is Cloud Computing?
            • Benefits of using cloud services
              • High Availability and Scalability
              • High Elasticity
              • High Reliability and Predictability
              • High Security and Governance
              • High manageability
            • IaaS vs PaaS vs SaaS
            • Cloud Deployment Models
            • CAPEX vs OPEX
          • Describe Azure architecture and services
            • Describe the core architectural components of Azure
              • Learn sandbox
              • Azure physical infrastructure
              • Azure management infrastructure
              • Create an Azure resource
            • Describe Azure compute and networking services
              • Azure Virtual Machines
              • Create an Azure Virtual Machine
              • Azure Virtual Desktop
              • Azure Containers
              • Azure Function
              • Describe application hosting options
              • Configure network access
              • Describe Azure Virtual Networking
              • Azure Virtual Private Networks
              • Azure ExpressRoute
              • Azure DNS
            • Describe Azure storage services
              • Azure storage accounts
              • Azure storage redundancy
              • Azure storage services
              • Create a storage blob
              • Identify Azure data migration options
              • Identify Azure file movement options
            • Describe Azure identity, access, and security
              • Azure directory services
              • Azure authentication methods
              • Azure external identities
              • Azure conditional access
              • Azure role-based access control
              • Zero trust model
              • Defense-in-depth
              • Microsoft Defender for Cloud
          • Describe Azure management and governance
            • Describe cost management in Azure
              • Factors that can affect costs in Azure
              • Compare the Pricing and Total Cost of Ownership calculators
              • Estimate workload costs by using the Pricing calculator
              • Compare workload costs using the TCO calculator
              • Azure Cost Management tool
            • Describe features and tools in Azure for governance and compliance
              • Azure Blueprints
              • Azure Policy
              • Purpose of resource locks
              • Configure a resource lock
              • Service Trust portal
            • Describe features and tools for managing and deploying Azure resources
              • Tools for interacting with Azure
              • Azure Arc
              • Azure Resource Manager and Azure ARM templates
            • Describe monitoring tools in Azure
              • Azure Advisor
              • Azure Service Health
              • Azure Monitor
        • SC-900
          • Describe the concepts of security, compliance, and identity
            • Describe security and compliance concepts
              • Shared responsibility model
              • Defense in depth
              • Zero Trust model
              • Encryption and hashing
              • Compliance concepts
            • Describe identity concepts
              • Authentication and authorization
              • Identity as the primary security perimeter
              • Role of the identity provider
              • Directory services and Active Directory
              • Federation
          • Describe the capabilities of Microsoft Azure Active Directory, part of Microsoft Entra
            • Describe the services and identity types of Azure AD
              • Azure Active Directory
              • Available Azure AD editions
              • Azure AD identity types
              • Types of external identities
              • Concept of hybrid identity
            • Describe the authentication capabilities of Azure AD
              • Authentication methods available in Azure AD
              • Multi-factor authentication (MFA) in Azure AD
              • Self-service password reset (SSPR) in Azure AD
              • Password protection and management capabilities of Azure AD
            • Describe the access management capabilities of Azure AD
              • Conditional Access in Azure AD
              • Benefits of Azure AD roles and role-based access control
            • Describe the identity protection and governance capabilities of Azure AD
              • Identity governance in Azure AD
              • Entitlement management and access reviews
              • Privileged identity Management
              • Azure Identity Protection
          • Describe the capabilities of Microsoft security solutions
            • Describe basic security capabilities in Azure
              • Azure DDoS protection
              • Azure Firewall
              • Web Application Firewall
              • Network segmentation in Azure
              • Azure Network Security groups
              • Azure Bastion and JIT Access
              • Describe ways Azure encrypts data
            • Describe security management capabilities of Azure
              • Cloud security posture management
              • Microsoft Defender for Cloud
              • Enhanced security of Microsoft Defender for Cloud
              • Microsoft cloud security benchmark and security baselines for Azure
            • Describe security capabilities of Microsoft Sentinel
              • SIEM and SOAR
              • How Microsoft Sentinel provides integrated threat management
              • Understand Sentinel costs
            • Describe threat protection with Microsoft 365 Defender
              • Microsoft 365 Defender services
              • Microsoft Defender for Office 365
              • Microsoft Defender for Endpoint
              • Microsoft Defender for Cloud Apps
              • Microsoft Defender for Identity
              • Microsoft 365 Defender portal
          • Describe the capabilities of Microsoft compliance solutions
            • Describe the Service Trust Portal and privacy at Microsoft
              • Service Trust Portal
              • Microsoft's privacy principles
              • Microsoft Priva
            • Describe the compliance management capabilities in Microsoft Purview
              • Microsoft Purview compliance portal
              • Compliance Manager
              • Describe use and benefits of compliance score
            • Describe information protection and data lifecycle management in Microsoft Purview
              • Know your data, protect your data, and govern your data
              • Data classification capabilities of the compliance portal
              • Sensitivity labels and policies
              • Data loss prevention
              • Retention policies and Retention labels
              • Records management
            • Describe insider risk capabilities in Microsoft Purview
              • Risk management
              • Communication compliance
              • Information barriers
            • Describe the eDiscovery and audit capabilities of Microsoft Purview
              • eDiscovery solutions in Microsoft Purview
              • Audit solutions in Microsoft Purview
            • Describe resource governance capabilities in Azure
              • Azure Policy
              • Azure Blueprints
              • Capabilities in the Microsoft Purview governance portal
        • DP-900
          • Core Concept
            • Explore core data concepts
              • Data formats
              • File storage
              • Databases
              • Transactional data processing
              • Analytical data processing
            • Explore data roles and services
              • Job roles in the world of data
              • Identify data services
          • Relational Data in Azure
            • Explore fundamental relational data concepts
              • Relational data
              • Normalization
              • SQL
              • Database objects
            • Explore relational database services in Azure
              • Azure SQL services and capabilities
              • Azure services for open-source databases
              • Exercise: Explore Azure relational database services
          • Non-relational data in Azure
            • Explore Azure Storage for non-relational data
              • Azure blob storage
              • Azure DataLake Storage Gen2
              • Azure Files
              • Azure Tables
              • Exercise: Explore Azure Storage
            • Explore fundamentals of Azure Cosmos DB
              • Azure Cosmos DB
              • Identify Azure Cosmos DB APIs
              • Exercise: Explore Azure Cosmos DB
          • Data analytics in Azure
            • Explore fundamentals of large-scale data warehousing
              • Data warehousing architecture
              • Data ingestion pipelines
              • Analytical data stores
              • Exercise: Explore data analytics in Azure with Azure Synapse Analytics
            • Explore fundamentals of real-time analytics
              • Understand batch and stream processing
              • Explore common elements of stream processing architecture
              • Azure Stream Analytics
              • Exercise: Explore Azure Stream Analytics Completed
              • Apache Spark on Microsoft Azure
              • Exercise: Explore Spark Streaming in Azure Synapse Analytics Completed
            • Explore fundamentals of data visualization
              • Power BI tools and workflow
              • Core concepts of data modeling
              • Considerations for data visualization
              • Exercise – Explore fundamentals of data visualization with Power BI Completed
        • AI-900
      • Azure Subscription
      • Azure App Service
      • Azure Dictionary B2C
      • Azure Front Door
      • Azure Traffic Manager
      • Azure Load Balancer
      • Azure KeyVault
      • API Management
      • Azure Logic Apps
      • Azure Metric and Logs
      • Azure Workbooks
      • Azure Messaging Services
      • Azure Service Fabric
      • Comparison
        • Durable Function vs Logic App
        • Storage queues vs Service Bus queues
        • Event Grid vs Service Bus
    • AWS
      • Certificate
        • CLF-C02
          • Cloud Concepts
            • Cloud Computing
            • The Deployment Models of the Cloud
            • The Five Characteristics of Cloud Computing
            • Six Advantages of Cloud Computing
            • Problems solved by the Cloud
            • Types of Cloud Computing
            • Pricing of the Cloud
            • AWS Global Infrastructure
              • AWS Regions
              • AWS Availability Zones
              • AWS Points of Presence (Edge Locations)
            • Tour of the AWS Console
            • Shared Responsibility Model diagram
          • Security & Compliance
            • AWS Shared Responsibility Model
            • DDOS
            • Network Firewall
            • Penetration Testing on AWS Cloud
            • Encryption
            • AWS Certificate Manager (ACM)
            • AWS Secrets Manager
            • AWS Artifact (not really a service)
            • Amazon GuardDuty
            • Amazon Inspector
            • AWS Config
            • AWS Macie
            • AWS Security Hub
            • Amazon Detective
            • AWS Abuse
            • Root user privileges
            • IAM Access Analyzer
            • Summary
            • Advanced Identity
              • STS
              • Cognito
              • Directory Services
              • IAM Identity Center
              • Summary
          • Cloud Technology & Services
            • IAM
              • IAM: Users & Groups
              • IAM: Permissions
              • IAM Policies inheritance
              • IAM Policies Structure
              • IAM – Password Policy
              • Multi-Factor Authentication - MFA
              • How can users access AWS?
                • AWS CLI
                • AWS SDK
              • IAM Roles for Services
              • IAM Security Tools
              • IAM Guidelines & Best Practices
              • Shared Responsibility Model for IAM
              • Summary
            • EC2
              • Overview
              • EC2 Instance Types
                • Overview
                • General Purpose
                • Compute Optimized
                • Memory Optimized
                • Storage Optimized
                • Example
              • Security Groups
              • SSH in EC2
              • EC2 Instance Purchasing Options
                • On-Demand Instances
                • Reserved Instances
                • Savings Plans
                • Spot Instances
                • Dedicated Hosts
                • Dedicated Instances
                • Capacity Reservations
                • Summary
              • EC2 Instance Storage
                • EBS
                • EBS Snapshot
                • AMI
                • EC2 Image Builder
                • EC2 Instance Store
                • EFS
                • Shared Responsibility Model for EC2 Storage
                • Amazon FSx
                • Summary
            • ELB & ASG
              • High Availability, Scalability, Elasticity
              • ELB
              • ASG
              • Summary
            • Amazon S3
              • Overview
              • Security
              • Techniques
              • Shared Responsibility Model for S3
              • AWS Snow Family
              • Summary
            • Database & Analytics
              • Overview
              • RDS & Aurora
              • Amazon ElastiCache
              • DynamoDB
              • Redshift
              • EMR
              • Amazon Athena
              • Amazon QuickSight
              • DocumentDB
              • Amazon Neptune
              • Amazon QLDB
              • Amazon Managed Blockchain
              • AWS Glue
              • DMS – Database Migration Service
              • Summary
            • Other Compute Service
              • Docker
              • ECS
              • Fargate
              • ECR
              • AWS Lamda
              • Amazon API Gateway
              • AWS Batch
              • Amazon Lightsail
              • Summary
                • Other Compute - Summary
                • Lambda Summary
            • Deploying and Managing Infrastructure
              • CloudFormation
              • CDK
              • Elastic Beanstalk
              • AWS CodeDeploy
              • AWS CodeCommit
              • AWS CodePipeline
              • AWS CodeArtifact
              • AWS CodeStar
              • AWS Cloud9
              • SSM
              • AWS OpsWorks
              • Summary
            • Global Infrastructure
              • Overview
              • Route 53
              • CloudFront
              • AWS Global Accelerator
              • AWS Outposts
              • AWS WaveLength
              • AWS Local Zones
              • Global Applications Architecture
              • Summary
            • Cloud Integration
              • Overview
              • SQS
              • Kinesis
              • SNS
              • MQ
              • Summary
            • Cloud Monitoring
              • CloudWatch
              • EventBridge
              • CloudTrail
              • X-Ray
              • CodeGuru
              • Health Dashboard
              • Summary
            • VPC
              • Overview
              • IP Addresses in AWS
              • VPC Diagram
              • Core networking
              • VPC Flow Logs
              • VPC Peering
              • VPC Endpoints
              • AWS PrivateLink (VPC Endpoint Services)
              • Site to Site VPN & Direct Connect
              • AWS Client VPN
              • Transit Gateway
              • Summary
            • Machine Learning
              • Rekognition
              • Transcribe
              • Polly
              • Translate
              • Lex & Connect
              • Comprehend
              • SageMaker
              • Forecast
              • Kendra
              • Personalize
              • Textract
              • Summary
            • Other Services
              • WorkSpaces
              • AppStream 2.0
              • IoT Core
              • Elastic Transcoder
              • AppSync
              • Amplify
              • Device Farm
              • Backup
              • Disaster Recovery Strategies
              • AWS Elastic Disaster Recovery (DRS)
              • DataSync
              • Application Discovery Service
              • Application Migration Service (MGN)
              • Migration Evaluator
              • Migration Hub
              • FIS
              • Step Functions
              • Ground Station
              • Pinpoint
          • Account Management, Billing & Support
            • Organizations
            • SCP
            • Control Tower
            • RAM
            • Service Catalog
            • Savings Plan
            • AWS Compute Optimizer
            • Billing and Costing Tools
            • Pricing Calculator
            • Tracking costs in cloud
              • Cost Explorer
            • Monitoring costs in the could
            • AWS Cost Anomaly Detection
            • AWS Service Quotas
            • Trusted Advisor
            • Support Plans
            • Summary
              • Account Best Practices
              • Billing and CostingTools
          • AWS Architecting & Ecosystem
            • General Guiding Principles
            • Well Architected Framework
              • Operational Excellence
              • Security
              • Reliability
              • Performance Efficiency
              • Cost Optimization
              • Sustainability
            • AWS CAF
            • AWS Right Sizing
            • AWS Ecosystem
      • Comparison
        • Region, Availability Zone and Edge Location in AWS
        • EBS vs EFS
    • GCP
    • OCI
    • Object Storage Server
      • MinIO
    • Comparison
      • Azure Active Directory B2C vs AWS Cognito
  • Front End
    • Basic
      • HTML
        • <ul> vs <ol>
        • <table>
      • CSS
        • Padding
        • Box Model
        • Outline
        • Text
        • Display
        • Position
        • z-index
        • Overflow
        • Float
        • Inline vs Inline-block
        • CSS Combinators
        • CSS [attribute] Selector
        • Website Layout
        • Unit
        • CSS The !important Rule
        • Flexbox
        • Comparation
          • div.classname vs div .classname
          • .classname vs .clasname #id vs .classname#id
      • JQuery
        • Syntax
        • Document
      • AJAX
    • Modern Framework
      • React
        • HOC
        • State Management
          • Redux
            • Selector
            • Middleware
              • Saga
              • Thunk
          • MobX
        • Hooks
        • Life Cycle
          • React Lifecycle Methods
          • React Lifecycle Hooks
          • Comparation
        • Signals
      • Angular
        • Directives
          • Component Directives
          • Attribute Directives
            • Built-in
            • Building an Attribute Directive
          • Structural Directives
            • Built-in
            • Custom
        • Binding
        • Components
        • Routing
      • Vue
    • Compile & Module
      • Webpack
      • Babel
    • TypeScript
      • Cheat sheet
    • Blazor
      • WebAssembly
    • UI Library
      • Formik
      • Material UI
      • Tailwind CSS
    • Security
      • Top 7 Common Frontend Security Attacks
    • Some notices
  • Microservices
    • Service Mesh
    • Service Registry
    • Service Discovery
    • Composition
    • Orchestration
    • Transformation
    • Dapr
  • Network
    • Protocols
      • Overview
      • HTTP
      • MQTT
      • AMQP
      • FTP
      • TCP
      • UDP
      • ICMP
    • OSI Model
  • Cache
    • Redis
      • What data should and should not be cached
      • Use cache in
      • Demo in .NET
    • Hazelcast
    • Memcached
  • Message Broker
    • RabbitMQ
      • Demo in .NET
      • Interview Ques
      • Use case
    • Kafka
      • Top 5 Kafka Use Case
    • ActiveMQ
    • Masstransit
  • Bash Script
    • Linux file system
    • Cheat sheet
    • 18 Most-used Linux Commands
    • Interview Question
  • Devops
    • Overview
      • What is ?
      • IaC
      • SAFe
      • Progressive Delivery
        • Blue Green Deployments
        • Canary Deployments
        • A/B Test
      • Platform Engineering
    • Azure Pipeline
    • Docker
      • What is ?
      • Docker Engine
        • Image
        • Docker file
          • Some commands
        • Container
        • Network
        • Volume
          • Additional infomation
      • Docker CLI
      • Docker Compose
        • Additional
      • Docker Security
        • Best Practice
        • Additional Information
      • Docker Swarm
      • Storing
        • Docker Registry
        • Docker Hub
      • Summarize
    • Kubernetes
      • What is ?
        • Additional
      • Kubernetes Pod
      • Replication Controllers
      • ReplicaSets and DaemonSets
        • Additional
      • Kubernetes Services
      • Deployment
        • Additional
      • Volume
      • PersistentVolumes
        • Additional
      • Configuration
        • Additional
      • StatefulSets
        • Additional
      • Downward API
      • Kubernetes internals architecture
      • Pod internal
      • ServiceAccount and Role Based Access Control
      • Network
        • Additional
      • Managing and calculating resources used for Pods
      • Automatic scaling Pods and clusters
      • Advanced scheduling
        • Taints and tolerations
        • Node affinity and Pod affinity
        • Additional
      • Adding custom resource to Kubernetes
    • Openshift
    • IaC
      • Terraform
        • Definition
        • Why chose Terraform?
        • IAC with Terraform
          • Terraform Workflow
            • Terraform Init
            • Terraform Plan
            • Terraform Apply
            • Terraform Destroy
          • Terraform Syntax
        • Terraform Architecture
          • Variable in terraform
          • Variable Type Contraint
          • Terraform Output
          • Terraform Provisioners
        • Terraform State
          • The concept
          • Local and Remote State Storage
          • Persisting Terraform State in AWS S3
          • Hand on
        • Terraform Modules
          • Accessing and Using Terraform Modules
          • Interating with Terraform Module Inputs and Outputs
          • Hand on
        • Built-in Functions and Dynamic Blocks
          • Built-in Function
          • Terraform Type Constraints (Collection & Structural)
          • Terraform Dynamic Block
          • Hand on
        • Terraform CLI
          • Terraform CLI: fmt, taint & import
          • Hand on
            • Practicing Terraform CLI commands(fmt, taint, import)
            • Using Terraform CLI Commands (workspace and state) to Manipulate a Terraform deployment
      • Ansible
    • Jenkin
    • GitOps
      • What is ?
      • Argo CD
    • Monitoring
      • Prometheus and Grafana
      • New Relic
  • Web Server
    • Apache
    • Nginx
    • IIS
  • Security
    • How to prevent crawl data
    • SQL Injection
    • OWASP
      • Web Application Security Risks
        • Broken Access Control
        • Cryptographic Failures
        • Injection
        • Insecure Design
        • Security Misconfiguration
        • Vulnerable and Outdated Components
        • Identification and Authentication Failures
        • Software and Data Integrity Failures
        • Security Logging and Monitoring Failures
        • Server-Side Request Forgery
      • API Security Risks
        • Broken Object Level Authorization
        • Broken Authentication
        • Broken Object Property Level Authorization
        • Unrestricted Resource Consumption
        • Broken Function Level Authorization
        • Unrestricted Access to Sensitive Business Flows
        • Server Side Request Forgery
        • Security Misconfiguration
        • Improper Inventory Management
        • Unsafe Consumption of APIs
    • Security headers
      • HTTP Strict Transport Security (HSTS)
      • Content Security Policy (CSP)
      • Cross Site Scripting Protection (X-XSS-Protection)
      • X-Frame-Options
      • X-Content-Type-Options
      • X-Permitted-Cross-Domain-Policies
      • Public Key Pinning (PKP)
        • What is HTTP Public Key Pinning and Why It’s Not Good to Practice
      • Expect-CT
        • The end of Expect-CT
      • Referer-Policy
      • Pragma
      • Cache-Control
        • Difference between Pragma and Cache-Control headers
      • Same-origin policy
      • Cross-origin resource sharing (CORS)
  • Data Change Capture (CDC)
    • Debezium
  • Software Development Life Cycle (SDLF)
    • Waterfall
    • V Model
    • Agile
      • Methods
        • Xtreme Programming
          • TDD
          • BDD
        • Scrum
        • Kanban
      • Question
  • Secure Software Development Framework (SSDF)
    • Page 1
  • Source Control
    • Git
    • SVN
    • TFS
  • Integration Systems
    • Stripe
    • Salesforce
    • TaxJar
    • Zendesk
  • Enterprise Service Bus (ESB)
    • Mulesoft
  • Data
    • 5 type of analytics
  • SOFTWARE QUALITY STANDARDS – ISO 5055
    • Standard
    • All about ISO 5055
  • Interview Question
    • Overview
      • Roadmap To Clearing Technical Interview
    • Technical
      • DSA
      • System Design
      • C#
      • React
    • Behavior
    • Question back to the interviewer
  • Roadmap
    • .NET
    • Java
  • English
    • Phát âm ed
    • Many vs much
    • Most vs most of vs almost vs the most
    • Quy tắc thêm s,es vào danh từ và cách phát âm s,es chuẩn xác nhất
  • Those will be seen later
    • Note
    • Interview
  • Programming Language
    • Python
      • Data structure
        • Set
    • Javascript
      • Data Structure
        • Map
    • C#
      • Data Structure
        • Value type & Reference type
        • Using statement
        • HashSet
        • Dictionary
        • Priority Queue
      • Fact
        • Understand about IEnumerable vs. IQueryable vs. ICollection vs. IList
        • 5 things you should know about enums in C#
    • Java
Powered by GitBook
On this page
  • Entities
  • Entity Class
  • AggregateRoot Class
  • Base Classes & Interfaces for Audit Properties
  • Caching Entities
  • Versioning Entities
  • Extra Properties
  1. .NET TECHNOLOGY
  2. Advanced
  3. ABP Framework
  4. DDD
  5. Domain Layer

Entities & Aggregate Roots

Entities

Entities are one of the core concepts of DDD (Domain Driven Design). Eric Evans describes it as "An object that is not fundamentally defined by its attributes, but rather by a thread of continuity and identity".

An entity is generally mapped to a table in a relational database.

Entity Class

Entities are derived from the Entity<TKey> class as shown below:

public class Book : Entity<Guid>
{
    public string Name { get; set; }

    public float Price { get; set; }
}

C#Copy

If you do not want to derive your entity from the base Entity<TKey> class, you can directly implement IEntity<TKey> interface.

Entity<TKey> class just defines an Id property with the given primary key type, which is Guid in the example above. It can be other types like string, int, long, or whatever you need.

Entities with GUID Keys

If your entity's Id type is Guid, there are some good practices to implement:

  • Create a constructor that gets the Id as a parameter and passes to the base class.

    • If you don't set a GUID Id, ABP sets it on save, but it is good to have a valid Id on the entity even before saving it to the database.

  • If you create an entity with a constructor that takes parameters, also create a private or protected empty constructor. This is used while your database provider reads your entity from the database (on deserialization).

An example entity:

public class Book : Entity<Guid>
{
    public string Name { get; set; }

    public float Price { get; set; }

    protected Book()
    {

    }

    public Book(Guid id)
     : base(id)
    {

    }
}

Example usage in an application service:

public class BookAppService : ApplicationService, IBookAppService
{
    private readonly IRepository<Book> _bookRepository;

    public BookAppService(IRepository<Book> bookRepository)
    {
        _bookRepository = bookRepository;
    }

    public async Task CreateAsync(CreateBookDto input)
    {
        await _bookRepository.InsertAsync(
            new Book(GuidGenerator.Create())
            {
                Name = input.Name,
                Price = input.Price
            }
        );
    }
}
  • BookAppService injects the default repository for the book entity and uses its InsertAsync method to insert a Book to the database.

  • GuidGenerator is type of IGuidGenerator which is a property defined in the ApplicationService base class. ABP defines such frequently used base properties as pre-injected for you, so you don't need to manually inject them.

  • If you want to follow the DDD best practices, see the Aggregate Example section below.

Entities with Composite Keys

Some entities may need to have composite keys. In that case, you can derive your entity from the non-generic Entity class. Example:

public class UserRole : Entity
{
    public Guid UserId { get; set; }

    public Guid RoleId { get; set; }
    
    public DateTime CreationTime { get; set; }

    public UserRole()
    {
            
    }
    
    public override object[] GetKeys()
    {
        return new object[] { UserId, RoleId };
    }
}

For the example above, the composite key is composed of UserId and RoleId. For a relational database, it is the composite primary key of the related table. Entities with composite keys should implement the GetKeys() method as shown above.

EntityEquals

Entity.EntityEquals(...) method is used to check if two Entity Objects are equals.

Example:

Book book1 = ...
Book book2 = ...

if (book1.EntityEquals(book2)) //Check equality
{
    ...
}

AggregateRoot Class

AggregateRoot<TKey> class extends the Entity<TKey> class. So, it also has an Id property by default.

  • An aggregate root is responsible for preserving its own integrity. This is also true for all entities, but the aggregate root has responsibility for its sub-entities too. So, the aggregate root must always be in a valid state.

  • An aggregate root can be referenced by its Id. Do not reference it by its navigation property.

  • An aggregate root is treated as a single unit. It's retrieved and updated as a single unit. It's generally considered as a transaction boundary.

  • Work with sub-entities over the aggregate root- do not modify them independently.

Aggregate Example

This is a full sample of an aggregate root with a related sub-entity collection:

public class Order : AggregateRoot<Guid>
{
    public virtual string ReferenceNo { get; protected set; }

    public virtual int TotalItemCount { get; protected set; }

    public virtual DateTime CreationTime { get; protected set; }

    public virtual List<OrderLine> OrderLines { get; protected set; }

    protected Order()
    {

    }

    public Order(Guid id, string referenceNo)
    {
        Check.NotNull(referenceNo, nameof(referenceNo));
        
        Id = id;
        ReferenceNo = referenceNo;
        
        OrderLines = new List<OrderLine>();
    }

    public void AddProduct(Guid productId, int count)
    {
        if (count <= 0)
        {
            throw new ArgumentException(
                "You can not add zero or negative count of products!",
                nameof(count)
            );
        }

        var existingLine = OrderLines.FirstOrDefault(ol => ol.ProductId == productId);

        if (existingLine == null)
        {
            OrderLines.Add(new OrderLine(this.Id, productId, count));
        }
        else
        {
            existingLine.ChangeCount(existingLine.Count + count);
        }

        TotalItemCount += count;
    }
}

public class OrderLine : Entity
{
    public virtual Guid OrderId { get; protected set; }

    public virtual Guid ProductId { get; protected set; }

    public virtual int Count { get; protected set; }

    protected OrderLine()
    {

    }

    internal OrderLine(Guid orderId, Guid productId, int count)
    {
        OrderId = orderId;
        ProductId = productId;
        Count = count;
    }

    internal void ChangeCount(int newCount)
    {
        Count = newCount;
    }
    
    public override object[] GetKeys()
    {
        return new Object[] {OrderId, ProductId};
    }
}

If you do not want to derive your aggregate root from the base AggregateRoot<TKey> class, you can directly implement the IAggregateRoot<TKey> interface.

Order is an aggregate root with Guid type Id property. It has a collection of OrderLine entities. OrderLine is another entity with a composite primary key (OrderId and ProductId).

While this example may not implement all the best practices of an aggregate root, it still follows some good practices:

  • Order has a public constructor that takes minimal requirements to construct an Order instance. So, it's not possible to create an order without an id and reference number. The protected/private constructor is only necessary to deserialize the object while reading from a data source.

  • OrderLine constructor is internal, so it is only allowed to be created by the domain layer. It's used inside of the Order.AddProduct method.

  • Order.AddProduct implements the business rule to add a product to an order.

  • All properties have protected setters. This is to prevent the entity from arbitrary changes from outside of the entity. For example, it would be dangerous to set TotalItemCount without adding a new product to the order. Its value is maintained by the AddProduct method.

ABP does not force you to apply any DDD rule or patterns. However, it tries to make it possible and easier when you do want to apply them. The documentation also follows the same principle.

Aggregate Roots with Composite Keys

While it's not common (and not suggested) for aggregate roots, it is in fact possible to define composite keys in the same way as defined for the mentioned entities above. Use non-generic AggregateRoot base class in that case.

BasicAggregateRoot Class

However, if you don't need these features, you can inherit from the BasicAggregateRoot<TKey> (or BasicAggregateRoot) for your aggregate root.

Base Classes & Interfaces for Audit Properties

There are some properties like CreationTime, CreatorId, LastModificationTime... which are very common in all applications. ABP provides some interfaces and base classes to standardize these properties and also sets their values automatically.

Auditing Interfaces

There are a lot of auditing interfaces, so you can implement the one that you need.

While you can manually implement these interfaces, you can use the base classes defined in the next section to simplify it.

  • IHasCreationTime defines the following properties:

    • CreationTime

  • IMayHaveCreator defines the following properties:

    • CreatorId

  • ICreationAuditedObject inherits from the IHasCreationTime and the IMayHaveCreator, so it defines the following properties:

    • CreationTime

    • CreatorId

  • IHasModificationTime defines the following properties:

    • LastModificationTime

  • IModificationAuditedObject extends the IHasModificationTime and adds the LastModifierId property. So, it defines the following properties:

    • LastModificationTime

    • LastModifierId

  • IAuditedObject extends the ICreationAuditedObject and the IModificationAuditedObject, so it defines the following properties:

    • CreationTime

    • CreatorId

    • LastModificationTime

    • LastModifierId

    • IsDeleted

  • IHasDeletionTime extends the ISoftDelete and adds the DeletionTime property. So, it defines the following properties:

    • IsDeleted

    • DeletionTime

  • IDeletionAuditedObject extends the IHasDeletionTime and adds the DeleterId property. So, it defines the following properties:

    • IsDeleted

    • DeletionTime

    • DeleterId

  • IFullAuditedObject inherits from the IAuditedObject and the IDeletionAuditedObject, so it defines the following properties:

    • CreationTime

    • CreatorId

    • LastModificationTime

    • LastModifierId

    • IsDeleted

    • DeletionTime

    • DeleterId

Once you implement any of the interfaces, or derive from a class defined in the next section, ABP automatically manages these properties wherever possible.

Auditing Base Classes

While you can manually implement any of the interfaces defined above, it is suggested to inherit from the base classes defined here:

  • CreationAuditedEntity<TKey> and CreationAuditedAggregateRoot<TKey> implement the ICreationAuditedObject interface.

  • AuditedEntity<TKey> and AuditedAggregateRoot<TKey> implement the IAuditedObject interface.

  • FullAuditedEntity<TKey> and FullAuditedAggregateRoot<TKey> implement the IFullAuditedObject interface.

All these base classes also have non-generic versions to take AuditedEntity and FullAuditedAggregateRoot to support the composite primary keys.

Caching Entities

It's designed as read-only and automatically invalidates a cached entity if the entity is updated or deleted.

Versioning Entities

ABP defines the IHasEntityVersion interface for automatic versioning of your entities. It only provides a single EntityVersion property, as shown in the following code block:

public interface IHasEntityVersion
{
    int EntityVersion { get; }
}

If you implement the IHasEntityVersion interface, ABP automatically increases the EntityVersion value whenever you update your entity. The initial EntityVersion value will be 0, when you first create an entity and save to the database.

ABP can not increase the version if you directly execute SQL UPDATE commands in the database. It is your responsibility to increase the EntityVersion value in that case. Also, if you are using the aggregate pattern and change sub-collections of an aggregate root, it is your responsibility if you want to increase the version of the aggregate root object.

Extra Properties

ABP defines the IHasExtraProperties interface that can be implemented by an entity to be able to dynamically set and get properties for the entity. AggregateRoot base class already implements the IHasExtraProperties interface. If you've derived from this class (or one of the related audit class defined above), you can directly use the API.

GetProperty & SetProperty Extension Methods

These extension methods are the recommended way to get and set data for an entity. Example:

public class ExtraPropertiesDemoService : ITransientDependency
{
    private readonly IIdentityUserRepository _identityUserRepository;

    public ExtraPropertiesDemoService(IIdentityUserRepository identityUserRepository)
    {
        _identityUserRepository = identityUserRepository;
    }

    public async Task SetTitle(Guid userId, string title)
    {
        var user = await _identityUserRepository.GetAsync(userId);
        
        //SET A PROPERTY
        user.SetProperty("Title", title);
        
        await _identityUserRepository.UpdateAsync(user);
    }

    public async Task<string> GetTitle(Guid userId)
    {
        var user = await _identityUserRepository.GetAsync(userId);

        //GET A PROPERTY
        return user.GetProperty<string>("Title");
    }
}
  • Property's value is object and can be any type of object (string, int, bool... etc).

  • GetProperty returns null if given property was not set before.

  • You can store more than one property at the same time by using different property names (like Title here).

It would be a good practice to define a constant for the property name to prevent typo errors. It would be even a better practice to define extension methods to take the advantage of the intellisense. Example:

public static class IdentityUserExtensions
{
    private const string TitlePropertyName = "Title";

    public static void SetTitle(this IdentityUser user, string title)
    {
        user.SetProperty(TitlePropertyName, title);
    }

    public static string GetTitle(this IdentityUser user)
    {
        return user.GetProperty<string>(TitlePropertyName);
    }
}

Then you can directly use user.SetTitle("...") and user.GetTitle() for an IdentityUser object.

HasProperty & RemoveProperty Extension Methods

  • HasProperty is used to check if the object has a property set before.

  • RemoveProperty is used to remove a property from the object. You can use this instead of setting a null value.

How it is Implemented?

IHasExtraProperties interface requires to define a Dictionary<string, object> property, named ExtraProperties, for the implemented class.

So, you can directly use the ExtraProperties property to use the dictionary API, if you like. However, SetProperty and GetProperty methods are the recommended ways since they also check for nulls.

How is it Stored?

The way to store this dictionary in the database depends on the database provider you're using.

Discussion for the Extra Properties

Extra Properties system is especially useful if you are using a re-usable module that defines an entity inside and you want to get/set some data related to this entity in an easy way.

You typically don't need to use this system for your own entities, because it has the following drawbacks:

  • It is not fully type safe since it works with strings as property names.

Extra Properties Behind Entities

IHasExtraProperties is not restricted to be used with entities. You can implement this interface for any kind of class and use the GetProperty, SetProperty and other related methods.

PreviousDomain LayerNextValue Objects

Last updated 8 months ago

Don't use the Guid.NewGuid() to set the Id! Use while passing the Id from the code that creates the entity. IGuidGenerator optimized to generate sequential GUIDs, which is critical for clustered indexes in the relational databases.

Notice that you also need to define keys of the entity in your object-relational mapping (ORM) configuration. See the integration document for example.

Also note that Entities with Composite Primary Keys cannot utilize the IRepository<TEntity, TKey> interface since it requires a single Id property. However, you can always use IRepository<TEntity>. See for more.

"Aggregate is a pattern in Domain-Driven Design. A DDD aggregate is a cluster of domain objects that can be treated as a single unit. An example may be an order and its line-items, these will be separate objects, but it's useful to treat the order (together with its line items) as a single aggregate." (see the )

Notice that ABP creates default repositories only for aggregate roots by default. However, it's possible to include all entities. See the for more.

ABP does not force you to use aggregate roots, you can in fact use the Entity class as defined before. However, if you want to implement the and want to create aggregate root classes, there are some best practices you may want to consider:

See the if you want to implement DDD in your application.

AggregateRoot class implements the IHasExtraProperties and IHasConcurrencyStamp interfaces which brings two properties to the derived class. IHasExtraProperties makes the entity extensible (see the Extra Properties section below) and IHasConcurrencyStamp adds a ConcurrencyStamp property that is managed by the ABP to implement the . In most cases, these are wanted features for aggregate roots.

ISoftDelete (see the ) defines the following properties:

Implementing ISoftDelete, IDeletionAuditedObject or IFullAuditedObject makes your entity soft-delete. See the to learn about the soft-delete pattern.

All these base classes also have ...WithUser pairs, like FullAuditedAggregateRootWithUser<TUser> and FullAuditedAggregateRootWithUser<TKey, TUser>. This makes possible to add a navigation property to your user entity. However, it is not a good practice to add navigation properties between aggregate roots, so this usage is not suggested (unless you are using an ORM, like EF Core, that well supports this scenario and you really need it - otherwise remember that this approach doesn't work for NoSQL databases like MongoDB where you must truly implement the aggregate pattern). Also, if you add navigation properties to the AppUser class that comes with the startup template, consider to handle (ignore/map) it on the migration dbcontext (see ).

ABP provides a for caching entities. It is useful if you want to use caching for quicker access to the entity rather than repeatedly querying it from the database.

See the documentation for more information.

For , here are two type of configurations;

By default, it is stored in a single ExtraProperties field as a JSON string (that means all extra properties stored in a single database table field). Serializing to JSON and deserializing from the JSON are automatically done by the ABP using the system of the EF Core.

If you want, you can use the ObjectExtensionManager to define a separate table field for a desired extra property. Properties those are not configured through the ObjectExtensionManager will continue to use a single JSON field as described above. This feature is especially useful when you are using a pre-built and want to . See the to learn how to use the ObjectExtensionManager.

For , it is stored as a regular field, since MongoDB naturally supports this kind of system.

It is not easy to these properties from/to other objects.

the IGuidGenerator service
Entity Framework Core
repositories documentation
full description
repositories documentation
Domain Driven Design
entity design best practice guide
optimistic concurrency
data filtering document
data filtering document
the EF Core migration document
Distributed Entity Cache System
Entity Cache
Entity Framework Core
value conversions
application module
extend its entities
EF Core integration document
MongoDB
extra elements
auto map