public async Task <Result> Handle(CreateFeedCommand command) { var feedResult = Feed.Create(command.Id, command.Name); if (feedResult.IsFailure) { return(Result.Fail(feedResult.Error)); } await _feedRepository.Add(feedResult.Value); await _feedRepository.UnitOfWork.SaveChangesAsync(); return(Result.Ok()); }
public async Task <Response <FeedReadDto> > AddFeed(FeedDTO model) { var response = new Response <FeedReadDto>(); var category = FeedProfile.FeedDtoToFeedMapper(model); if (await _feedRepo.Add(category)) { var feedDto = FeedProfile.FeedToFeedReadDtoMapper(category); response.Success = true; response.Message = "category created successfully"; response.Data = feedDto; return(response); } response.Message = "category failed to add"; return(response); }
private Feed Create(FeedViewModel item) { Feed t = new Feed { Title = item.Title, Description = item.Description, Address = item.Address, //ModuleId = ActiveModule.ModuleID, CreatedByUserId = UserInfo.UserID, LastModifiedByUserId = UserInfo.UserID, CreatedOnDate = DateTime.UtcNow, LastModifiedOnDate = DateTime.UtcNow }; _repository.Add(t); return(t); }
public void NavigateTo(string searchValue) { feedRepository.Add(new Uri(searchValue)); }
public ApiResponse <Feed> Insert([FromBody] Feed feed) { return(_feedRepository.Add(feed)); }