Evaluating FNH versus EF core #746
Replies: 14 comments 20 replies
-
Step backwards, and in general, our approach is "code first" and "database first" with the ORM standing in between, we do all the mappings therein to connect the dots. We do the code first, we model the database and manage rolling out the mods ourselves, for now. Neither here nor there really from a technical evaluation perspective except to outline our basic development strategy; from NH capability we would not need to lean on migrations and so forth, in that sense, for now. |
Beta Was this translation helpful? Give feedback.
-
Database wise using |
Beta Was this translation helpful? Give feedback.
-
ID wise we mainly use |
Beta Was this translation helpful? Give feedback.
-
We use JSON columns in a couple of places, at least one of which I am in the process of breaking out into first class models and database structure, which is part and partial my motivation for posting this discussion, having apparently run into an EF inability to properly order persistance reduction. |
Beta Was this translation helpful? Give feedback.
-
There are some cases where we have |
Beta Was this translation helpful? Give feedback.
-
We are also modeling time based components for the most part using |
Beta Was this translation helpful? Give feedback.
-
Of course we have lots and lots of parent child relationships. The primary case (above 1P) we bumped into we are factoring from a previously JSON column property, to a proper 1-many relationship. If we can do that with a joining table, even better, although I understand opinions may vary in this area; there are reasons why a joining table might be considered beneficial, i.e. properties on the relationship that do not really need to be on either of the two participating types. For the most part we use I am somewhat familiar with the NH approach therein having worked with it in the past. I'm sure the story has only gotten better to present. |
Beta Was this translation helpful? Give feedback.
-
We also lean heavily on It is worth mentioning, our primary targets are into a So far, except for one or two INPC over steps, that has been a fairly good approach for use to be using. |
Beta Was this translation helpful? Give feedback.
-
Those are the highlights and a bit of insight into what we're about re: ORM, EF (possibly NH+FNH) and so forth. Would love to learn is it a good choice our reconsidering the ORM, into NH+FNH, and so on. We're at a point in the mapping, dozen or so classes, and for NH type hierarchy perhaps as well, so do not want to just automatically embark on this path and realize it was a horrible decision. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback @fredericDelaporte and in advance others. So at the moment looks like very well feasible and so forth. Just a matter of scope, timing, priorities, etc. Appreciate the responses, and caveats of course. |
Beta Was this translation helpful? Give feedback.
-
One follow on question FNH dependencies... I do not see any NH package deps? How is that even possible? NH is baked into the cake? |
Beta Was this translation helpful? Give feedback.
-
Starting the transition to FNH... EF has an optimization concept of "split queries", I see FNH and NH have something similar in the |
Beta Was this translation helpful? Give feedback.
-
Any advice on a halfway decent As well as to and from types of course. And also the public abstract class UserColumnCustomType<T, U> : IUserType
where U : IEquatable<U>
{
public virtual new bool Equals(object x, object y)
{
if (x is not T left || y is not T right)
{
return false;
}
return left is null && right is null || ConvertTo(left).Equals(ConvertTo(right));
}
// ...
public virtual object NullSafeGet(DbDataReader rs, string[] names, ISessionImplementor session, object owner) =>
NHibernateUtil.Custom(typeof(U)).NullSafeGet(rs, names, session, owner) is U returnValue ? returnValue : (object)default(U);
} Set side of things is in progress, working out what I will need for In practical use, most of the time I do this for
Thanks in advance for any insights. Cheers 🍻 ! |
Beta Was this translation helpful? Give feedback.
-
Ruh roh, so... some stipulatons impeding progress. So far, what I can glean, a simple if naive custom type mapping to JSON assumes Second, what to do about For this to be a viable path forward, not sure that we would need Open to ideas approaching that baffle. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, not a stranger to NH or FNH from back in the day, always filed it in the back of my mind whether I might need an ORM to consider once again. I have reached one of those crossroads.
I have a project in which I have been using EF and it has been working, for the most part, to a point. It is starting to show signs of stress EF is not designed to handle; one such is order of persistence matters, table A must be upserted in order for table B FK to be properly handled. From what I was reading, I do not think EF handles this case, and the one issue I was finding, closed as not planned. Not sure if perhaps NH is better at negotiating those kinds of cases.
Will try not to ramble on this part of the thread, and will try to keep aspects focused in and of themselves, if that helps. Cheers and best thanks so much 🍻 !
Beta Was this translation helpful? Give feedback.
All reactions