Hi,
I think my problem is im using the same instance all the time in my webapplications.
Like this is my businessObject which initialize the nHibernate session in its constructor.
public static Business Get()
{
return _instance ?? (_instance = new Business());
}
So when i need to use my business i do it like this.
IBusiness biz = Business.Get();
biz.Category.Read();
Can i do this in a webservice.
Regarding how im passing the data to the DTO im using linq like this, where WsEvent is my DTO and Event is my nhibernate object.:
public WsEvent[] GetServiceEvents()
{
return (from e in Business.Get().Event.Read() select new WsEvent {EventId = e.Id, EventName = e.Name})
.ToArray();
}
Any suggestions what to do?
Regards,
Jacob