示例#1
0
        public async Task AddAsync
            (Guid id, Guid userId, string category, string name, string description, DateTime createdAt)
        {
            var activitycategory = new Category
            {
                Name = category,
                Id   = Guid.NewGuid()
            };
            // if (activitycategory == null)
            // {
            //     throw new ActioException("category_not_found",$"Category:'{category}was not found.");
            // }

            var activity = new Domain.Core.Activity(id, activitycategory, userId,
                                                    name, description, createdAt);
            await _activityRepository.AddAsync(activity);
        }
示例#2
0
 public async Task AddAsync(Domain.Core.Activity activity)
 => await Collection.InsertOneAsync(activity);