Vibrant discussion about CSLA .NET and using the framework to build great business applications.
Hi!
Does anyone know about any Coderush templates for CSLA and is willing to share them?
I created some Coderush templates to create CSLA 3.5 properties. Hope it is usefull for someone.
I named this one "cslap" (CSLA Property)
private «Link(string)» «Link(PropertyName,FormatFieldName,PropertyNameFromField)»;private static PropertyInfo<«Link(string)»> «Link(PropertyName)»Property = RegisterProperty<«Link(string)»>(typeof(«Class»), new PropertyInfo<«Link(string)»>("«Link(PropertyName)»"));public «FieldStart»«Caret»«Link(string)»«BlockAnchor»«FieldEnd» «FieldStart»«Caret»«Link(PropertyName)»«BlockAnchor»«FieldEnd»{ get { return GetProperty<«Link(string)»>(«Link(PropertyName)»Property, «Link(PropertyName,FormatFieldName,PropertyNameFromField)»); } set { SetProperty<«Link(string)»>(«Link(PropertyName)»Property, ref «Link(PropertyName,FormatFieldName,PropertyNameFromField)», value); }}
This one is named "cslap?Type?". So you can type for example "cslai" to create CSLA integer property.
private «Link(«?Get(Type)»)» «Link(PropertyName,FormatFieldName,PropertyNameFromField)»;private static PropertyInfo<«Link(«?Get(Type)»)»> «Link(PropertyName)»Property = RegisterProperty<«Link(«?Get(Type)»)»>(typeof(«Class»), new PropertyInfo<«Link(«?Get(Type)»)»>("«Link(PropertyName)»"));public «FieldStart»«Caret»«Link(«?Get(Type)»)»«BlockAnchor»«FieldEnd» «FieldStart»«Caret»«Link(PropertyName)»«BlockAnchor»«FieldEnd»{ get { return GetProperty<«Link(«?Get(Type)»)»>(«Link(PropertyName)»Property, «Link(PropertyName,FormatFieldName,PropertyNameFromField)»); } set { SetProperty<«Link(«?Get(Type)»)»>(«Link(PropertyName)»Property, ref «Link(PropertyName,FormatFieldName,PropertyNameFromField)», value); }}
Regards,
Gunnar