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));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public Task Consume(ConsumeContext <WriteLogEvent> context)
        {
            _writeService.Repository <LogData>().Insert(new LogData()
            {
                Date              = context.Message.Date,
                Level             = context.Message.Level,
                Thread            = context.Message.Thread,
                Logger            = context.Message.Logger,
                Message           = context.Message.Message,
                Data              = context.Message.Data,
                StackTrace        = context.Message.StackTrace,
                ExceptionTypeName = context.Message.ExceptionTypeName
            });
            context.Respond(new { Status = true });

            return(Task.CompletedTask);
        }