0
pascald created
HI,
I created an entity with a string ID.
public class Location : FullAuditedEntity<string> , IMustHaveTenant
{
public int TenantId { get; set; }
[Required]
[StringLength(LocationConsts.MaxDescriptionLength, MinimumLength = LocationConsts.MinDescriptionLength)]
public virtual string Description { get; set; }
}
As the ID must be provided by the user and the CreateOrEdit is using the ID to decide to do an edit or an insert (and it is never empty in this case) what would be the best way to handle this situation.
Also how to validate for duplicate IDs ? Should I add a function in my LocationsAppService to make the validation on the client side?
Thanks,
Pascal
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
1 Answer(s)
-
0
hi
I think it is feasible to add an application service method to check if the id is duplicated.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)