Пример #1
0
        public async Task <bool> Put(string mailId, [FromBody] CreateMailModel model)
        {
            // Consider: Should this be moved in a MailService?
            var mail = new Mail(mailId)
            {
                ToFarmerId        = model.ToFarmerId,
                Text              = model.Text,
                FromFarmerId      = model.FromFarmerId,
                ClientCreatedDate = model.CreatedDate,
                ServerCreatedDate = DateTime.Now.ToUniversalTime()
            };

            return(await _repository.InsertOrReplace(mail));
        }