我在更新期间提交时收到错误脱水属性值错误.我搜索了它看起来和NHibernate类似:错误脱水属性 - 这到底是什么?唯一的区别是,在提到的问题中,NHibernate抱怨无法解决财产问题
IssuingOffice的值已经存在于数据库中,因此它不能成为引用未保存记录的问题
以下是详细错误.
Test 'Tests.Services.StickerInvoiceServiceTests.update_sticker_info_succeeds' failed:
NHibernate.PropertyValueException : Error dehydrating property value for
Model.StickerInvoice.StickerIssuingOffice
----> NHibernate.TransientObjectException : object references an unsaved transient
instance - save the transient instance before flushing or set cascade action for the property to something that would make it autosave. Type: Model.IssuingOffice, Entity: Model.IssuingOffice
at NHibernate.Persister.Entity.AbstractEntityPersister.Dehydrate(Object id, Object[] fields, Object rowId, Boolean[] includeProperty, Boolean[][] includeColumns, Int32 table, IDbCommand statement, ISessionImplementor session, Int32 index)
at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] …Run Code Online (Sandbox Code Playgroud) 我需要验证一个值,并且要求是它可能包含数字0-9或特定单词但不包含两者.
我使用以下表达式
Regex regex = new Regex(@"\b(Private Bag)\b|[0-9]");
Run Code Online (Sandbox Code Playgroud)
但是,如果发现使用上述表达式进行验证,则会传递所有方案.
这个正则表达式我在哪里错了?