Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Why define public setter for Id property of Domain Entity class #7434


User avatar
0
arctechnicalteamaus created

Dear Support,

We are trying to use Abp.Domain.Entities for our DDD development. The base Entity class defines:

public virtual TPrimaryKey Id { get; set; }

The interface IEntity<TPrimaryKey> also defines:

TPrimaryKey Id { get; set; }

In DDD work, we suppose property shouldn't allow any public setter, particularly for the Id property. We just wonder why aspnetboilerplate setup in this way. Do we miss anything? How can we change this to only allow public get?

Thanks!


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Please follow this issue. Thanks. https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4761