public async Task<IHttpActionResult> GetSentToMe(string userId)
        {
            if (string.IsNullOrEmpty(userId))
            {
                return HttpBadRequest();
            }
            var result = await Repository.FindSentTo(userId);

            if (result.Any() == false)
            {
                result = new Moment[] { new Moment { Id = "No moments yet!" } };
            }
            return Json(result);
        }
Example #2
0
        internal void Add(Moment model)
        {
            var entity = ToEntity(model);

            Insert(entity.Tuple);
        }