Ejemplo n.º 1
0
        protected virtual bool DoCreate <TEntity, TModel>(ICommandCreateBase <TModel> command, IRpstBase <TEntity> repository)
            where TEntity : DtoBase
        {
            TEntity entity;

            try
            {
                entity = Mapper.Map <TEntity>(command.Model);
                repository.Add(Context, entity);
                return(true);
            }
            catch
            {
                SericeResult.ErrorMessages.Add(Constants.CommonMessages.AUTO_MAPPING_DOMAIN_TO_DATA_FAILED);
                SericeResult.Success = false;
                return(false);
            }
        }