Beispiel #1
0
 public void AddWeight(Weight weight)
 {
     weight.LastModifiedDateUtc = DateTime.UtcNow;
     weight.CreatedDateUtc      = DateTime.UtcNow;
     weight.LastModifiedBy      = 1;
     _repository.Create(weight);
 }
Beispiel #2
0
        private int AddWeightTo(int?postId, int?commentId, int amount)
        {
            var weight = new Weight
            {
                Amount  = amount,
                Created = DateTime.Now,
            };

            var user = _userContext.GetCurrentUser();

            return(_weightRepository.Create(postId, commentId, weight, user.Id));
        }