Search Results

Search found 2 results on 1 pages for 'user348731'.

Page 1/1 | 1 

  • Update/Insert without select

    - by user348731
    I have this very simple class public class ProductAttributeValuePortal { public virtual int ID { get; set; } public virtual Domain.Entity.Portals.ProductPortal Product { get; set; } public virtual Attribute Attribute { get; set; } public virtual string Value { get; set; } } with this very simple map public ProductAttributeValueMap () { Table("DM.dbo.ProductAttributeValues"); Id(x => x.ID, "ProductAttributeValue_id"); References(x => x.Product); References(x => x.Attribute); Map(x => x.Value); } Each time i make a insert NHibernate makes a Select of the attribute like : NHibernate: INSERT INTO MachineData.dbo.ProductAttributeValues (Value, Product_id, Attribute_id) VALUES (@p0, @p1, @p2); select SCOPE_IDENTITY();@p0 = '6745', @p1 = 39, @p2 = 'BSTD' NHibernate: SELECT attribute_.Attribute_id, attribute_.Name as Name21_, attribute_.AttributeType as Attribut3_21_, attribute_.TagName as TagName21_, attribute_.MapTo as MapTo21_ FROM MachineShared.dbo.Attributes attribute_ WHERE attribute_.Attribute_id=@p0;@p0 = 'DLB' What am i doing wrong. And where do i find some really uptodate books about nhibernate/Fluent nhibernate

    Read the article

  • Update if exists and insert if not

    - by user348731
    i have a very simple entity public class PortalStat { public virtual int ID { get; set; } public virtual Guid ProductGuid { get; set; } public virtual DateTime StatDateTime { get; set; } public virtual DM.Domain.Portal Portal { get; set; } public virtual int Count { get; set; } } i would like to make a funtion which check if there is a entity based on the Portal and the StatDateTime. if the record exist then i would like to increase the Count otherwise i would like to insert a new record. How do i do that in nhibernate

    Read the article

1