-
-
Save vkhorikov/d01e22909dc22c8c2c2322a59feb2ce3 to your computer and use it in GitHub Desktop.
Value Objects and Identity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlanningTool | |
{ | |
internal int Id { get; private set; } | |
// Rest of class | |
public ICollection<PlanningToolTab> Tabs { get; private set; } | |
} | |
public class PlanningToolTab | |
{ | |
internal int Id { get; private set; } | |
public int PlanningToolId { get; private set; } | |
public int PlanningToolGroupId { get; private set; } | |
// Rest of class | |
public ICollection<PlanningToolGroup> Groups { get; private set; } | |
} | |
public class PlanningToolGroup | |
{ | |
internal int Id { get; private set; } | |
// Rest of class | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlanningTool | |
{ | |
internal int Id { get; private set; } | |
// Rest of class | |
public ICollection<PlanningToolTab> Tabs { get; private set; } | |
} | |
public class PlanningToolTab | |
{ | |
public int PlanningToolId { get; private set; } // Part of the primary key | |
public int PlanningToolGroupId { get; private set; } // Part of the primary key | |
// Rest of class | |
public ICollection<PlanningToolGroup> Groups { get; private set; } | |
} | |
public class PlanningToolGroup | |
{ | |
internal int Id { get; private set; } | |
// Rest of class | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlanningTool | |
{ | |
internal PlanningToolId Id { get; private set; } | |
// Rest of class | |
public ICollection<PlanningToolTab> Tabs { get; private set; } | |
} | |
public class PlanningToolTab | |
{ | |
public PlanningToolTabId Id { get; private set; } | |
// Rest of class | |
public ICollection<PlanningToolGroup> Groups { get; private set; } | |
} | |
public class PlanningToolGroup | |
{ | |
internal PlanningToolGroupId Id { get; private set; } | |
// Rest of class | |
} | |
public class PlanningToolTabId : ValueObject | |
{ | |
public PlanningToolId PlanningToolId { get; } | |
public PlanningToolGroupId PlanningToolGroupId { get; } | |
// Equality members | |
} | |
public class PlanningToolId : ValueObject | |
{ | |
public int Value { get; } | |
// Equality members | |
} | |
public class PlanningToolGroupId : ValueObject | |
{ | |
public int Value { get; } | |
// Equality members | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int PlanningToolId { get; private set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public PlanningTool PlanningTool { get; private set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// before | |
public int PlanningToolId { get; private set; } | |
public int PlanningToolGroupId { get; private set; } | |
// after | |
public PlanningTool PlanningTool { get; private set; } | |
public PlanningToolGroup PlanningToolGroup { get; private set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customer.Id = order.Id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment