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

How to Get Entity by Enum Property in Project.Core #1345


User avatar
0
kacey created

I discovered ABP a few days ago After searching for tools to help my Enterprise Application Development. I went through the samples and documentation and realized I just found what I needed. The N-layered structure and the DDD model is amazing. Even though I don't have so much experience in that area, ABP has brought me up to speed a bit.

My question based on the topic is how to write a method to get an entity by an enum property through (IRepository) as used in the samples. I thought of using DB contexts but I think it goes against the best practices as I didn't see you do that in your samples.

With a model A, Having an Enum property, and another model B in which the enum property of A is a a foreign key, I would want to set that field in B's constructor so when creating a new entity, it is automatically added. My problem is where and how to write the method (GetByEnum) that will help me achieve what I want.

I hope you understand my question. Thanks.


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

    Duplicate of #1346