public void Add(CustomerNotification notification) { notification.NotificationID = System.Guid.NewGuid().ToString(); CustomerNotificationDb d = NotificationToDbNotification(notification); context.AttachTo(TableName, d, null); context.UpdateObject(d); context.SaveChangesWithRetries(); context.Detach(d); }
private CustomerNotificationDb NotificationToDbNotification(CustomerNotification c) { return new CustomerNotificationDb() { PartitionKey="Cust"+c.CustomerID.ToString(), RowKey=c.NotificationID, CustomerID=c.CustomerID, NotificationID=c.NotificationID, Text=c.Text, Type=c.Type, ChallengeID=c.ChallengeID, Read=c.Read }; }