Пример #1
0
        protected override void OnInitialized()
        {
            Config = (PocoConfig)Configuration;

            Actions.Add(Tokens.Namespace, (ctx, obj) => Config.Namespace);
            Actions.Add(Tokens.ObjectName, (ctx, obj) => obj.Name.ToSingular());
            Actions.Add(Tokens.ObjectBaseClass, (ctx, obj) => Config.GenericBaseClass
                                                                ? Config.ObjectBaseClass + '<' + obj.KeyDataType.ToCodeDataType() + '>'
                                                                : Config.ObjectBaseClass);
            Actions.Add(Tokens.OutputSuffix, (ctx, obj) => Config.OutputSuffix);
            Actions.Add(Tokens.PropertiesStub, (ctx, obj) => GetPropertiesReplacement(obj.Properties));
            Actions.Add(Tokens.ConstructionStub, (ctx, obj) => GetConstructionReplacement(obj.Properties));
            Actions.Add(Tokens.BaseTypeName, (ctx, obj) => (obj.BaseType == typeof(object))
                                                                ? string.Empty
                                                                : ": " + obj.BaseTypeFormattedName);
        }
Пример #2
0
 protected override void OnInitialized()
 {
     Config = (PocoConfig)Configuration;
 }