public void CreateWareHouse(string name)
        {
            var newWareHouse = new Infrastructure.Entities.WareHouse()
            {
                Name = name
            };

            writeService.Repository <Infrastructure.Entities.WareHouse>().Insert(newWareHouse);
            writeService.SaveChanges();

            ApplyEvent(new WareHouseCreated(newWareHouse.Id, newWareHouse.Name));
        }
示例#2
0
        public Task ExecuteAsync(UploadFilesCommand command)
        {
            foreach (var item in command.FileMetadatas)
            {
                var id = _fsService.UploadFile(item.Name, item.Data).Result;
                _writeService.Repository <FileMetadata>().Insert(new FileMetadata {
                    Name = item.Name, FileSystemId = id
                });
                _writeService.SaveChanges();
            }

            return(Task.CompletedTask);
        }