Hi... Quick question. Pardon me if is too simplistic. I'm new to all of
this.
On "HqlTreeNode VisitMethodCallExpression(MethodCallExpression expression)"
It's called here:
public TEntity Get<TEntity, TId>(TId Id)
where TEntity : Entity<TId>
where TId : IEquatable<TId>
{
try
{
TEntity result = default(TEntity);
using (var tx = session.BeginTransaction())
{
*result = session.Query<TEntity>().Where(e =>
e.Id.Equals(Id)).FirstOrDefault();*
* //**result = session.Query<TEntity>().Where(e => e.Id
== Id).FirstOrDefault();*
* //**This does not compile - Operator == cannot be
applied of operands of type TId and TId**
*
}
return result;
}
catch (Exception ex)
{
throw;
}
}
public abstract class Entity<IdType> where IdType : IEquatable<IdType>
{ // }
I want to use generics because my Entities can have different type as Id.
Is there a solution. Or must I have a different "Get" for each type that I
have as id?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/M7TmhsZqYD8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.