using System; using System.Web.Mvc; using Akua.Framework.Model.NHibernate; using Akua.Framework.Web.MVC.Controller.Binding; using Akua.Framework.Web.MVC.Helpers; namespace Akua.Framework.Web.MVC.Controller.Attributes { public class FetchAndBindAttribute : CustomModelBinderAttribute { private string _include; public string Include { get { return _include ?? String.Empty; } set { _include = value; } } private string _exclude; public string Exclude { get { return _exclude ?? String.Empty; } set { _exclude = value; } } public string Prefix { get; set; } protected FetchBehavior FetchBehavior { get; set; } public FetchAndBindAttribute(FetchBehavior fetchBehavior) { FetchBehavior = fetchBehavior; } public override IModelBinder GetBinder() { return new RouteQueryFormToModelFetcherAndBinder(FetchBehavior, Prefix, Include, Exclude); } } }