public Aggregate Get(int id, [FromQuery] string title) { if (!string.IsNullOrEmpty(title)) { _aggregateRepository.GetByTitle(title); } return(_aggregateRepository.Get(id)); }
public bool Post([FromBody] Event value) { if (value == null) { return(false); } if (!value.AddDate.HasValue) { value.AddDate = DateTime.Now; } if (value.AggregateId == 0) { if (string.IsNullOrEmpty(value.AggregateType)) { return(false); } value.AggregateId = _aggregateRepository.GetByTitle(value.AggregateType).Id; } _eventRepository.Insert(value); return(true); }