Custom Mappings - Happi-cat/Untech.SharePoint GitHub Wiki
Contents
- Start Point
- Namespace Untech.SharePoint.Common.Mappings
- Namespace Untech.SharePoint.Common.MetaModels.Providers
Start Point
- Create own mapping source and inherit it from MappingSource
- Implement IMetaListProvider
- Implement IMetaContentTypeProvider
- Implement IMetaFieldProvider
- Configure and register your mapping as usual:
cfgBuilder.RegisterMappings(n => new YourMappingSource());
Namespace Untech.SharePoint.Common.Mappings
Abstract class MappingSource<TContext>
Represents class that can create MetaContext and resolve list title for the specified member of this context. TContext - Type of the data context that is associated with this instance of the MappingSource{TContext}
Property:
Type ContextType
- Gets Type of the associated Data Context class.
Methods:
abstract MetaContext GetMetaContext()
- Returns instance of MetaContext.abstract string GetListUrlFromContextMember(MemberInfo member)
- Gets list title that associated with member.
Interface IListUrlResolver
Represents interface of object that can resolve list URL by context member.
Methods:
string GetListUrlFromContextMember(MemberInfo member)
- Gets list URL that associated with member.
Interface IMappingSource
Represents interface that can create MetaContext and resolve list title for the specified member of this context. Inherits IMetaContextProvider, IListUrlResolver
Property:
Type ContextType
- Gets Type of the associated Data Context class.
Namespace Untech.SharePoint.Common.MetaModels.Providers
Interface IMetaContextProvider
Represents interface of MetaContext provider.
Methods:
MetaContext GetMetaContext()
- Returns instance of MetaContext.
Interface IMetaListProvider
Represents interface of MetaList provider.
Methods:
MetaList GetMetaList([NotNull]MetaContext parent)
- Returns instance of MetaList.
Interface IMetaContentTypeProvider
Represents interface of MetaContentType provider.
Methods:
MetaContentType GetMetaContentType([NotNull]MetaList parent)
- Returns instance of MetaContentType.
Interface IMetaFieldProvider
Represents interface of MetaField provider.
Methods:
MetaField GetMetaField([NotNull]MetaContentType parent)
- Returns instance of MetaField.