// GET api/values public IEnumerable<string> Get() { var msg = new EmailMessageDetails { Folder = "my folder", EhloIp = "123456789012345678" }; TruncateStrings.Execute(msg); return new string[] { "value1", "value2" }; }
public void Post(EmailMessageDetails input) { _log.Info("START email message processing"); TruncateStrings.Execute(input); try { NHibernateSession.Save(input); NHibernateSession.Flush(); } catch (Exception e) { if (e.InnerException != null && e.InnerException.Message.Contains("Cannot insert duplicate key")) { _log.InfoFormat("Duplicate key Exception for message id:{0}", input.Id); return; } throw; } _log.Info("END email message processing"); }