-
-
Notifications
You must be signed in to change notification settings - Fork 158
Extract IIdentifiable and annotation attributes (Attr, HasOne, etc.) into separate package #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This was discussed a while ago here. |
Related to #661. |
Unfortunately there is currently no way to accomplish this. A fluent API is being added in #771 (design at #776), but even with that in place, you'd still need to reference JADNC because all resources need to implement IIdentifiable. To accomplish what you want, we'd need to extract IIdentifiable, Attr, HasOne etc. into a separate NuGet package, which you can then reference from your models project (instead of the full JADNC package). |
The #771 PR takes care of mapping attributes fluently, and replaces the need for Annotations, in order to keep the Domain clean. I don't really have an issue with referencing JADNC from the Domain, as I do so with Fluent NHibernate or EF where I end up placing Mappings/Configurations in the same assembly as the Domain. My main concern are the Annotations, which I wanted to remove. As for IIdentifiable, for most Domain implementations you already have concepts like Entity and Value Object, and Entity also have the concept of Id. In order to eliminate the need to implement IIdentifiable, and accomplish this using fluent mapping, in a similar way of mapping a property, it will require more drastic change in both discovery during graph building, and in controller's implementations. |
Yes, this works, as long as all your resources also have a typed Id property. There's some reflection code that depends on it. |
For future reference, how to produce multiple dependent nuget packages from a single git repository is described at https://markheath.net/post/multiple-nuget-single-repo. |
Marked as 'breaking' because we'll need to remove |
Description
Forgive me if this is a duplicate request but I couldn't find an answer...
We have a set of models that we're moving to an external package for other non-JADNC projects to use. They were originally in our JADNC app and had JADNC schema attributes on them (IIdentifiable, Attr, HasOne, etc...). We need to be able to apply a JADNC schema on them from our JADNC app while they live in another project that does not reference JADNC.
If there already is a solution, would someone point me to it?
I know EFCore solves this by providing their Fluent Api. Something like this would be a huge help in helping us decouple our models from the infrastructure layer of JADNC.
We are using JADNC 3.1 with .NET core 2.1
The text was updated successfully, but these errors were encountered: