This file contains 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 System; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Description; | |
using System.ServiceModel.Dispatcher; | |
using Castle.Core.Logging; | |
/// <summary> | |
/// Being a custom EndpointBehavior added to the WCF services to provide custom error handling functionality. | |
/// Namely, logging error so it doesn't get ignored. | |
/// </summary> |
This file contains 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 System; | |
using System.ServiceModel.Description; | |
using Castle.Core.Logging; | |
/// <summary> | |
/// Being a custom EndpointBehavior added to the WCF services such that each operation outputs | |
/// a debug log message before and after invocation. | |
/// </summary> | |
public class OperationLoggingEndpointBehavior : IEndpointBehavior | |
{ |
This file contains 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
AutoMapper.Mapper.AssertConfigurationIsValid(); |
This file contains 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 IdeaMap : ClassMap<Idea> | |
{ | |
public IdeaMap() | |
{ | |
Id(x => x.Id) | |
.Column("ID") | |
.GeneratedBy.Identity(); | |
Map(x => x.Summary).Not.Nullable(); | |
Map(x => x.Description).WithMaxSize().Not.Nullable(); |
This file contains 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
DbDatabase.SetInitializer<MyAppContext>(null); |
This file contains 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 MyAppPrimaryKeyConvention : IConfigurationConvention<PropertyInfo, PrimitivePropertyConfiguration> | |
{ | |
public void Apply(PropertyInfo memberInfo, Func<PrimitivePropertyConfiguration> configuration) | |
{ | |
if (memberInfo.Name == "Id") | |
{ | |
// We need to avoid overriding concrete class mapped using TPH. | |
if (memberInfo.ReflectedType.IsSubclassOf(typeof(ProductFeature)) || | |
memberInfo.ReflectedType.IsSubclassOf(typeof(ProductInsert))) | |
{ |
This file contains 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 Order | |
{ | |
public Order() | |
{ | |
this.Address = new Address(); | |
} | |
public virtual Address Address { get; set; } | |
} |
This file contains 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
/// <summary> | |
/// Search for a collection of customers, given a set of criteria. | |
/// </summary> | |
/// <param name="queryCriteria" />Query Object defining the search criteria.</param> | |
/// <returns>Collection of customers matching the specified criteria.</returns> | |
/// <exception cref="System.ArgumentNullException">Where queryCriteria is null</exception> | |
/// <exception cref="System.ArgumentException">Where no query criteria have been set (we do not permit searching for all customers)</exception> | |
public static CustomerCollection Find(CustomerQuery queryCriteria) | |
{ | |
#region Validate parameters |
This file contains 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 System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
namespace IanFNelson | |
{ | |
[Serializable()] | |
public class KeyValuePairCollection<TKey, TValue> : | |
Collection<KeyValuePairThatSerializesProperly<TKey, TValue>> | |
{ | |
public void Add(TKey key, TValue value) |
This file contains 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 System; | |
using System.Reflection; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Text; | |
using System.Globalization; | |
namespace IanNelson.Utilities | |
{ |