Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Programmatic datatype creation

$
0
0
Hi!

I'm trying to move all my datatypes into code, so I created class library project, referenced it from website and created a datatype ICountry:
[ImmutableTypeId("{BF652562-034D-4B0C-9927-191012870B4C}")]
    [KeyPropertyName("Id")]
    [DataScope(DataScopeIdentifier.PublicName)]
    [Title("Country")]
    [AutoUpdateble]
    [LabelPropertyName("Title")]
    [Caching(CachingType.Full)]
    public interface ICountry : IData, ILocalizedControlled, IPageData
    {
        [ImmutableFieldId("{C0347771-B6E4-4893-A9F0-FC397BE4EDEE}")]
        [StoreFieldType(PhysicalStoreFieldType.Guid)]
        Guid Id { get; set; }
        [ImmutableFieldId("{104E6E06-42EB-4735-ACBA-16773BE86C1D}")]
        [StoreFieldType(PhysicalStoreFieldType.String, 128)]
        string Title { get; set; }
    }
After that I put
DynamicTypeManager.EnsureCreateStore(typeof(IMyDataType));
into Global.asax. After running the project i cannot find my datatype in CompositeC1 console. What else do I need to add to make my datatypes automatically appear in console (maybe I've missed something in config, but I couldn't find anything in http://docs.composite.net/Data/Defining-Data-IData-types-in-C1-using-C/Manually-adding-or-removing-a-data-type-in-C1)?

Thank you!

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>