Book a Demo

Author Topic: MDG codegen for C# MVC classes  (Read 3234 times)

Jonm

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
MDG codegen for C# MVC classes
« on: December 29, 2010, 04:51:12 pm »
Hi Folks,

I'm thinking of using EA MSG functionality to code generate MVC C# classes.
I want to know if this is possible using EA?
Any advice greatly appreciated.

Here is an example of the MVC class code.


using Vegetation;
namespace Vegetation {
      /// <summary>
      /// Middleware responsible for maintaining Bands with the database.
      /// </summary>
      [DataContract()]
      public class Band : BaseMiddleware<Band> {

            private static PropertyInfo<int> _bandId = RegisterProperty(new PropertyInfo<int>("BandId", "Band Identifier"));
            private static PropertyInfo<int> _colour = RegisterProperty(new PropertyInfo<int>("Colour", "Band Colour"));
            private static PropertyInfo<string> _bandname = RegisterProperty(new PropertyInfo<string>("BandName", "Band Name"));
            private static PropertyInfo<string> _bandlevel = RegisterProperty(new PropertyInfo<string>("BandLevel", "Band Level"));

            public Band(){

            }

            ~Band(){

            }

            public override void Dispose(){

            }

            [DataObjectField(true, true)]
            [DataMember()]
            public int BandId{
                  get;
                  set;
            }

            [DataMember()]
            public int Colour{
                  get;
                  set;
            }

            [DataMember()]
            public string Name{
                  get;
                  set;
            }

            protected override void AddBusinessRules(){

            }

            public static Band_old1 Create(){

                  return null;
            }

            ///
            /// <param name="bandId"></param>
            public static Band_old1 Fetch(int bandId){

                  return null;
            }

            ///
            /// <param name="entity"></param>
            public override void OnCreate<E>(E entity){

            }

            public override void PortalOnCreate(){

            }

            ///
            /// <param name="context"></param>
            public override void PortalOnFetch(Context context){

            }

            public override void PortalOnSave(){

            }

      }//end Band

}//end namespace Vegetation