Ejemplo n.º 1
0
		public async Task<EditFeedResponse> AddFeedAsync(FeedDto feed)
        {
            var response = new EditFeedResponse();

            try
            {
                var now = DateTime.Now;

                var newFeed = new Feed
                {
                    Class = feed.Class,
                    Mappings = feed.Mappings,
                    Created = now,
                    Updated = now
                };

                var addedArticle = this.feedRepository.Insert(newFeed);
                await this.unitOfWork.CommitAsync();
                response.Status = ResponseStatus.OK;
            }
            catch (Exception ex)
            {
                //this.logService.LogError(ex, new HttpContextWrapper(HttpContext.Current));
                response.Status = ResponseStatus.SystemError;
            }

            return response;
        }
Ejemplo n.º 2
0
        public async Task <EditFeedResponse> AddFeedAsync(FeedDto feed)
        {
            var response = new EditFeedResponse();

            try
            {
                var now = DateTime.Now;

                var newFeed = new Feed
                {
                    Class    = feed.Class,
                    Mappings = feed.Mappings,
                    Created  = now,
                    Updated  = now
                };

                var addedArticle = this.feedRepository.Insert(newFeed);
                await this.unitOfWork.CommitAsync();

                response.Status = ResponseStatus.OK;
            }
            catch (Exception ex)
            {
                //this.logService.LogError(ex, new HttpContextWrapper(HttpContext.Current));
                response.Status = ResponseStatus.SystemError;
            }

            return(response);
        }