comparison Agendas/trunk/src/Agendas.NHibernate/EventoStateType.cs @ 140:3639803112c6

Refactoring de la relación entre Evento y Estado
author nelopauselli
date Fri, 29 Jul 2011 16:30:53 -0300
parents
children 68b09c30b0d2
comparison
equal deleted inserted replaced
139:18e5a78186e4 140:3639803112c6
1 using System.Collections.Generic;
2 using AltNetHispano.Agendas.Domain;
3 using NHibernate.SqlTypes;
4
5 namespace Agendas.NHibernate
6 {
7 public class EventoStateType : GenericWellKnownInstanceType<EventoState, string>
8 {
9 public static IEnumerable<EventoState> All
10 {
11 get
12 {
13 return new[]
14 {
15 EventoNullState.GetInstance(), EventoPropuestoState.GetInstance(), EventoAgendadoState.GetInstance(),
16 EventoConfirmadoState.GetInstance(), EventoPublicadoState.GetInstance(), EventoCanceladoState.GetInstance(),
17 EventoDescartadoState.GetInstance()
18 };
19 }
20 }
21
22 public EventoStateType()
23 : base(All, (state, id) => state.Descripcion == id, state => state.Descripcion)
24 {
25 }
26
27 public override SqlType[] SqlTypes
28 {
29 get { return new[] {SqlTypeFactory.GetString(25)}; }
30 }
31 }
32 }