Example #1
0
        public MakeProduct CreateMakeProduct(MakeProduct makeProduct)
        {
            if (makeProduct.AssemblyMmsId != null)
            {
                makeProduct.AssemblyMms = _assemblyMmsRepository
                                          .GetAssemblyMms(makeProduct.AssemblyMmsId);
            }
            else
            {
                throw new ArgumentException($"Please, enter ID Assembly Mms ");
            }
            if (makeProduct.AuthorId != null)
            {
                makeProduct.Author = _authorRepository
                                     .GetAuthor(makeProduct.AuthorId.Value);
            }
            if (makeProduct.WarehouseId != null)
            {
                makeProduct.Warehouse = _warehouseRepository
                                        .GetWarehouse(makeProduct.WarehouseId.Value);
            }

            return(_makeProductRepository.CreateMakeProduct(makeProduct));
        }