예제 #1
0
 public async Task <int> Write(string message)
 {
     _db.Add(new Message()
     {
         MessageId = Guid.NewGuid(), CreateAt = DateTime.Now, Text = message
     });
     return(await _db.SaveChangesAsync());
 }
예제 #2
0
        private MessagePing SeedRecord()
        {
            MessagePing testSubject = new MessagePing();
            MessagePing operationResult = null;
            testSubject.Id = recordId;
            testSubject.Source = "+919840200524";
            testSubject.Destination = "+918903442090";
            testSubject.Message = "Hello!!";
            testSubject.MessageSentUTC = DateTime.UtcNow;

            using (var context = new MessagingContext(connectionStringName))
            {
                operationResult = context.Add(testSubject);
            }
            return operationResult;
        }