public async Task <int> Write(string message) { _db.Add(new Message() { MessageId = Guid.NewGuid(), CreateAt = DateTime.Now, Text = message }); return(await _db.SaveChangesAsync()); }
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; }