i got problems with saving when i use Guid as identifier. can anybody se what i am missing here? i create my own guid so i dont want it to be generated by database.
NOTE: i have tried the guid.combo in mapping to without any success.
public class Order
{
public virtual Guid Id { get; set; }
public virtual ICollection<OrderItem> OrderItems { get; set; }
public virtual User User { get; set; }
public virtual DateTime? CreateDate { get; set; }
public virtual DateTime? ShippedDate { get; set; }
public virtual string OrderStatus { get; set; }
public Order()
{
OrderItems = new Collection<OrderItem>();
}
public virtual void AddOrderItems(OrderItem orderItem)
{
orderItem.Order = this;
OrderItems.Add(orderItem);
}
}
OrderMap:
public OrderMap()
{
Id(x => x.Id).ColumnName("Id").GeneratedBy.Guid();
Map(x => x.CreateDate);
Map(x => x.ShippedDate);
Map(x => x.OrderStatus);
References(x => x.User);
HasMany(x => x.OrderItems).Cascade.All().Inverse().LazyLoad();
}