示例#1
0
 internal void SaveDefinition(PostDefinitionCommand command, Guid id)
 {
     DefinitionsContextFactory contextFactory = new DefinitionsContextFactory();
     AnonoMightEntities context = contextFactory.GetContext(command.SiteName);
     context.Definitions.Add(new Definition { Id = id, Text = command.Text, Name = command.Title, TimeStamp = DateTime.Now, Reports = 0 });
     context.SaveChanges();
 }
示例#2
0
 public void PostDefinition(PostDefinitionCommand command)
 {
     Guid id = Guid.NewGuid();
     _dataPersistor.SaveDefinition(command, id);
     Clients.Group(command.SiteName).postDefinitionReceived(new PostedDefinitionEvent { Id = id, Title = command.Title, Text = command.Text, Timestamp = DateTime.Now });
 }