Esempio n. 1
0
        public static TEntity ToEntity <TEntity>(this BaseEvent eventBase) where TEntity : Entity
        {
            if (eventBase == null)
            {
                throw new ArgumentNullException(nameof(eventBase));
            }

            return(eventBase.Map <TEntity>());
        }
Esempio n. 2
0
        /// <summary>
        /// Execute a mapping from the _event to a new model
        /// </summary>
        /// <typeparam name="TModel">Model type</typeparam>
        /// <param name="_event">Event to map from</param>
        /// <returns>Mapped model</returns>
        public static TModel EventToModel <TModel>(this BaseEvent _event) where TModel : BaseEntityModel
        {
            if (_event == null)
            {
                throw new ArgumentNullException(nameof(_event));
            }

            return(_event.Map <TModel>());
        }