I would like to fetch all records from particular day, no matter what time is associated with those records. So far I have method like this:
public IQueryable QueryByDay(DateTime day)
{
DateTime from = day.Date;
DateTime to =…
I am trying to use the ROWVERSION (or TIMESTAMP) datatype on a SQL Server table for optimistic concurrency control.
My table is setup using FluentMigrator and I do not know how to get the datatype I need. According to Microsoft's article on…
I´m trying to get started in the “DDD with C#” world.
I use NHibernate as my ORM tool, thus trying to develop a PI(Persistence Ignorance) model.
However, in some of my entities (which are being represented as POCOS) I have business rules in the…
I have a list of all distinct account name prefixes (a-z) which I acquire using
var accounts = this.SessionManager.GetActiveSession().QueryOver();
var q = accounts.Select(Projections.Distinct(
Projections.SqlFunction("substring",
…
I have domain class location
public abstract class BaseEntity where T: struct
{
public virtual T Id { get; set; }
public virtual bool Equals(BaseEntity other)
}
public class Location : BaseEntity
{
…
What is the best practice for upgrading the database using ORM (DevExpress XPO, NHibernate or MS Entity Framework)?
I'm starting a new project and have to pick an ORM. The development process requires of releasing intermediate test builds quite…
I have some instances for reporting where executing sprocs is easier and simpler than complicated QueryOver statements.
I have a DTO, not an entity, that represents the data returned from the query and want to populate the results of the query into…
First of all, yes, I am using DistinctRootEntityResultTransformer.
I have the following (Fluent NHibernate) mapping:
public FirstObjectMap()
{
Id(x => x.Id):
HasMany(x => x.SecondItems).KeyColumn("FirstObject_ID");
}
public…
After upgrading from nhibernate 1.0.4.0 to nhibernate 3.3 im encountering the following error when I try to run "Configuration cfg = new Configuration();"
System.TypeInitializationException was caught
Message="The type initializer for…
I have the following code (simplified for the sake of discussion). What I don't understand is why the session.Transaction property returns a different transaction after a rollback.
For instance, this means that the property…
I am trying to use futures in NHibernate 3.2 and Oracle 11gR2. This doesn't seem to be supported although I'm not sure. I found this issue on NHibernate Jira that makes it seem like futures are possible with Oracle. Does anyone know how to get…
I was just wondering about some CodeWarning (ConstructorsShouldNotCallBaseClassVirtualMethods), and if there is a better way to do it. I have a simple log collector class, and I am using NHibernate to retrieve some of the objects.
Some times I…
I'm trying to use NHibernate (and FluentNHibernate) over a legacy database.
I'm also using SQLite for tests.
When I try to create a test for the mappings using FluentNHibernate's PersistenceSpecification, I get the following…
I am working with a legacy database that uses composite keys. And I am trying to use NHibernate to insert a new record into the database. NHibernate specifies that I have to create the Id manually, but when I try to insert with this id I get the…