Hello,
Similar to the interfaces present currently in Abp the CreationFullEdit and others, I need to populate a common property on all my entities which is the full entity name. How can I implement such thing in Abp?
Thanks
6 Answer(s)
-
0
Hi,
Can you explain your case a little bit more ? For example, do you just want to add a field named FullEntityName or do you also want to save a generated value to this property while creating an entity ?
Thanks.
-
0
In fact I need to auto generate a field to be the Entity Full Name. So I thought of doing it similar to those interfaces you have in the framework that adds CreatedOn, CrratedBy etc. How shall I proceed?
-
0
Hi,
Then you can check our implementation in AbpDbContext <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/2f79821b3c09132394ec01f1673b7fad8e6893af/src/Abp.EntityFramework/EntityFramework/AbpDbContext.cs">https://github.com/aspnetboilerplate/as ... Context.cs</a>.
You can override ApplyAbpConceptcs method to insert your logic here.
Thanks.
-
0
Thanks Ismail. Where would I add this code? I shall change in the boilerplate code and build it? Or override this method in the application specific Db Context?
-
0
Hi Bilal,
Yes, you should override it in your DbContext. Don't forget to call base method :).
Thanks.
-
0
Thanks :)