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

Attributes on DTO Property #8886


User avatar
0
mahendra created

Hi there,

I have a Dto. on it's property, I have set a custom attribute like below

`public class CreateOrUpdateProductDto : iVendBaseDto { public string EntityId { get; set; }

    [AllowedExcelOperation(true, false)]
    public string Description { get; set; }
    .....
    .....`
    

Now in angular when I run the refresh.bat, I am not getting these attributes in the proxies being generated. See below:

export class CreateOrUpdateProductDto implements ICreateOrUpdateProductDto { entityId!: string | undefined; description!: string | undefined; ....... ....... . Am I doing something wrong here, or the attributes never get translated to proxies. If it never gets translated, then could you please let me know what is the best option to get the attribute defined in server side (like on a dto) to client side.


2 Answer(s)
  • User Avatar
    0
    mahendra created

    Basically, I am looking if my Attribute defined and attached to C# DTO should get converted to decorators in client code....

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    AspNet Zero doesn't provide such functionality. We are using https://github.com/RicoSuter/NSwag to generate client proxies, you may ask your question on Nswag GitHub repo.

    Thanks,