public virtual void Create(Event @event) { if (@event == null) throw new ArgumentNullException("@event"); Dispatcher.Dispatch(AddEvent.CreateFrom(@event)); Cache.AddToList(@event); }
public static AddEvent CreateFrom(Event @event) { return new AddEvent { Date = @event.Date, Id = @event.Id, LogId = @event.LogId, LogName = @event.LogName, UpdatedDate = @event.UpdatedDate, UserId = @event.UserId }; }
public override void Create(Event @event) { Repository.HttpRequestor.Post(ConfigurationProvider.DataServiceLocation + "events", @event, Repository.SessionManager.GetCurrent()); Cache.AddToList(@event); }
private void SaveTags(Log log, User user, Event @event, IEnumerable<Tag> tags) { foreach (var tag in tags) TagRepository.Create(new Tag { LogId = log.Id, LogName = log.Name, EventId = @event.Id, Date = @event.Date, Id = Guid.NewGuid(), Name = tag.Name, UserId = user.Id }); }
private void SaveMeasurements(User user, Log log, Event @event, IEnumerable<MeasurementData> values) { foreach (var value in values) MeasurementRepository.Create(new Measurement { Id = Guid.NewGuid(), GroupId = value.GroupId == Guid.Empty ? Guid.NewGuid() : value.GroupId, EventId = @event.Id, Date = @event.Date, Name = value.Name, Quantity = value.Quantity, Unit = value.Unit, LogId = log.Id, LogName = log.Name, UserId = user.Id }); }
private Event CreateEvent(LogData data, Log log) { var @event = new Event { Date = data.Date, Id = Guid.NewGuid(), LogId = log.Id, LogName = log.Name, UserId = data.User.Id }; EventRepository.Create(@event); return @event; }
public void Post(Event @event) { EventRepository.Create(@event); }