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 cdmdotnet.AutoMapper;
11 :
12 : namespace Cqrs.Sql.DataStores
13 : {
14 : /// <summary>
15 : /// Converts and clones object data.
16 : /// </summary>
17 : public static class Converters
18 1 : {
19 : /// <summary>
20 : /// Convert/Clone data from the provided <paramref name="value"/> into a new instance of type <typeparamref name="T"/>.
21 : /// </summary>
22 : /// <typeparam name="T">The <see cref="Type"/> to convert to.</typeparam>
23 : /// <param name="value">The <see cref="object"/> to convert/clone data from</param>
24 1 : public static T ConvertTo<T>(object value)
25 : where T : new()
26 : {
27 : var results = new AutomapHelper().Automap<object, T>(value);
28 : return results;
29 : }
30 : }
31 : }
|