We are happy to announce release of Entity Atoms Flex Edition, which provides client frameworks and tools for ASP.NET MVC and RIA Services to access Entity Framework on any mobile platforms.
Microsoft’s latest Entity Framework makes it very easy to setup complex transactional applications. However in order to extend Change Set, Authorization and Audit controls to all mobile platforms Entity Atoms was designed.
Currently, only Flex Edition is available for download, Flex Edition lets you create Flex Mobile application that can execute on any mobile platform.
We are going to release new native framework and tools for major mobile platforms very soon.
- Extend Entity Framework to all platforms using RIA Services
- Simple LINQ Expression Rules to enable Security
- Enable Table Audits/History including Cascade Delete
- Customizable Code Generator (Flex, Android, C#, VB.net)
- Simple Client and Server side validations
- Easy Access to related entities (navigation properties)
- JSON Endpoint with Date Handling
- Additional UI Elements for Flex Mobile
- Advanced Search (Search navigation properties)
- Full ChangeSet management at Client Side
- Unit Of Work pattern at Client Side
- Windows 7, Windows Vista Service Pack 2,Windows XP Professional.
- Microsoft .NET Framework 4.0 and above.
- Microsoft Visual Studio 2010
- Flash Builder 4.6
- MS SQL Express 2005 onwards or MySQL or Oracle
Entity Framework and RIA Services do not allow Entities to be added/removed from cross containers. In order to move Entity from one DomainContext/ObjectContext to another DomainContext/ObjectContext, we need to recursively detach the object graph and attach it to other DomainContext/ObjectContext.
Single entity can be easily detached and attached from EntitySet where it belongs, but the problem comes when navigation properties of entity are not empty. Entity object along with navigation properties is called Object Graph because if you notice, navigation property’s navigation property will contain reference to same entity and that will result in endless recursive code for Detach/Attach.
An entity with the same identity already exists in the EntitySet
When you try to detach entity from old DomainContext/ObjectContext and attach it to DomainContext/ObjectContext, it may give you an error that entity with same identity already exists and it will throw an exception. In this case we will just simply reuse the existing entity instead of attaching the entity we have.
Entity cannot be attached to this EntityContainer because it is already attached to another EntityContainer
In case of ObjectGraph, your root level entity is already detached, but navigation properties are not detached, and while you try to attach your root level entity, it will throw same error for entities that exist in navigation properties. Because detach method does not recursively detach every entity from navigation properties.
Attach/Detach Extension Methods
Finally after brainstorming little, I made following class that will allow you to recursively detach/attach object graphs from DomainContext. You can replace DomainContext to ObjectContext to use it inside Entity Framework.