public async Task InsertActivityAsync( string shareKey, string title, string description, DateTime activityTime, ActivityType activityType) { var share = await shareRepository.GetByShareKeyAsync(shareKey); if (share == null) { throw new InvalidOperationException($"No share with share key {shareKey} found!"); } await activityInteractor.InsertAsync( share.SharingUserId, new Activity { Title = title, Description = description, ActivityTime = activityTime, ActivityType = activityType, }); }
public async Task <ActionResult> Create([FromBody] Activity newActivity) { var result = await activityInteractor.InsertAsync(currentUserInformation.UserId, newActivity); return(Ok(result)); }