Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using System.Runtime.Serialization;
11 :
12 : namespace Cqrs.Domain.Exceptions
13 : {
14 : /// <summary>
15 : /// A parameterless constructor is missing.
16 : /// </summary>
17 : [Serializable]
18 : public class MissingParameterLessConstructorException : Exception
19 1 : {
20 : /// <summary>
21 : /// Instantiate a new instance of <see cref="MissingParameterLessConstructorException"/> with the <see cref="Type"/> of the object that needs to have a parameterless constructor.
22 : /// </summary>
23 : /// <param name="type">The <see cref="Type"/> of the object that needs to have a parameterless constructor.</param>
24 1 : public MissingParameterLessConstructorException(Type type)
25 : : base(string.Format("{0} has no constructor without parameters. This can be either public or private", type.FullName))
26 : {
27 : Type = type;
28 : }
29 :
30 : /// <summary>
31 : /// The <see cref="Type"/> of the object that needs to have a parameterless constructor.
32 : /// </summary>
33 : [DataMember]
34 : public Type Type { get; set; }
35 : }
36 : }
|