This project is read-only.

ActiveRecord (Abel Perez)

The ActiveRecord Framework includes an extensible lightweight Data Access Layer based on convention over configuration. The default implementation of this ActiveRecord is effectively a layer of abstraction over Enterprise Library 2.0. The following code snippets illustrate the ease of use of ActiveRecord.

Example: creates an instance of DataAccess that map to a Car entity.
  DataAccess<Car> dao = new DataAccess<Car>("mydatabase");


note: assume we have a Car with pk of 100 in the database

Example: selects a Car entity that matches the specified id.
  Car car = dao.Select(100);


Example: selects all Car entities.
  EntityCollection<Car> cars = dao.SelectAll();


Example: persists a new Car entity.
  Car car = new Car(); 
  car.Name = "BMW"
  car.Trim = "330i-2006";   
   
  car = dao.Save(car);
   
  Console.WriteLine("Saved car: {0}", car.Id); // identity is populated on result.


Example: Updates an existing Car entity.
  Car car = dao.Select(100);
  car.Trim = "335i";
  
  dao.Update(car);  


Example: Deletes an existing Car entity.
  dao.Delete(100);


Most of the methods illustrated above provide an overloaded version that takes a RowMapper delegate type. The RowMapper allows you to map from an IDataReader to your custom entity object. The use case scenario for RowMapper is to allow for extensibility and compatibility with database entities that do not follow the expected ActiveRecord convention. For more information on ActiveRecord visit the ActiveRecord documentation page or visit my blog (Abel Perez) for additional information.

Example: Select operation with RowMapper.
  RowMapper<LegacyCar> rowMapper = LegacyCarMapper;

  public LegacyCar LegacyCarMapper(IDataReader reader)
  {
    LegacyCar entity = new LegacyCar();
    entity.Id = (long) reader["car_Id"];
    entity.Name = reader["car_name"] as string;
    entity.Trim = reader["car_description"] as string;
    return entity;
  }

  LegacyCar car = dao.Select(101, rowMapper);


AOP (Justa.Aspect)

comming soon Justa.Aspect

Dynamic Proxies (Justa.DynamicProxy)

Simple API for generating dynamic proxies Justa.DynamicProxy

Asynchronous Messaging (Justa.Messaging)

Just.Messaging is a lightweight asynchronous messaging framework that encapsulates the complexity of working directly with the .NET Messaging API by providing an easy to use friendly Messaging API. Asynchronous Messaging

Last edited Apr 16, 2011 at 7:16 AM by aperez, version 33