Esempio n. 1
0
        public SizeDto CreateSize(SizeDto sizeDto)
        {
            var size = _mapper.Map <Size>(sizeDto);
            int res  = _repo.Create(size);

            if (res <= 0)
            {
                return(null);
            }
            return(sizeDto);
        }
Esempio n. 2
0
        public async Task CreateSize(string sizeText)
        {
            var sizes = await _sizeRepository.Get();

            var lastSize  = sizes.OrderByDescending(x => x.SizeOrder).FirstOrDefault();
            var sizeOrder = lastSize?.SizeOrder ?? 0;
            var size      = new Size {
                SizeText = sizeText, SizeOrder = sizeOrder + 1
            };
            await _sizeRepository.Create(size);
        }
 public void CreateSize(Size size)
 {
     _sizeRepository.Create(size);
 }