Beispiel #1
0
        public async Task <Guid> Create(Sheet sheetRequest)
        {
            var sheet = SheetAggregate.CreateFromSheetDto(sheetRequest);
            await _sheetAggregateRepo.Add(sheet);

            return(sheet.Id);
        }
Beispiel #2
0
        public SheetAggregate CreateRandomSheet()
        {
            var config = new MapperConfiguration(cfg => cfg.CreateMap <SheetDto, Sheet>());
            var mapper = new Mapper(config);


            var sheetDto = new SheetDto()
            {
                Amount     = amountForRandomSheets,
                ContractId = SheetContractId,
                Date       = DateTime.Now,
                EmployeeId = SheetEmployeeId,
                ServiceId  = SheetServiceId
            };

            var result = SheetAggregate.CreateFromSheetDto(mapper.Map <SheetDto, Sheet>(sheetDto));

            return(result);
        }