상속: Ncqrs.Domain.AggregateRootMappedByConvention
예제 #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);
     }
 }
예제 #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);
 }