Language: C#
Extender<T>
using LinqExtender.Configuration.Serialization; namespace LinqExtender.Configuration { /// <summary> /// Fluent generic entry point for configuration settings. /// </summary> /// <typeparam name="T">query object</typeparam> public class Extender<T> : IClassSettings<T> { /// <summary> /// Creates a new instance of <see cref="Extender{T}"/> class. /// </summary> /// <param name="extender">generic <see cref="Extender"/></param> /// <param name="classDescriptor">class settings.</param> public Extender(Extender extender, ClassDescriptor classDescriptor) { this.extender = extender; this.classDescriptor = classDescriptor; } /// <summary> /// Maps a class to an entity. /// </summary> /// <param name="entityName"></param> /// <returns></returns> public IClassSettings<T> MapToEntity(string entityName) { classDescriptor.Name = entityName; return this; } /// <summary> /// Property Settings iterator. /// </summary> public IPropertySettings<T> Begin { get { return new PropertySettings<T>(this, classDescriptor); } } /// <summary> /// Builds and intantiates <see cref="ExtenderElement"/> and invokes <see cref="Query{T}.BuildSettingElement"/> method /// to build the <see cref="ClassElement"/> for current type. /// </summary> public void InstantiateIn(object obj) { extender.InstantiateIn(obj); } internal Extender GenericExtender { get { return extender; } } private readonly ClassDescriptor classDescriptor; private readonly Extender extender; } }
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

