EntitySpaces

EntitySpaces

Infobox_Software
name = EntitySpaces
developer = EntitySpaces, LLC
latest_release_version = EntitySpaces 2008.1.0811.0
latest_release_date = 10 August 2008
latest_preview_version = EntitySpaces 2008.1.0820.0
operating_system = Cross-platform
platform = .NET 2.0+ and Mono
programming_language = C#
genre = Object-relational mapping
license = [http://www.entityspaces.net/portal/Default.aspx?TabId=97 Licensed per developer seat]
website = http://www.entityspaces.net
EntitySpaces is an object-relational mapping tool, whose architecture can be used when writing an ASP.NET, .NET Framework or .NET Compact Framework application. The architecture is provider independent, allowing developers to run the same binary code against any of the supported databases. EntitySpaces works with both C# and VB.NET and uses no reflection and no XML files.

Although EntitySpaces targets both ASP.NET and Windows.Forms projects, DotNetNuke module developers can use the architecture as an alternative to the DotNetNuke DAL. Many of the features listed below, including important ones like transactions, are not available when using the DotNetNuke DAL API.

History

EntitySpaces, LLC

On January 18, 2006 a filing was made for the formation of "EntitySpaces, LLC", a limited liability company. On January 23, 2006 EntitySpaces, LLC officially became a legal entity. In February, EntitySpaces, LLC put together a commercial offering for the EntitySpaces .NET architecture.

Doodads

The dOOdads .NET Architecture was created by Mike Griffin [ [http://www.dotnetrocks.com/default.aspx?showNum=276 EntitySpaces on .Net Rocks] ] and, in many ways, is the progenitor of EntitySpaces. During the dOOdads architecture development and evolution, a lot was learned from the community, much of which has made its way into EntitySpaces. [ [http://www.entityspaces.net/portal/Products/EntitySpacesArchitecture/tabid/139/Default.aspx EntitySpaces Architecture History] ]

The dOOdads architecture is written natively in both C# and VB.NET. The dOOdads .NET architecture also comes with MyGeneration templates that generate native C# or VB.NET dOOdad classes.

The EntitySpaces binaries are written in C#. Templates are available to generate both C# and VB.NET concrete and abstract classes, so EntitySpaces is fully supported for both languages, but native VB.NET binaries are not provided. [ [http://www.kevinsouthworth.com/Blog/tabid/59/articleType/ArticleView/articleId/22/SubSonic-vs-EntitySpaces--A-Battle-of-ORMs.aspx EntitySpaces On Kevin Southworths Blog] ]

Providers Available

* Microsoft SQL Server / SQL CE
* Microsoft Access
* Oracle
* MySQL
* VistaDB [ [http://www.vistadb.net/forums/viewtopic.php?t=2612&sid=476bac17c19880bb272b6fa15ff9e8cb VistaDB Support] ]
* PostgreSQL [ [http://www.postgresql.org/about/news.854 PostgreSQL Support] ]

EntitySpaces Features

Examples

The following are examples of using EntitySpaces with the Northwind Database.

Loading a Collection

This sample loads all Employees in the database.

EmployeesCollection coll = new EmployeesCollection(); if(coll.LoadAll()) { foreach (Employees emp in coll) { Console.WriteLine(emp.LastName); } }

Querying a Collection

This sample loads all Employees whose last name starts with “Smi”.

EmployeesCollection coll = new EmployeesCollection(); coll.Query.Where(coll.Query.LastName.Like("Smi%") if(coll.Query.Load()) { foreach (Employees emp in coll) { Console.WriteLine(emp.LastName); } }

Saving a Collection

Here the Employees are being transferred to Indianapolis. You never call Save on the single entity when it lives in a collection. Save will commit all modified, added, and deleted rows.

EmployeesCollection coll = new EmployeesCollection(); if(coll.LoadAll()) { foreach (Employees emp in coll) { emp.City = "Indianapolis"; } coll.Save(); }

Adding new records through a Collection

Here two new Employees are being added and saved.

EmployeesCollection coll = new EmployeesCollection(); Employees emp = coll.AddNew(); emp.FirstName = "Joe"; emp.LastName = "Smith"; emp = coll.AddNew(); emp.FirstName = "Sue"; emp.LastName = "Smith"; coll.Save();

Deleting a record through a Collection

This example demonstrates the use of FindByPrimaryKey to locate a particular Employee in the collection, then marks it as deleted, and finally saves the collection.

EmployeesCollection coll = new EmployeesCollection(); coll.LoadAll(); Employees emp = coll.FindByPrimaryKey(41); if(emp != null) { emp.MarkAsDeleted(); coll.Save(); }

If you need to delete all of the records from a table, you use the MarkAllAsDeleted method as follows:

EmployeesCollection coll = new EmployeesCollection(); coll.LoadAll(); coll.MarkAllAsDeleted(); coll.Save();

External links

* [http://www.entityspaces.net EntitySpaces Website]
* [http://www.entityspaces.net/Documentation/Videos/newpres/ES_Presentation.html EntitySpaces MyGeneration Presentation]
* [http://www.entityspaces.net/Documentation/Videos/ES2008CodeSmith.swf EntitySpaces CodeSmith Presentation]
* [http://www.mygenerationsoftware.com/portal/default.aspx MyGeneration - Code Generation and OR Mapping]

ee also

*List of object-relational mapping software

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • List of object-relational mapping software — This is a list of well known object relational mapping software. This list is neither up to date nor all inclusive.Java*Carbonado, open source framework, backed by Berkeley DB or JDBC *Cayenne, apache, open source for java *Ebean, open source ORM …   Wikipedia

  • Motor de persistencia — Saltar a navegación, búsqueda En la actualidad existen distintos motores de persistencia. Estos motores facilitan el mapeo objeto relacional de atributos entre una base de datos relacional tradicional y suplen la funcionalidad de una base de… …   Wikipedia Español

  • Anexo:Motores de persistencia — Esta es una lista alfabética de los principales motores de mapeo objeto relacional, indicando si son libres o comerciales. Contenido 1 ColdFusion 2 Common Lisp 3 Java 4 JavaScript …   Wikipedia Español

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”