Exemple #1
0
        // POST api/competence
        public void Post(UserCompetenceUpdateModel updateModel)
        {
            var repo    = new UserCompetenceRepository();
            var entity  = repo.Get(updateModel.UserId);
            var command = new CompetenceUpdateCommand {
                CompentenceText = updateModel.CompetenceText
            };

            entity.UpdateCompentence(command);
        }
        public static void AppendToStream(string streamId, CompetenceUpdateCommand command, string commandType)
        {
            var envelope = new CommandEnvelope(streamId, command, commandType);
            var json     = JsonConvert.SerializeObject(envelope);

            lock (SyncRoot)
            {
                var storageFile = DatabaseFilePath;
                File.AppendAllLines(storageFile, new[] { json });
            }
        }
 public void Store(UserCompetence aggregate, CompetenceUpdateCommand command)
 {
     List.Add(new Entry {
         aggregate = aggregate, command = command
     });
 }
        public void Store(UserCompetence aggregate, CompetenceUpdateCommand command)
        {
            CommandStore.AppendToStream(aggregate.GetId(), command, Commands.CompetenceUpdateCommandType);

            Factory.GetChartManager().UserCompetenceChange(command);
        }