示例#1
0
 public MessagesController(ApplicationDbContext context)
 {
     _db = context;
     context.Messages.Add(new Message()
     {
         MessageId = Guid.NewGuid(),
         AuthorName = "Test Author",
         Body = "Hello Ag!",
         TimeSent = DateTimeOffset.Now
     });
     context.SaveChanges();
 }
示例#2
0
 public MessagesHub(ApplicationDbContext db)
 {
     _db = db;
 }