Questions tagged [value-objects]
A value object is a fundamental concept of domain modeling in Domain-Driven Design.
value-objects
335
questions
1
vote
0
answers
101
views
Are Value Classes allowed to exhibit change? [closed]
The doc for Value Based Classes specify:
Instances of a value-based class:
are final and immutable (though may contain references to mutable objects);
If I defined a value class Foo, which had a ...
0
votes
0
answers
33
views
How to map value objects in dapper
i have the following entity
using MedRaise.Domain.Enums;
namespace MedRaise.Domain.Entities;
public class Appointment : Entity
{
private Guid _clinicId;
private DateTime _date;
private ...
0
votes
0
answers
76
views
EF Core Entity OwnsOne Value Object Change Tracking Problem
Edit 1: Github Issue link : https://github.com/dotnet/efcore/issues/33981
We have an entity named Customer which has a Name Property that is a value Object. I'm sharing the entity value object and ...
0
votes
1
answer
30
views
DDD EventSourcing ValueObject with multiple languages support
There is an application, written on .net, written with DDD, CQRS+EventSourcing. There is a requirement - add translations to some value objects. How to implement such feature?
e.g.
There is Aggregate ...
0
votes
0
answers
14
views
PowerBi Matrix Table (Or Excel) - Compare 2 different variables of same object (different Columns) in a Pivot Table/Matrix
I am using PowerBi and am trying to solve a problem of comparing the outcomes of 2 columns that are showing the same object but with 2 possible outcomes. I will then do some analyse on percentage ...
0
votes
0
answers
29
views
How to persist a Value Object with EF
Good morning,
I have a problem, I have this value object.
public record CodeVO : ValueObject
{
public string MyCode { get; private set; }
private CodeVO()
{
// EF constructor
...
-1
votes
1
answer
41
views
Advice to refactor null checks? [closed]
I have a ValueObject's with some validation's like this:
public class ValueObject : SimpleValueObject<string> {
private ValueObject (string value) : base(value) { }
public static Result&...
1
vote
1
answer
209
views
Prevent "initialization autoloaded the constant" for value objects in initializer
In a Rails initializer, I assign additional application configuration as follows:
module MyApp
class Application
config.x.email = {
default: '[email protected]',
invoice: 'invoice@...
0
votes
1
answer
105
views
EF Core migration error: entity type 'ValueObject' requires a primary key
I'm working with EF Core and I've encountered an issue when trying to add a new migration using this command:
dotnet ef migrations add mig_somename
My UpdateQueueStatus is a ValueObject and not an ...
0
votes
1
answer
489
views
ASP.NET Core 8 Minimal API [FromForm] Binding of a Value Object Property
I'm in the middle of converting an ASP.NET Core 6 API app to be a Minimal API app. Now that ASP.NET Core 8 supports [FromForm] for object binding, I decided to take the plunge, but I'm running into ...
0
votes
0
answers
42
views
System.InvalidOperationException: The entity type 'myValueObjectClass' requires a primary key to be defined.IfYouIntendedTo use a keyless entity type
My project has been created with a Clean Architecture and I get this error when I want to Insert a record to my table Users:
Screenshot of my error
My entity class User in the domain layer:
using ...
0
votes
1
answer
41
views
Shared value object in concept but with different validation rules
I have read the similar questions Is there any concept in DDD about shared value objects and Value object design rules in ddd and they both make sense when a VO is 100% shared.
I have multiple domain ...
0
votes
0
answers
147
views
What is ValueObject in a Doctrine app with translations?
I have a table structure:
Page can have many titles with different translations. In Symfony:
Model/Page.php - Main Page entity
Model/Page/PageFieldTitle.php - Entity for page_field_title table.
My ...
0
votes
2
answers
116
views
Getting error related to entity configuration when configuring a ValueObject in EF Core
When I am trying to add a migration, I get the following error:
Unable to determine the relationship represented by navigation 'User.Email' of type 'Email'. Either manually configure the relationship,...
0
votes
2
answers
68
views
Can a VO make API calls?
In the registering part of an application I am building, I need to apply a logic that states that e-mails have to be unique in the database. Since I am building the frontend, I'd like to know if I can ...