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
| namespace WebApplication1 | |
| { | |
| using System.ServiceModel; | |
| using System.ServiceModel.Activation; | |
| [ServiceContract(Namespace = "")] | |
| [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] | |
| public class CityService | |
| { | |
| // Add [WebGet] attribute to use HTTP GET |
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 IMyRepository | |
| { | |
| IEnumerable<Product> GetAllProducts(); | |
| } |
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
| [Tag("Logging")] | |
| public class MyRepository : IMyRepository | |
| { | |
| public IEnumerable<Product> GetAllProducts() | |
| { | |
| // get it from database or from wcf service... | |
| } | |
| } |
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
| <policyInjection> | |
| <policies> | |
| <add name="LoggingPolicy"> | |
| <matchingRules> | |
| <add match="Logging" ignoreCase="false" | |
| type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.MatchingRules.TagAttributeMatchingRule, | |
| Microsoft.Practices.EnterpriseLibrary.PolicyInjection" /> | |
| </matchingRules> | |
| <handlers> | |
| <add order="0" |
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 IMyRepository | |
| { | |
| ICollection<T> GetAll<T>(); | |
| T GetById<T>(Func<T,bool> predicate); | |
| } |
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
| static void Main(string[] args) | |
| { | |
| ObjectFactory.Initialize(x=>x.For<IMyRepository>().Use<MyRepository>()); | |
| ObjectFactory.Configure(x => x.RegisterInterceptor(new StructureMapInterceptor())); | |
| } |
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 void Intercept(IInvocation invocation) | |
| { | |
| var logger = LogManager.GetLogger(invocation.TargetType); | |
| try | |
| { | |
| StringBuilder sb = null; | |
| if (logger.IsDebugEnabled) | |
| { | |
| sb = new StringBuilder(invocation.TargetType.FullName) | |
| .Append(".") |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <dataConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" config:version="6.1.4300.0" initialized="True"> | |
| <connectionStrings> | |
| <add connectionString="data source=(local);UID=sa;PWD=pwn;initial catalog=sf_DEV" providerName="System.Data.SqlClient" dbType="MsSql" name="Sitefinity" /> | |
| </connectionStrings> | |
| <urlEvaluators> | |
| // some values there ........ | |
| </urlEvaluators> | |
| </dataConfig> |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <dataConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xdt:Transform="SetAttributes" incrementalGuidRange="2"> | |
| <connectionStrings> | |
| <add connectionString="data source=127.0.0.1;UID=sa;PWD=pwd;initial catalog=sf_UAT" providerName="System.Data.SqlClient" dbType="MsSql" | |
| name="Sitefinity" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" /> | |
| </connectionStrings> | |
| </dataConfig> |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <dataConfig xmlns:config="urn:telerik:sitefinity:configuration" | |
| xmlns:type="urn:telerik:sitefinity:configuration:type" config:version="6.1.4300.0" initialized="True" | |
| incrementalGuidRange="0"> | |
| <connectionStrings> | |
| <add connectionString="data source=(local);UID=sa;PWD=pwn;initial catalog=sf_DEV" providerName="System.Data.SqlClient" dbType="MsSql" | |
| name="Sitefinity" /> | |
| </connectionStrings> | |
| <urlEvaluators> | |
| // some values there ........ |