Пример #1
0
        public EntityCDto EntityMapping(IEntityC entityC)
        {
            // Comprobamos el parámetro de entrada.
            Guard.ArgumentIsNotNull(
                                    entityC,
                                    string.Format(
                                                    Inflexion2.Resources.Framework.MapperErrorEntityNull,
                                                    "Entity C") // usar un fichero de recursos para el dominio de negocio Company.Product.BoundedContext.Resources.Business.CategoriaAlias
                                                 );

            EntityCDto entityCDto = new EntityCDto();

            entityCDto.Id = entityC.Id;
            entityCDto.Name = entityC.Name;
            return entityCDto;
        }
Пример #2
0
        public EntityCDto EntityMapping(IEntityC entityC)
        {
            // Comprobamos el parámetro de entrada.
            Guard.ArgumentIsNotNull(
                entityC,
                string.Format(
                    Inflexion2.Resources.Framework.MapperErrorEntityNull,
                    "Entity C")                                 // usar un fichero de recursos para el dominio de negocio Company.Product.BoundedContext.Resources.Business.CategoriaAlias
                );

            EntityCDto entityCDto = new EntityCDto();

            entityCDto.Id   = entityC.Id;
            entityCDto.Name = entityC.Name;
            return(entityCDto);
        }
Пример #3
0
        public void testNonDefaultConstructorOnImplementedObject()
        {
            try
            {
                IEntityC entity = EntityFactory.CreateEntity <IEntityC>();
                Assert.AssertNotNull(entity);

                ConstructorInfo[] declaredConstructors = entity.GetType().GetConstructors(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static);
                Assert.AssertEquals(1, declaredConstructors.Length);

                ConstructorInfo defaultConstructor = declaredConstructors[0];
                Assert.AssertEquals(0, defaultConstructor.GetParameters().Length);
            }
            catch (Exception t)
            {
                // TODO support orm.xml for interfaces
                // -> java.lang.IllegalArgumentException: No metadata found for entity of type class de.osthus.ambeth.bytecode.IEntityC$A1 (class
                // de.osthus.ambeth.bytecode.IEntityC$A1)
                Assert.Fail(t.Message);
            }
        }