This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ValidationHelper : IValidationHelper | |
{ | |
public bool AllPropertiesAreValid(object obj) | |
{ | |
if (obj == null) | |
{ | |
return false; | |
} | |
return obj.GetType().GetProperties().All(p => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NameFilterAttribute : ActionFilterAttribute | |
{ | |
public override void OnResultExecuted(ResultExecutedContext resultExecutedContext) | |
{ | |
string companyName = resultExecutedContext.Controller.TempData["SomeName"] as string; | |
string localPathUrl = resultExecutedContext.Controller.TempData["LocalPath"] as string; | |
Dictionary<string, string> stringReplacementDictionary = new Dictionary<string, string>(); | |
if (!string.IsNullOrEmpty(companyName)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MemoryStreamHelper: MemoryStream | |
{ | |
private readonly Stream _responseStream; | |
private readonly Dictionary<string, string> _stringReplacementDictionary; | |
public MemoryStreamHelper(Stream responseStream, Dictionary<string, string> stringReplacementDictionary) | |
{ | |
_responseStream = responseStream; | |
_stringReplacementDictionary = stringReplacementDictionary; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ContextHelpers | |
{ | |
public static UmbracoContext EnsureUmbracoContext() { | |
if (UmbracoContext.Current != null) | |
{ | |
return UmbracoContext.Current; | |
} | |
var httpContext = new HttpContextWrapper(HttpContext.Current ?? new HttpContext(new SimpleWorkerRequest("temp.aspx", "", new StringWriter()))); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ICustomHttpClient | |
{ | |
Task<HttpResponseMessage> GetAsync(string url, int timeout); | |
} | |
//Decorating HttpClient in order to mock it | |
public class CustomHttpClient : ICustomHttpClient | |
{ | |
public CustomHttpClient() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance | |
-- http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/ | |
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate()) | |
-- dump logs | |
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything | |
DELETE FROM umbracolog WHERE Datestamp < @createdDate | |
-- clean up old versions | |
DELETE FROM cmsPropertyData WHERE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance | |
-- http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/ | |
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate()) | |
-- dump logs | |
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything | |
DELETE FROM umbracolog WHERE Datestamp < @createdDate | |
-- clean up old versions | |
DELETE FROM cmsPropertyData WHERE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Autofac; | |
using Autofac.Core; | |
using Autofac.Integration.Mvc; | |
using Autofac.Integration.WebApi; | |
using System.Reflection; | |
using System.Web.Http; | |
using System.Web.Mvc; | |
using tungsten.cms.TungstenServices; | |
using Umbraco.Core; | |
using Umbraco.Core.Services; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Autofac; | |
using Autofac.Integration.Mvc; | |
using Autofac.Integration.WebApi; | |
using System.Reflection; | |
using System.Web.Http; | |
using System.Web.Mvc; | |
using Tungsten_Network.BusinessLogic.Services.Contracts; | |
using Umbraco.Core.Services; | |
using Umbraco.Web; | |
using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT dbo.cmsTemplate.alias AS Template FROM dbo.cmsDocument INNER JOIN | |
dbo.cmsTemplate ON dbo.cmsDocument.templateId = dbo.cmsTemplate.nodeId | |
WHERE (dbo.cmsDocument.published = '1') | |
GROUP BY alias | |
ORDER BY Template |
NewerOlder