Example #1
0
        public async Task <ComponentSpecificationFull> FindAsyncFull(int id, object?userId = null,
                                                                     bool noTracking       = true)
        {
            var query        = PrepareQuery(userId, noTracking);
            var domainEntity = await query
                               .Include(c => c.Component)
                               .Include(c => c.Specification)
                               .ThenInclude(s => s !.UnitOfMeasure)
                               .FirstOrDefaultAsync(c => c.Id.Equals(id));

            var result = _mapper.MapToDALFull(domainEntity);

            return(result);
        }
Example #2
0
 public ComponentFull MapToDALFull(Component domainComponent)
 {
     return(new ComponentFull
     {
         Id = domainComponent.Id,
         Compatibilities1 = domainComponent.Compatibilities1,
         Compatibilities2 = domainComponent.Compatibilities2,
         ManufacturerId = domainComponent.ManufacturerId,
         Manufacturer = domainComponent.Manufacturer,
         ComponentTypeId = domainComponent.ComponentTypeId,
         ComponentType = domainComponent.ComponentType,
         ComponentName = domainComponent.ComponentName,
         ComponentInComputers = domainComponent.ComponentInComputers,
         ComponentSpecifications = domainComponent.ComponentSpecifications.Select(c => _componentSpecificationMapper.MapToDALFull(c)).ToList(),
         ComponentTests = domainComponent.ComponentTests,
         Price = domainComponent.MSRP,
         Model = domainComponent.Model,
         ReleaseYear = domainComponent.ReleaseYear
     });
 }