Inheritance: Ncqrs.Domain.AggregateRootMappedByConvention
Exemplo n.º 1
0
 public IHttpActionResult Put(int id, Channel channel)
 {
     Channel existing = Context.Channels.FirstOrDefault(i => i.Id == id);
     if (existing == null)
     {
         return NotFound();
     }
     else
     {
         existing.Name = channel.Name;
         Context.SaveChanges();
         return Ok(existing);
     }
 }
Exemplo n.º 2
0
 public IHttpActionResult Post(Channel channel)
 {
     Channel chan = new Channel(channel.Name, channel.Category, new ChatLog(channel.Id));
     Context.Channels.Add(channel);
     Context.SaveChanges();
     return Created(this.Request.RequestUri.AbsolutePath + "/" + channel.Id, channel);
 }