using System; using Quadarax.Foundation.Core.Data.Interface.Entity; using Quadarax.Foundation.Core.Mapper; namespace Quadarax.Foundation.Core.Data.Mapper { public class Mapper : Loom where TMapper : class, new() { /// /// Singleton instance of this class. /// public static TMapper Instance => _instance.Value; private static readonly Lazy _instance = new Lazy(() => new TMapper()); #region ------ Constructors --------------------------------------------------------------- /// /// Initializes a new instance of this class. /// public Mapper() { } /// /// Defines mappings from a DAO to DTO and vice-versa. /// /// /// protected void DefineBiDirection() where TDao : class, IDao, new() where TDto : class, IDto, new() where TKey : IEquatable { Define() .PublicProperties() .Compile(); Define() .PublicProperties() .Compile(); } #endregion } }