public async Task <CommunityInvolvement> UpdateCommunityInvolvment(CommunityInvolvement communityInvolvement)
        {
            _context.CommunityInvolvement.Update(communityInvolvement);
            await _context.SaveChangesAsync();

            return(communityInvolvement);
        }
        public async Task <CommunityInvolvement> AddCommunityInvolvement(CommunityInvolvement communityInvolvement)
        {
            await _context.CommunityInvolvement.AddAsync(communityInvolvement);

            await _context.SaveChangesAsync();

            return(communityInvolvement);
        }
        public async Task <CommunityInvolvement> DeleteCommunityInvolvementById(Guid id)
        {
            CommunityInvolvement communityInvolvement = await GetCommunityInvolvementById(id);

            _context.CommunityInvolvement.Remove(communityInvolvement);
            await _context.SaveChangesAsync();

            return(communityInvolvement);
        }
Beispiel #4
0
        public async Task <CommunityInvolvement> UpdateCommunityInvolvement(CommunityInvolvement communityInvolvement)
        {
            CommunityInvolvement communityInvolvementToUpdate =
                await GetCommunityInvolvementById(communityInvolvement.Id);

            communityInvolvementToUpdate.Title         = communityInvolvement.Title;
            communityInvolvementToUpdate.StartDate     = communityInvolvement.StartDate;
            communityInvolvementToUpdate.Description   = communityInvolvement.Description;
            communityInvolvementToUpdate.EndDate       = communityInvolvement.EndDate;
            communityInvolvementToUpdate.Url           = communityInvolvement.Url;
            communityInvolvementToUpdate.ImageUrl      = communityInvolvement.ImageUrl;
            communityInvolvementToUpdate.Skills        = communityInvolvementToUpdate.Skills;
            communityInvolvementToUpdate.LastUpdatedAt = DateTime.UtcNow;
            return(await _aboutRepository.UpdateCommunityInvolvment(communityInvolvementToUpdate));
        }
Beispiel #5
0
 public async Task <CommunityInvolvement> AddCommunityInvolvement(CommunityInvolvement communityInvolvement)
 {
     communityInvolvement.CreatedAt = DateTime.UtcNow;
     return(await _aboutRepository.AddCommunityInvolvement(communityInvolvement));
 }