Exemplo n.º 1
0
        public static string DeleteUrlFor(this IFubuPage page, object model)
        {
            var editType = typeof(RestfulDeleteRequest <>).MakeGenericType(model.GetType());
            var request  = Activator.CreateInstance(editType).As <IRequestById>();

            request.Id = AwesomeConfiguration.GetIdValue(model);
            return(page.Urls.UrlFor(request));
        }
Exemplo n.º 2
0
        public static string AwesomeUrlFor(this IFubuPage page, object model, bool isNew)
        {
            var editType = typeof(RestfulPatchRequest <>).MakeGenericType(model.GetType());
            var request  = Activator.CreateInstance(editType).As <IRequestById>();

            request.Id = AwesomeConfiguration.GetIdValue(model);
            return(isNew
                       ? page.Urls.UrlFor(typeof(RestfulCreateHandler <>).MakeGenericType(model.GetType()))
                       : page.Urls.UrlFor(request));
        }