This project is read-only.
Configuration
Registering a new Magiq provider
Magiq.Register<MagiqToSql>();
or
Magiq.Register( new MagiqToSql() );

Clearing previous providers
Magiq.Clear()

Plugins
Magiq.Use<MyPlugin>();

Mass operations
Updates

products.Where( x => x.ExpirationDate <= DateTime.Now ).Set( x => x.State, ProductState.Expired )
                                                       .Set( x => x.Category.HasExpiredProducts, true)
        .Update();

From a collection:

store.Update( x => products.Where( x => x.ExpirationDate <= DateTime.Now ).Set( x => x.State, ProductState.Expired )
                                                                          .Set( x => x.Category.HasExpiredProducts, true));

You can call Set extension method several times in order to define several properties to update, incluiding properties belonging to associations.

Deletes

products.Where( x => x.ExpirationDate <= DateTime.Now ).Delete();

From a collection:

store.Delete( x => x.Products.Where( x => x.ExpirationDate <= DateTime.Now ));


Inserts

expirationRecords.Insert( products.Where( x => x.ExpirationDate <= DateTime.Now )
	  			  .Select( new ExpirationRecord { Description = x.Name + " expired" } ));

Into a collection:

records.InsertInto( x => expirationRecords, products.Where( x => x.ExpirationDate <= DateTime.Now )
                                                    .Select( new ExpirationRecord { Description = x.Name + " expired" } ));

Queries

var availableProducts = store.Query( x => x.Products.Where( x => x.ExpirationDate > DateTime.Now ));


Operation Plugins

var availableProducts = products.Magiq().Using<MyPlugin>().Query( x => x.ExpirationDate > DateTime.Now );

Last edited May 8, 2011 at 12:48 PM by ivos, version 10

Comments

No comments yet.