Ejemplo n.º 1
0
        public async Task <Announcement> UpdateAnnouncementAsync(Guid id, CreateOrUpdateAnnouncementRequest request)
        {
            var announcement = await _announcements.GetAsync(id);

            if (announcement == null)
            {
                return(null);
            }

            announcement.Update(_mapper.Map <Announcement>(request));
            return(await _announcements.UpdateAsync(announcement));
        }
Ejemplo n.º 2
0
        public async Task <Announcement> CreateAnnouncementAsync(CreateOrUpdateAnnouncementRequest request)
        {
            var announcement = _mapper.Map <Announcement>(request);

            return(await _announcements.AddAsync(announcement));
        }