public void MapsDto2ToDomain2()
        {
            var from = new Dto2();
            var to   = this.mapper.Map <DomainType2>(from);

            to.ShouldBeOfType <DomainType2>();
        }
Ejemplo n.º 2
0
 public static bool operator ==(Dto Dto1, Dto Dto2)
 {
     if ((object)Dto1 == null && (object)Dto2 == null)
     {
         return(true);
     }
     if ((object)Dto1 == null || (object)Dto2 == null)
     {
         return(false);
     }
     return((Dto1.GetType() == Dto2.GetType()) && (Dto1.Id == Dto2.Id));
 }
            public void ClassInlined()
            {
                var processor = new Processor <Dto2>();

                byte[] data = new byte[5];

                for (var i = 0; i < 100; i++)
                {
                    _rand.NextBytes(data);

                    var dto = new Dto2(data);
                    processor.ProcessInlined(ref dto);
                }
            }
Ejemplo n.º 4
0
        /// <summary>
        /// Sample Add method
        /// </summary>
        /// <param name="dto1">Object 1</param>
        /// <param name="dto2">Object 2</param>
        /// <returns></returns>
        public Task AddAsync(Dto1 dto1, Dto2 dto2)
        {
            _entity1Repository.Add(new Entity1
            {
                Id    = Guid.NewGuid().ToString(),
                Prop1 = dto1.Prop1,
                Prop2 = dto1.Prop2
            });

            _entity2Repository.Add(new Entity2
            {
                Id    = Guid.NewGuid().ToString(),
                Prop1 = dto2.Prop1,
                Prop2 = dto2.Prop2
            });

            return(_repositoryContext.CommitAsync());
        }