Comments (5)
pls post full stack trace
from vita.
a következő helyen: Vita.Common.Util.Throw(String message, Object[] args)
a következő helyen: Vita.Entities.EntityHelper.GetRecord(Object entity)
a következő helyen: Vita.Entities.Runtime.EntityBase.Equals(Object obj)
a következő helyen: System.Object.Equals(Object objA, Object objB)
a következő helyen: System.Windows.Data.ListCollectionView.SetNewItem(Object item)
a következő helyen: System.Windows.Data.ListCollectionView.BeginAddNew(Object newItem, Int32 index)
a következő helyen: System.Windows.Data.ListCollectionView.<>c__DisplayClass50_0.b__0()
a következő helyen: MS.Internal.Data.SynchronizationInfo.AccessCollection(IEnumerable collection, Action accessMethod, Boolean writeAccess)
a következő helyen: System.Windows.Data.BindingOperations.AccessCollection(IEnumerable collection, Action accessMethod, Boolean writeAccess)
a következő helyen: System.Windows.Data.ListCollectionView.AddNewCommon(Object newItem)
a következő helyen: System.Windows.Data.ListCollectionView.AddNewItem(Object newItem)
a következő helyen: VitaTest.Program.Main(String[] args) hely: D:\Projects\Tests\VitaTest\VitaTest\Program.cs, sor: 22
a következő helyen: System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
a következő helyen: System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
a következő helyen: Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
a következő helyen: System.Threading.ThreadHelper.ThreadStart_Context(Object state)
a következő helyen: System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
a következő helyen: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
a következő helyen: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
a következő helyen: System.Threading.ThreadHelper.ThreadStart()
from vita.
first, there's a bug in Vita, in Equals method, it should not throw ever. I will fix that (already did), will be there in next push
Still, from stack trace appears you're not doing it right. You should add the new entity to entity list that is returned from this LINQ expr in constructor parameter, not to ListCollectionView. It tries to check ViewItem or smth to list items.
Save the returned list in a field and add to it. I guess you need to convert the returned list to observable list, smth like this:
ObservableCollection _custList;
_custList = new ObservableCollection(session.EntitySet().OrderBy());
var newCust = session.NewEntitty();
_custList.Add(newCust);
Sorry, never worked with WPF
from vita.
Thx for the quick answer. I simplified the sample from a WPF MVVM ViewModel, with ObservableCollections etc. (The ObservableCollection calls the CollectionView's AddNewItem.)
I can avoid the exception with creating a model class and working with the modells, but I like Vita's elegant concept of interfaces.
from vita.
should be fixed now (entity comparison)
from vita.
Related Issues (20)
- [Bug] Entity is not refreshed after the child is being deleted HOT 2
- Schedule command will not trigger the Entity Saving Event HOT 2
- Microsoft.Data.SqlClient 4.0.0 HOT 3
- PropagateUpdatedOn does not trigger when adding new line HOT 3
- Data Cache HOT 13
- DBComputed Error HOT 2
- Error for subquery update HOT 5
- Is vita Support SAP Sql Anywhere Database ? HOT 1
- Small request HOT 4
- Queryable/Enumerable method MaxBy not supported. HOT 2
- ExecuteNonQuery error with "No database selected" HOT 4
- [Need advice] Multi-tenant design HOT 2
- News for Vita ORM HOT 2
- Version 3.5 pushed. HOT 9
- Correct way to maintain sessions HOT 2
- Force all columns to be written to database HOT 7
- PostgreSQL - batch update failed HOT 9
- ViewHelper.EntitySet HOT 21
- GUID with Auto HOT 1
- DB Function Error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vita.